diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e6c881b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +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: Setup Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: "pnpm" + + - name: Install dependencies + run: pnpm install + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + version: pnpm ci:version + commit: "[ci]: release" + title: "[ci] Release" + publish: pnpm ci:publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index a14e006..63c21f7 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ "playground:dev": "pnpm --filter playground dev", "changeset": "changeset", "release": "node scripts/release.mjs", + "ci:version": "pnpm changeset version", + "ci:publish": "pnpm changeset publish", "lint": "biome check .", "lint:fix": "biome check --apply ." },