Merge pull request #77 from bejamas/fix/build-fixes-and-version-bump #226
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: Latest Release | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write # npm Trusted Publishing (OIDC) | |
| jobs: | |
| release: | |
| if: github.repository_owner == 'bejamas' | |
| name: Build & Publish a latest release to NPM | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: { fetch-depth: 0 } | |
| - uses: oven-sh/setup-bun@v2 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: https://registry.npmjs.org | |
| - run: bun install | |
| - run: bun run build:packages | |
| # This action creates the "Version Packages" PR when needed, | |
| # and on merge runs the publish command below. | |
| - name: Changesets | |
| id: cs | |
| uses: changesets/action@v1 | |
| with: | |
| publish: npx changeset publish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_CONFIG_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | |
| NPM_CONFIG_PROVENANCE: true | |
| - if: ${{ steps.cs.outputs.published == 'true' }} | |
| run: echo "Published to latest" |