From 89d89b32880cdcfb7255d05961165e609bf7ef19 Mon Sep 17 00:00:00 2001 From: Hanssen0 Date: Fri, 14 Feb 2025 10:06:55 +0800 Subject: [PATCH] chore: publish workflows --- .github/workflows/publish-canary.yaml | 41 +++++++++++++++++++++++++++ .github/workflows/publish.yaml | 3 +- 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-canary.yaml diff --git a/.github/workflows/publish-canary.yaml b/.github/workflows/publish-canary.yaml new file mode 100644 index 00000000..5878c9ec --- /dev/null +++ b/.github/workflows/publish-canary.yaml @@ -0,0 +1,41 @@ +name: Release to NPM Canary + +permissions: + contents: write + +on: workflow_dispatch + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Install dependencies + run: pnpm build:prepare + - name: Build + run: pnpm build + + - name: Version changesets + run: pnpm changeset version --snapshot canary + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish to npm canary + id: changesets + uses: changesets/action@v1 + with: + publish: pnpm changeset publish --tag canary + createGithubReleases: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index dfd48c8d..7b262db1 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -36,8 +36,7 @@ jobs: title: "chore: bump packages version" commit: "chore: bump packages version" version: pnpm run version - # This expects you to have a script called release which does a build for your packages and calls changeset publish - publish: pnpm run publish + publish: pnpm changeset publish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}