v1.2.0 #4
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 🚀 | |
| permissions: | |
| id-token: write | |
| contents: write | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Update version from release tag | |
| env: | |
| TAG_NAME: ${{ github.event.release.tag_name }} | |
| run: | | |
| VERSION="${TAG_NAME#v}" | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| if [ "$CURRENT_VERSION" = "$VERSION" ]; then | |
| echo "Version already matches ($VERSION), skipping bump." | |
| exit 0 | |
| fi | |
| npm version "$VERSION" --no-git-tag-version | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add package.json package-lock.json | |
| git commit -m "chore: bumped version to $VERSION for release" | |
| git push origin main | |
| - name: Install Dependencies ⤵️ | |
| run: npm ci | |
| - name: Build 🏗️ | |
| run: npm run build | |
| - name: Publish 🚀 | |
| run: npm publish --provenance | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |