在 main 函数中添加调试信息,输出命令行参数 #203
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: [push, pull_request] | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
strategy: | |
matrix: | |
go: ["^1.24"] | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
name: Go ${{ matrix.go }} in ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Environment | |
run: | | |
go version | |
go env | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.64.4 | |
args: -v --timeout 5m0s | |
- name: Format | |
run: make format | |
- name: Test | |
env: | |
DEBUG: 1 | |
run: make test | |
release: | |
name: Release to Github | |
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'axetroy/nodapt' | |
needs: [ci] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "^1.24" | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: "https://registry.npmjs.org" | |
- uses: release-lab/setup-whatchanged@v1 | |
with: | |
version: v0.5.6 | |
- name: Generate release.md | |
run: | | |
whatchanged --output=release.md | |
cat release.md | |
- name: Release to Github | |
uses: goreleaser/goreleaser-action@v6 | |
with: | |
distribution: goreleaser | |
version: v2.7.0 | |
args: release --clean --release-notes=./release.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Prepare npm package | |
run: node npm/prepare.js | |
env: | |
GIT_REF: ${{ github.ref }} | |
- name: Publish npm package | |
run: node npm/publish.js | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Sync CNPM | |
run: | | |
curl -X PUT https://registry-direct.npmmirror.com/-/package/nodapt/syncs | |
curl -X PUT https://registry-direct.npmmirror.com/-/package/@axetroy/nodapt-darwin-amd64/syncs | |
curl -X PUT https://registry-direct.npmmirror.com/-/package/@axetroy/nodapt-darwin-arm64/syncs | |
curl -X PUT https://registry-direct.npmmirror.com/-/package/@axetroy/nodapt-linux-amd64/syncs | |
curl -X PUT https://registry-direct.npmmirror.com/-/package/@axetroy/nodapt-linux-arm64/syncs | |
curl -X PUT https://registry-direct.npmmirror.com/-/package/@axetroy/nodapt-windows-amd64/syncs | |
curl -X PUT https://registry-direct.npmmirror.com/-/package/@axetroy/nodapt-windows-arm64/syncs |