From 05b74e03febe438aa8e17ff7c8542f3dbe8fb17a Mon Sep 17 00:00:00 2001 From: Tavian Taylor Date: Wed, 20 Aug 2025 14:23:48 +0100 Subject: [PATCH] allow changeset to create beta releases --- .changeset/config.json | 1 + .github/workflows/release.yml | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/.changeset/config.json b/.changeset/config.json index ba9dbcc3..36f299c4 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -8,6 +8,7 @@ "fixed": [], "linked": [], "access": "public", + "canary": true, "baseBranch": "main", "updateInternalDependencies": "patch", "ignore": [] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 373aec06..8f24dbd0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,7 @@ on: - CI branches: - main + - beta types: - completed @@ -13,7 +14,7 @@ jobs: release: name: Release # run only if the CI workflow is successful - if: ${{ github.event.workflow_run.conclusion == 'success' }} + if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }} runs-on: ubuntu-latest steps: - name: ⬇️ Checkout @@ -45,6 +46,34 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }} NPM_TOKEN: ${{ secrets.NPM_API_KEY }} + release_beta: + name: Release (beta) + if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'beta' }} + runs-on: ubuntu-latest + steps: + - name: ⬇️ Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.workflow_run.head_commit.id }} + + - name: ⎔ Setup node + uses: actions/setup-node@v3 + with: + node-version: "lts/*" + + - name: 🏗 Install and Build + run: | + npm ci + npm run build + + - name: 🚀 Publish Pre-release to npm + id: changesets + uses: changesets/action@v1 + with: + publish: npm run release -- --tag beta + env: + GITHUB_TOKEN: ${{ secrets.STACKS_TOOLING_GH_RW_PAT }} + NPM_TOKEN: ${{ secrets.NPM_API_KEY }} # cancel the jobs if another workflow is kicked off for the same branch concurrency: