Repository navigation
Merge pull request #1 from SahinurDEV/fix/release-workflow #12
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 | |
| # Runs semantic-release on every push to main. It only actually cuts a | |
| # release (version bump, CHANGELOG.md, git tag, GitHub release, npm publish) | |
| # when there are unreleased Conventional Commits (feat:/fix:/etc.) since the | |
| # last release, AND the NPM_TOKEN secret below is configured. Until you add | |
| # that secret, this workflow safely fails at the publish step and nothing is | |
| # published — publishing manually via `npm login && npm publish --access | |
| # public` (see RELEASE_NOTES.md) is unaffected either way. | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22.x | |
| cache: "npm" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint, typecheck, test | |
| run: | | |
| npm run lint | |
| npm run typecheck | |
| npm run test:coverage | |
| - name: Build | |
| run: npm run build | |
| - name: Release | |
| run: npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |