This repository was archived by the owner on Nov 24, 2025. It is now read-only.
1.0.14 #12
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: | |
| contents: write | |
| packages: write | |
| jobs: | |
| verify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| - name: Get package info | |
| id: package | |
| uses: codex-team/action-nodejs-package-info@v1 | |
| - name: Check version match | |
| run: | | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| PACKAGE_VERSION="${{ steps.package.outputs.version }}" | |
| if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then | |
| echo "Error: Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)" | |
| exit 1 | |
| fi | |
| echo "✅ Version in package.json matches GitHub tag" | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: verify | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Lint | |
| run: npm run lint | |
| - name: Build | |
| run: npm run build | |
| - name: Run tests | |
| run: npm test || echo "No tests found, skipping test step" | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build | |
| run: npm run build | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| body: | | |
| ${{ steps.changelog.outputs.changelog }} | |
| **Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ github.ref_name }}...HEAD | |
| draft: false | |
| prerelease: false | |
| - name: Publish to NPM | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |