Repository navigation
fix(npm): read release packages from directory #5
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: Release | |
| on: | |
| push: | |
| tags: ["v*.*.*"] | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-bun | |
| - name: Validate version | |
| run: | | |
| version=$(node -p "require('./packages/miaopan-code/package.json').version") | |
| test "v$version" = "$GITHUB_REF_NAME" | |
| - name: Set release version | |
| run: echo "MIAOPAN_CODE_VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV" | |
| - name: Build CLI | |
| run: bun --cwd packages/miaopan-code run build | |
| env: | |
| MIAOPAN_CODE_CHANNEL: latest | |
| - name: Publish npm packages | |
| run: bun run --cwd packages/miaopan-code ./script/publish.ts | |
| env: | |
| NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Build VSIX | |
| working-directory: sdks/vscode | |
| run: | | |
| bun install --frozen-lockfile | |
| bun x @vscode/vsce package --no-git-tag-version --no-update-package-json --no-dependencies -o dist/miaopan-code.vsix | |
| - name: Package licenses and checksums | |
| run: | | |
| cp LICENSE NOTICE packages/miaopan-code/dist/ | |
| sha256sum packages/miaopan-code/dist/*.{zip,tar.gz} sdks/vscode/dist/miaopan-code.vsix schemas/config.json schemas/tui.json > SHA256SUMS | |
| - name: Publish GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release create "$GITHUB_REF_NAME" --generate-notes packages/miaopan-code/dist/*.zip packages/miaopan-code/dist/*.tar.gz packages/miaopan-code/dist/LICENSE packages/miaopan-code/dist/NOTICE sdks/vscode/dist/miaopan-code.vsix schemas/config.json schemas/tui.json SHA256SUMS |