v20.0.0 #17
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: Release | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # needed for provenance data generation | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| filter: tree:0 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: pnpm install --frozen-lockfile | |
| - name: Print Environment Info | |
| run: npx nx report | |
| shell: bash | |
| - name: Extract Project from GitHub Release Tag | |
| id: extract-project | |
| run: | | |
| RELEASE_TAG=${{ github.event.release.tag_name }} | |
| PROJECT_NAME=$(echo $RELEASE_TAG | sed -E 's/(.+)@v.*/\1/') | |
| echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV | |
| echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV | |
| echo "Project name: $PROJECT_NAME extracted from tag: $RELEASE_TAG" | |
| shell: bash | |
| - name: Determine if Prerelease | |
| id: check-prerelease | |
| run: | | |
| IS_PRERELEASE=${{ github.event.release.prerelease }} | |
| NPM_TAG="latest" | |
| if [ "$IS_PRERELEASE" = "true" ]; then | |
| NPM_TAG="next" | |
| fi | |
| echo "NPM_TAG=$NPM_TAG" >> $GITHUB_ENV | |
| echo "Publishing with NPM tag: $NPM_TAG" | |
| shell: bash | |
| - name: Build | |
| run: pnpm exec nx build ${{ env.PROJECT_NAME }} | |
| shell: bash | |
| - name: Publish Package | |
| shell: bash | |
| run: pnpm exec nx release publish --projects=${{ env.PROJECT_NAME }} --tag=${{ env.NPM_TAG }} | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true | |
| # This is needed for actions/setup-node authentication to work | |
| npm_config_registry: https://registry.npmjs.org | |
| deploy-docs: | |
| name: '[Merge] Deploy docs to GitHub Pages' | |
| needs: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| actions: read | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Check out the source code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| # Uses the cache generated in the distributed step | |
| - name: Build docs | |
| run: pnpm exec nx build docs-lumberjack-docs-app | |
| - name: Set up GitHub Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload docs to GitHub Pages | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: dist/packages/docs/lumberjack-docs-app/ | |
| - name: Deploy docs to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |