From c04392e97254a46759a66f64fc8c3e865c26479c Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 12 Oct 2024 13:59:20 +0800 Subject: [PATCH] chore: setup release workflow (#9) --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6963ef9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +# This action will publish the package to npm and create a GitHub release. +name: Release + +on: + # Run `npm run bump` to bump the version and create a git tag. + push: + tags: + - "v*" + + workflow_dispatch: + +permissions: + contents: write + id-token: write + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Pnpm + run: corepack enable + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + cache: "pnpm" + + - name: Install Dependencies + run: pnpm install + + - name: Publish + uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.RSBUILD_PLUGIN_NPM_TOKEN }} + + - name: Create GitHub Release + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: "true" diff --git a/package.json b/package.json index 877f959..8ebe0ac 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "lint": "biome check .", "lint:write": "biome check . --write", "prepare": "simple-git-hooks && npm run build", - "test": "playwright test" + "test": "playwright test", + "bump": "npx bumpp" }, "simple-git-hooks": { "pre-commit": "npx nano-staged"