fix(ci): run jsr publish from package directory #8
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 | |
on: | |
push: | |
branches: [main, next] | |
pull_request: | |
branches: [main, next] | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
TURBO_REMOTE_ONLY: true | |
jobs: | |
release: | |
name: π Release | |
# prevents this action from running on forks | |
if: ${{ github.repository_owner == 'galaxiajs' }} | |
permissions: | |
contents: write # to create release (changesets/action) | |
id-token: write | |
pull-requests: write # to create pull request (changesets/action) | |
runs-on: ubuntu-latest | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits | |
fetch-depth: 0 | |
- name: π€ Install Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: π€ Install dependencies | |
run: bun install | |
- name: π Build Packages | |
run: bun run build | |
- name: πͺ’ Create Release Pull Request | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: bun run release | |
commit: 'chore(ci): release' | |
title: 'chore(ci): release' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
jsr: | |
name: π Publish to JSR | |
runs-on: ubuntu-latest | |
# prevents this action from running on forks | |
if: ${{ github.repository_owner == 'galaxiajs' }} | |
permissions: | |
contents: read | |
id-token: write # The OIDC ID token is used for authentication with JSR. | |
steps: | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: π€ Install Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: π Publish to JSR | |
run: bunx jsr publish | |
working-directory: packages/msw-ssr-interceptor |