Publish #53
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: | |
| jobs: | |
| test: | |
| name: Publish | |
| runs-on: ubuntu-latest | |
| environment: production | |
| permissions: | |
| contents: read | |
| id-token: write # needed for provenance data generation | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| - uses: ./.github/actions/setup-node | |
| - run: pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} | |
| - name: Build publishable packages | |
| run: pnpm nx run-many -p="tag:npm:public" -t=build | |
| - name: Print Environment Info | |
| run: pnpm nx report | |
| shell: bash | |
| - name: Determine npm tag | |
| id: npm-tag | |
| run: | | |
| BRANCH_NAME=${GITHUB_REF#refs/heads/} | |
| if [ "$BRANCH_NAME" = "main" ]; then | |
| echo "tag=latest" >> $GITHUB_OUTPUT | |
| else | |
| echo "tag=$BRANCH_NAME" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Publish packages | |
| run: pnpm nx release publish --excludeTaskDependencies --tag=${{ steps.npm-tag.outputs.tag }} | |
| shell: bash |