Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
72f2c25fcb | |||
552dc5524b | |||
f3cad8bcbf | |||
07a2257003 | |||
d5382d3e6f | |||
a0e2122208 | |||
8836085300 | |||
86463358d8 | |||
46b284799f | |||
37fd9d0351 | |||
39ba0b9d81 |
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
@ -12,13 +12,9 @@ updates:
|
||||
- dependency-name: node-fetch
|
||||
versions:
|
||||
- ">=3.0.0"
|
||||
# ignore mime and @types/mime per https://github.com/softprops/action-gh-release/pull/475
|
||||
- dependency-name: mime
|
||||
- dependency-name: "@types/node"
|
||||
versions:
|
||||
- ">=4.0.0"
|
||||
- dependency-name: "@types/mime"
|
||||
versions:
|
||||
- ">=4.0.0"
|
||||
- ">=22.0.0"
|
||||
commit-message:
|
||||
prefix: "chore(deps)"
|
||||
- package-ecosystem: github-actions
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@ __tests__/runner/*
|
||||
# actions requires a node_modules dir https://github.com/actions/toolkit/blob/master/docs/javascript-action.md#publish-a-releasesv1-action
|
||||
# but its recommended not to check these in https://github.com/actions/toolkit/blob/master/docs/action-versioning.md#recommendations
|
||||
node_modules
|
||||
coverage
|
||||
|
@ -1 +1 @@
|
||||
nodejs 20.15.1
|
||||
nodejs 24.2.0
|
||||
|
17
CHANGELOG.md
17
CHANGELOG.md
@ -1,3 +1,20 @@
|
||||
## 2.3.2
|
||||
|
||||
* fix: revert fs `readableWebStream` change
|
||||
|
||||
## 2.3.1
|
||||
|
||||
### Bug fixes 🐛
|
||||
|
||||
* fix: fix file closing issue by @WailGree in https://github.com/softprops/action-gh-release/pull/629
|
||||
|
||||
## 2.3.0
|
||||
|
||||
* Migrate from jest to vitest
|
||||
* Replace `mime` with `mime-types`
|
||||
* Bump to use node 24
|
||||
* Dependency updates
|
||||
|
||||
## 2.2.2
|
||||
|
||||
## What's Changed
|
||||
|
@ -7,6 +7,8 @@ import {
|
||||
findTagFromReleases,
|
||||
} from "../src/github";
|
||||
|
||||
import { describe, it } from "vitest";
|
||||
|
||||
describe("github", () => {
|
||||
describe("mimeOrDefault", () => {
|
||||
it("returns a specific mime for common path", async () => {
|
||||
|
@ -10,6 +10,8 @@ import {
|
||||
} from "../src/util";
|
||||
import * as assert from "assert";
|
||||
|
||||
import { describe, it, expect } from "vitest";
|
||||
|
||||
describe("util", () => {
|
||||
describe("uploadUrl", () => {
|
||||
it("strips template", () => {
|
||||
|
19
dist/index.js
vendored
19
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -1,16 +0,0 @@
|
||||
import type { JestConfigWithTsJest } from 'ts-jest';
|
||||
|
||||
const config: JestConfigWithTsJest = {
|
||||
preset: 'ts-jest/presets/default-esm',
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/*.test.ts'],
|
||||
testRunner: 'jest-circus/runner',
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest',
|
||||
},
|
||||
verbose: true,
|
||||
};
|
||||
|
||||
export default config;
|
5140
package-lock.json
generated
5140
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
29
package.json
29
package.json
@ -1,13 +1,14 @@
|
||||
{
|
||||
"name": "action-gh-release",
|
||||
"version": "2.2.2",
|
||||
"version": "2.3.2",
|
||||
"private": true,
|
||||
"description": "GitHub Action for creating GitHub Releases",
|
||||
"main": "lib/main.js",
|
||||
"scripts": {
|
||||
"build": "ncc build src/main.ts --minify",
|
||||
"build": "ncc build src/main.ts --minify --target es2022",
|
||||
"build-debug": "ncc build src/main.ts --v8-cache --source-map",
|
||||
"test": "jest",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"test": "vitest --coverage",
|
||||
"fmt": "prettier --write \"src/**/*.ts\" \"__tests__/**/*.ts\"",
|
||||
"fmtcheck": "prettier --check \"src/**/*.ts\" \"__tests__/**/*.ts\"",
|
||||
"updatetag": "git tag -d v2 && git push origin :v2 && git tag -a v2 -m '' && git push origin v2"
|
||||
@ -22,24 +23,22 @@
|
||||
"author": "softprops",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/github": "^6.0.0",
|
||||
"@octokit/plugin-retry": "^7.2.1",
|
||||
"@octokit/plugin-throttling": "^10.0.0",
|
||||
"glob": "^11.0.1",
|
||||
"mime": "^3.0.0"
|
||||
"@actions/github": "^6.0.1",
|
||||
"@octokit/plugin-retry": "^8.0.1",
|
||||
"@octokit/plugin-throttling": "^11.0.1",
|
||||
"glob": "^11.0.2",
|
||||
"mime-types": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "^8.1.0",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/mime": "^3.0.1",
|
||||
"@types/node": "^22.14.1",
|
||||
"@types/mime-types": "^3.0.1",
|
||||
"@types/node": "^20.17.32",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"jest": "^29.3.1",
|
||||
"jest-circus": "^29.3.1",
|
||||
"@vitest/coverage-v8": "^3.1.4",
|
||||
"prettier": "3.5.3",
|
||||
"ts-jest": "^29.3.2",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-formatter": "^7.2.2"
|
||||
"typescript-formatter": "^7.2.2",
|
||||
"vitest": "^3.1.4"
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { GitHub } from "@actions/github/lib/utils";
|
||||
import { Config, isTag, releaseBody, alignAssetName } from "./util";
|
||||
import { statSync } from "fs";
|
||||
import { open } from "fs/promises";
|
||||
import { getType } from "mime";
|
||||
import { lookup } from "mime-types";
|
||||
import { basename } from "path";
|
||||
import { alignAssetName, Config, isTag, releaseBody } from "./util";
|
||||
|
||||
type GitHub = InstanceType<typeof GitHub>;
|
||||
|
||||
@ -149,7 +149,7 @@ export const asset = (path: string): ReleaseAsset => {
|
||||
};
|
||||
|
||||
export const mimeOrDefault = (path: string): string => {
|
||||
return getType(path) || "application/octet-stream";
|
||||
return lookup(path) || "application/octet-stream";
|
||||
};
|
||||
|
||||
export const upload = async (
|
||||
|
@ -3,8 +3,8 @@
|
||||
"useUnknownInCatchVariables": false,
|
||||
/* Basic Options */
|
||||
// "incremental": true, /* Enable incremental compilation */
|
||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||
"target": "es2022",
|
||||
"module": "NodeNext",
|
||||
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
@ -25,6 +25,7 @@
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
"skipLibCheck": true,
|
||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
||||
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
||||
@ -44,7 +45,7 @@
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
"types": ["vitest/globals"],
|
||||
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
@ -60,5 +61,5 @@
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
},
|
||||
"exclude": ["node_modules", "**/*.test.ts", "jest.config.ts"]
|
||||
"exclude": ["node_modules", "**/*.test.ts", "vitest.config.ts"]
|
||||
}
|
||||
|
11
vitest.config.ts
Normal file
11
vitest.config.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
environment: 'node',
|
||||
coverage: {
|
||||
reporter: ['text', 'lcov'],
|
||||
},
|
||||
include: ['__tests__/**/*.ts'],
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user