v12.0.0 #22
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: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| id-token: write # Required for npm publish via OIDC | |
| contents: write # Required to make GitHub release | |
| concurrency: | |
| group: "release" | |
| cancel-in-progress: false | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install | |
| run: npm install | |
| - name: Build | |
| run: npm run dist | |
| - name: Pack | |
| run: npm pack | |
| - name: Extract changelog section | |
| run: | | |
| VERSION=${GITHUB_REF_NAME#v} | |
| awk -v ver="$VERSION" ' | |
| $0 ~ "^## \\["ver"\\]" {flag=1; next} | |
| /^## \[/ {flag=0} | |
| flag | |
| ' CHANGELOG.md > RELEASE_NOTES.md | |
| - name: Create GitHub Release | |
| run: | | |
| PACKAGE_FILE=$(ls *.tgz) | |
| ZIP_FILE=$(ls *.zip) | |
| gh release create "${GITHUB_REF_NAME}" "$PACKAGE_FILE" "$ZIP_FILE" \ | |
| --title "${GITHUB_REF_NAME}" \ | |
| --notes-file RELEASE_NOTES.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish to npm | |
| run: npm publish |