fix: 编译 删除自动构建

This commit is contained in:
fengjun
2024-08-29 17:57:07 +08:00
parent 0816181586
commit 7af9e21506
9 changed files with 67 additions and 316 deletions

1
.github/FUNDING.yml vendored
View File

@@ -1 +0,0 @@
github: [KengoTODA]

View File

@@ -1,45 +0,0 @@
name: Publish semantic tags
on:
release:
types:
- published
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
# Release with semantic tag like v1.0.3
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: npm install semver
- name: Get versions
uses: actions/github-script@v7
id: batch
env:
TAG_NAME: ${{ github.event.release.tag_name }}
with:
script: |
const semver = require('semver')
const { TAG_NAME } = process.env
return {
minor: `v${semver.major(TAG_NAME).toString()}.${semver.minor(TAG_NAME).toString()}`,
major: `v${semver.major(TAG_NAME).toString()}`
}
- run: |
git tag -f "$MAJOR_VER"
git tag -f "$MINOR_VER"
git push origin -f "$MAJOR_VER"
git push origin -f "$MINOR_VER"
env:
MAJOR_VER: ${{ fromJSON(steps.batch.outputs.result).major }}
MINOR_VER: ${{ fromJSON(steps.batch.outputs.result).minor }}

View File

@@ -1,64 +0,0 @@
name: 'build-test'
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
- 'releases/*'
jobs:
build: # make sure build/ci work properly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Make sure the release step uses its own credentials.
persist-credentials: false
- uses: actions/setup-node@v4
with:
cache: npm
node-version-file: '.nvmrc'
- run: |
npm ci
npm run all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run semantic-release
run: |
npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.PAT_TO_PUSH }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
test: # make sure the action works on a clean machine without building
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: ./
with:
version: '1.26.2'
- uses: ./
with:
version: '2.4.1'
- uses: ./
with:
version: 'v2.4.1'
- uses: ./
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
actionlint:
runs-on: ubuntu-latest
if: github.event.pull_request
permissions:
contents: read
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-actionlint@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
reporter: github-pr-review

View File

@@ -1,13 +0,0 @@
name: 'Setup docker-compose'
description: 'Automate download and set up process for docker-compose command'
author: 'Kengo TODA <skypencil@gmail.com>'
inputs:
version:
default: 'latest'
description: 'the version of docker-compose command'
branding:
color: blue
icon: play
runs:
using: 'node20'
main: 'dist/index.js'

8
dist/index.js vendored
View File

@@ -30,7 +30,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.install = exports.runCommand = void 0; exports.runCommand = runCommand;
exports.install = install;
const tool_cache_1 = __nccwpck_require__(7784); const tool_cache_1 = __nccwpck_require__(7784);
const exec_1 = __nccwpck_require__(1514); const exec_1 = __nccwpck_require__(1514);
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
@@ -49,14 +50,14 @@ async function runCommand(command) {
} }
return output.trim(); return output.trim();
} }
exports.runCommand = runCommand;
async function installOnLinux(version) { async function installOnLinux(version) {
const system = runCommand('uname -s'); const system = runCommand('uname -s');
const hardware = runCommand('uname -m'); const hardware = runCommand('uname -m');
if (!version.startsWith('v') && parseInt(version.split('.')[0], 10) >= 2) { if (!version.startsWith('v') && parseInt(version.split('.')[0], 10) >= 2) {
version = `v${version}`; version = `v${version}`;
} }
const url = `https://github.com/docker/compose/releases/download/${version}/docker-compose-${await system}-${await hardware}`; const url = `https://gh.api.99988866.xyz/https://github.com/docker/compose/releases/download/${version}/docker-compose-${await system}-${await hardware}`;
runCommand(`echo ${url}`);
const installerPath = await (0, tool_cache_1.downloadTool)(url); const installerPath = await (0, tool_cache_1.downloadTool)(url);
await (0, exec_1.exec)(`chmod +x ${installerPath}`); await (0, exec_1.exec)(`chmod +x ${installerPath}`);
const cachedPath = await (0, tool_cache_1.cacheFile)(installerPath, 'docker-compose', 'docker-compose', version); const cachedPath = await (0, tool_cache_1.cacheFile)(installerPath, 'docker-compose', 'docker-compose', version);
@@ -82,7 +83,6 @@ async function install(version) {
throw new Error(`Unsupported platform: ${process.platform}`); throw new Error(`Unsupported platform: ${process.platform}`);
} }
} }
exports.install = install;
/***/ }), /***/ }),

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

