fix(release): add NPM token check in release workflow to ensure NODE_… #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: | |
| push: | |
| branches: ['dev/test-ci'] | |
| permissions: | |
| # allow pushing commits, creating tags, and modifying repo files | |
| # needed for the workflow to update package.json versions and CHANGELOG files | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check NPM Token | |
| id: check-token | |
| run: | | |
| if [ -z "${{ secrets.NODE_AUTH_TOKEN }}" ]; then | |
| echo "npm-token-exists=false" >> $GITHUB_OUTPUT | |
| echo "⚠️ NODE_AUTH_TOKEN secret is not set. Skipping release steps." | |
| else | |
| echo "npm-token-exists=true" >> $GITHUB_OUTPUT | |
| echo "✅ NODE_AUTH_TOKEN secret is available." | |
| fi | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| components: rust-std | |
| - name: Install wasm-pack | |
| uses: jetli/[email protected] | |
| with: | |
| version: 'latest' | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.18.0' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Setup PNPM | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.15.0 | |
| - name: Install Dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm build | |
| # - name: Release | |
| # if: steps.check-token.outputs.npm-token-exists == 'true' | |
| # env: | |
| # NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
| # run: | | |
| # # Add your release commands here | |
| # # e.g., npx changeset publish |