Release #19
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: | |
| npm_tag: | |
| type: choice | |
| description: 'Specify npm tag' | |
| required: true | |
| default: 'alpha' | |
| options: | |
| - alpha | |
| - beta | |
| - rc | |
| - canary | |
| - latest | |
| npm_tag_confirm: | |
| type: choice | |
| description: 'Confirm npm tag' | |
| required: true | |
| options: | |
| - alpha | |
| - beta | |
| - rc | |
| - canary | |
| - latest | |
| permissions: {} | |
| jobs: | |
| validate_inputs: | |
| name: Validate Inputs | |
| if: github.repository == 'rstackjs/rstack-cli' && github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Validate npm tag confirmation | |
| env: | |
| NPM_TAG: ${{ inputs.npm_tag }} | |
| NPM_TAG_CONFIRM: ${{ inputs.npm_tag_confirm }} | |
| run: | | |
| if [ "$NPM_TAG" != "$NPM_TAG_CONFIRM" ]; then | |
| echo "Error: npm_tag and npm_tag_confirm must match" | |
| echo "npm_tag: $NPM_TAG" | |
| echo "npm_tag_confirm: $NPM_TAG_CONFIRM" | |
| exit 1 | |
| fi | |
| echo "npm_tag validation passed: $NPM_TAG" | |
| native: | |
| name: Build native packages | |
| needs: validate_inputs | |
| permissions: | |
| contents: read | |
| uses: ./.github/workflows/reusable-native-release.yml | |
| release: | |
| name: Release | |
| if: github.repository == 'rstackjs/rstack-cli' && github.event_name == 'workflow_dispatch' | |
| needs: native | |
| runs-on: ubuntu-latest | |
| environment: npm | |
| permissions: | |
| contents: read | |
| # Provenance generation in GitHub Actions requires "write" access to the "id-token" | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | |
| with: | |
| node-version: 24.18.1 | |
| package-manager-cache: false | |
| - name: Setup Pnpm | |
| uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | |
| with: | |
| run_install: true | |
| - name: Build | |
| run: node --run build | |
| - name: Prepare release | |
| run: node --run release:prepare | |
| - name: Download native packages | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: native-packages | |
| path: packages/rstack/npm | |
| - name: Prepare native packages | |
| run: pnpm --dir packages/rstack exec napi pre-publish --config-path napi.json --skip-optional-publish --no-gh-release | |
| - name: Publish to npm | |
| env: | |
| NPM_TAG: ${{ inputs.npm_tag }} | |
| run: | | |
| pnpm --dir packages/rstack/npm -r publish --tag "$NPM_TAG" --no-git-checks | |
| pnpm --filter './packages/*' -r stage publish --tag "$NPM_TAG" --no-git-checks |