223
package-lock.json generated
View File

@@ -8217,23 +8217,6 @@
"url": "https://github.com/chalk/ansi-regex?sponsor=1" "url": "https://github.com/chalk/ansi-regex?sponsor=1"
} }
}, },
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": { "node_modules/npm/node_modules/@isaacs/cliui/node_modules/emoji-regex": {
"version": "9.2.2", "version": "9.2.2",
"dev": true, "dev": true,
@@ -8257,56 +8240,6 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width-cjs": {
"name": "string-width",
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true,
"inBundle": true,
"license": "MIT"
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width-cjs/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": { "node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi": {
"version": "7.1.0", "version": "7.1.0",
"dev": true, "dev": true,
@@ -8322,101 +8255,6 @@
"url": "https://github.com/chalk/strip-ansi?sponsor=1" "url": "https://github.com/chalk/strip-ansi?sponsor=1"
} }
}, },
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi-cjs": {
"name": "strip-ansi",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/strip-ansi-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs": {
"name": "wrap-ansi",
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"dev": true,
"inBundle": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true,
"inBundle": true,
"license": "MIT"
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/@isaacs/cliui/node_modules/wrap-ansi-cjs/node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/@isaacs/string-locale-compare": { "node_modules/npm/node_modules/@isaacs/string-locale-compare": {
"version": "1.1.0", "version": "1.1.0",
"dev": true, "dev": true,
@@ -10592,6 +10430,21 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/npm/node_modules/string-width-cjs": {
"name": "string-width",
"version": "4.2.3",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/strip-ansi": { "node_modules/npm/node_modules/strip-ansi": {
"version": "6.0.1", "version": "6.0.1",
"dev": true, "dev": true,
@@ -10604,6 +10457,19 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/npm/node_modules/strip-ansi-cjs": {
"name": "strip-ansi",
"version": "6.0.1",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/npm/node_modules/supports-color": { "node_modules/npm/node_modules/supports-color": {
"version": "9.4.0", "version": "9.4.0",
"dev": true, "dev": true,
@@ -10818,6 +10684,39 @@
"url": "https://github.com/chalk/wrap-ansi?sponsor=1" "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
} }
}, },
"node_modules/npm/node_modules/wrap-ansi-cjs": {
"name": "wrap-ansi",
"version": "7.0.0",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/npm/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": {
"version": "4.3.0",
"dev": true,
"inBundle": true,
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": { "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-regex": {
"version": "6.0.1", "version": "6.0.1",
"dev": true, "dev": true,

View File

@@ -48,30 +48,5 @@
"semantic-release": "^24.0.0", "semantic-release": "^24.0.0",
"ts-jest": "^29.0.0", "ts-jest": "^29.0.0",
"typescript": "^5.0.0" "typescript": "^5.0.0"
},
"release": {
"branches": "main",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/exec",
{
"prepare": "npm run package"
}
],
[
"@semantic-release/git",
{
"assets": [
"dist",
"package.json"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
} }
} }

View File

@@ -25,7 +25,7 @@ async function installOnLinux(version: string): Promise<string> {
version = `v${version}` version = `v${version}`
} }
const url = `https://gh.api.99988866.xyz/https://github.com/docker/compose/releases/download/${version}/docker-compose-${await system}-${await hardware}` const url = `https://gh.api.99988866.xyz/https://github.com/docker/compose/releases/download/${version}/docker-compose-${await system}-${await hardware}`
runCommand('echo ' + url) runCommand(`echo ${url}`)
const installerPath = await downloadTool(url) const installerPath = await downloadTool(url)
await exec(`chmod +x ${installerPath}`) await exec(`chmod +x ${installerPath}`)
const cachedPath = await cacheFile( const cachedPath = await cacheFile(