Release #6
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: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| type: choice | |
| description: 'Release Version' | |
| required: true | |
| default: 'latest' | |
| options: | |
| - next | |
| - beta | |
| - alpha | |
| - latest | |
| branch: | |
| description: 'Release Branch' | |
| required: true | |
| default: 'main' | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: Release | |
| if: github.event_name == 'workflow_dispatch' || github.event.comment.body == '/release' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 25 | |
| ref: ${{ github.event.inputs.branch || github.ref }} | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install wasm-pack | |
| run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
| - name: Install pnpm | |
| run: corepack enable | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 # npm OIDC requires CLI 11.5.1+ | |
| cache: 'pnpm' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install Dependencies | |
| run: pnpm install | |
| - name: Build @veaba/qrcode-shared | |
| run: pnpm --filter @veaba/qrcode-shared build | |
| - name: Build @veaba/qrcode-wasm | |
| run: pnpm --filter @veaba/qrcode-wasm build | |
| - name: Build @veaba/qrcode-js | |
| run: pnpm --filter @veaba/qrcode-js build | |
| - name: Build @veaba/qrcode-node | |
| run: pnpm --filter @veaba/qrcode-node build | |
| - name: Build @veaba/qrcode-bun | |
| run: pnpm --filter @veaba/qrcode-bun build | |
| - name: Create Release Pull Request or Publish | |
| uses: changesets/action@v1 | |
| with: | |
| version: pnpm ci:version | |
| publish: pnpm ci:publish | |
| commit: "chore: version packages" | |
| title: "chore: version packages" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # 注意:使用 OIDC 认证,不需要 NODE_AUTH_TOKEN | |
| # 确保在 npmjs.com 上为每个包配置了 Trusted Publisher: | |
| # https://www.npmjs.com/package/@veaba/xxx/access | |
| # Publisher 配置: org=veaba, repo=qrcodes, workflow=release.yml |