primitives@1.1.2 #156
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 | |
| # Rules that triggers the workflows | |
| on: | |
| release: | |
| types: | |
| - created | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write # needed for provenance data generation | |
| jobs: | |
| publish: | |
| name: Publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/setup | |
| - name: Build | |
| run: pnpm primitives:build | |
| - name: Build Schematics | |
| run: pnpm primitives:build:schematics | |
| - name: Publish package 📦 | |
| run: | | |
| VERSION="$(node -p "require('./packages/primitives/package.json').version")" | |
| if [[ "$VERSION" == *-* ]]; then | |
| # Prerelease (e.g. 1.0.0-beta.0) -> publish under its identifier dist-tag (beta/rc/alpha), | |
| # never "latest", so `npm i @radix-ng/primitives` keeps resolving the stable release. | |
| TAG="$(printf '%s' "$VERSION" | sed -E 's/^[0-9.]+-([0-9A-Za-z]+).*/\1/')" | |
| else | |
| TAG="latest" | |
| fi | |
| echo "Publishing $VERSION under dist-tag: $TAG" | |
| npx nx release publish --tag "$TAG" | |
| shell: bash | |
| env: | |
| NPM_CONFIG_PROVENANCE: true |