2.2.2 #14
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: Publish | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: ['v*.*.*'] | |
| jobs: | |
| publish: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| node: ['23.6.0'] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Wait for the CI workflow to complete | |
| id: wait-for-ci | |
| uses: fountainhead/action-wait-for-check@v1.0.0 | |
| with: | |
| checkName: ci | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Fail if CI has failed | |
| if: steps.wait-for-ci.outputs.conclusion != 'success' | |
| run: exit 1 | |
| - name: Check out the repository | |
| uses: actions/checkout@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Download the build | |
| uses: dawidd6/action-download-artifact@v7 | |
| with: | |
| workflow: ci.yml | |
| name: build | |
| path: dist | |
| commit: ${{ github.sha }} | |
| - name: Make the package public | |
| run: npx json -I -f package.json -e "delete this.private" | |
| - name: Publish to NPM | |
| run: npm publish --registry=https://registry.npmjs.org/ --//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} | |
| - name: Add the repository owner as the scope if it's not set | |
| run: 'npx json -I -f package.json -e "this.name[0] !== ''@'' && (this.name = ''@${{ github.repository_owner }}/'' + this.name)"' | |
| - name: Publish to GPR | |
| run: npm publish --registry=https://npm.pkg.github.com/ --//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }} |