π Release + Publish #5
This file contains 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 + Publish | |
on: | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
attestations: write | |
steps: | |
- name: π₯ Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
# Required for fetching tags and generating release notes | |
fetch-depth: 0 | |
- name: π§ Setup Bun | |
uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2 | |
with: | |
bun-version-file: ".bun-version" | |
- name: π¦ Install dependencies | |
run: bun install --frozen-lockfile | |
- name: π§ Configure Git | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git config --global push.followTags true | |
- name: π Prepare release | |
run: bun run preversion | |
- name: π Generate changelog and release notes | |
run: | | |
bunx changelogen --release --push | |
bunx changelogen github release --token ${{ secrets.GITHUB_TOKEN }} | |
- name: π οΈ Build package | |
run: bun run build | |
- name: π¦ Publish to NPM Registry | |
run: | | |
bunx npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" | |
bunx npm publish --provenance --access public |