Release react-router-busy #28
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: | |
workflow_dispatch: | |
permissions: | |
contents: read # for checkout | |
# Don't run publish multiple times at once | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
# Still need to run all steps of validation here because integrate action only verifies code from PRs but I'm pushing to main, so want to not release on bad code I did | |
quality: | |
if: github.repository == 'bitofbreeze/react-router-busy' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Biome | |
uses: biomejs/setup-biome@v2 | |
with: | |
version: latest | |
- name: Run Biome | |
run: biome ci . | |
validate: | |
needs: [quality] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Bun | |
uses: oven-sh/[email protected] | |
with: | |
bun-version: latest | |
- name: Install dependencies (`npm ci`) | |
# Different set of dependencies due to subset of packages causes lockfile changes that cause failure, so we don't copy lockfile over | |
# https://github.com/oven-sh/bun/issues/5792#issuecomment-2325444077 | |
run: bun install | |
- name: Test | |
run: bun test --filter react-router-busy --coverage | |
# Build checks types so no need for separate typecheck step | |
- name: Build | |
run: bun --filter react-router-busy build | |
- name: Check exports | |
run: bun --filter react-router-busy check-exports | |
release: | |
needs: [validate] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # to be able to publish a GitHub release | |
issues: write # to be able to comment on released issues | |
pull-requests: write # to be able to comment on released pull requests | |
id-token: write # to enable use of OIDC for npm provenance | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Bun | |
uses: oven-sh/[email protected] | |
with: | |
bun-version: latest | |
scope: "react-router-busy" | |
- name: Install dependencies (`npm ci`) | |
# Different set of dependencies due to subset of packages causes lockfile changes that cause failure, so we don't copy lockfile over | |
run: bun install | |
# Note we have to toggle Workflow permissions > Allow GitHub Actions to create and approve pull requests in https://github.com/bitofbreeze/mono/settings/actions | |
# Even with permissions above https://github.com/orgs/community/discussions/27689#discussioncomment-5707424 | |
# Could avoid this with personal access token https://microsoft.github.io/beachball/concepts/ci-integration.html#authentication | |
- name: Release | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
working_directory: ./packages/react-router-busy | |
env: | |
GITHUB_TOKEN: ${{ secrets.COPY_GITHUB_REPO_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |