From ef73e8a91b32ca08d92a73ad9cdf36cfe3d7fc45 Mon Sep 17 00:00:00 2001 From: Christian Sturm Date: Sat, 18 Jan 2025 18:48:52 +0100 Subject: [PATCH 1/2] chore: add ci-release script --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 893e229..f898453 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "test": "vitest run", "ci": "npm run lint && npm run check-format && npm run test && npm run check-exports && npm run build", "local-release": "changeset version && changeset publish", + "ci-release": "npm run build && changeset publish", "prepublishOnly": "npm run ci" }, "devDependencies": { From c023d5b110ffb4d5488dcab88d2609599d1332ee Mon Sep 17 00:00:00 2001 From: Christian Sturm Date: Sat, 18 Jan 2025 18:49:22 +0100 Subject: [PATCH 2/2] ci: add release action --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) 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..ff1306c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Use Node + uses: actions/setup-node@v4 + with: + node-version: "lts/*" + + - name: Install Dependencies + run: npm ci + + - name: Create Release Pull Request + id: changesets + uses: changesets/action@v1 + with: + # This expects you to have a script called release which does a build for your packages and calls changeset publish + publish: npm run ci-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }}