Add changeset for exit codes + related topics + dep updates #11
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: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| release: | |
| name: Changesets Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| registry-url: "https://registry.npmjs.org" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: npm install | |
| # Changesets action: | |
| # - If pending changesets: creates a "Version Package" PR | |
| # - If version PR just merged (no pending changesets): publishes | |
| # | |
| # version: runs via `npm run version` (changeset → vg bump → sync) | |
| # publish: npm publish with OIDC provenance (no NPM_TOKEN needed) | |
| - name: Create Release PR or Publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| title: "chore: version package" | |
| commit: "chore: version package" | |
| version: npm run version | |
| publish: npm publish --access public --provenance | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release | |
| if: steps.changesets.outputs.published == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| git tag "v${VERSION}" || true | |
| git push --tags || true | |
| gh release create "v${VERSION}" --title "v${VERSION}" --generate-release-notes || true |