From fe15c201ab8fa1a39a7aad8929a8e47792e00b30 Mon Sep 17 00:00:00 2001 From: Daulet Amirkhanov Date: Thu, 26 Mar 2026 13:07:04 +0000 Subject: [PATCH] chore: add GitHub Actions workflow for automated release and npm publishing --- .github/workflows/release.yml | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 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..c02799b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +name: Release + +on: + push: + branches: + - main + workflow_dispatch: + inputs: + publish-only: + description: "Skip release-please and just publish to npm (use after a failed publish)" + type: boolean + default: false + +concurrency: + group: release + cancel-in-progress: false + +jobs: + release-please: + if: ${{ !inputs.publish-only }} + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + issues: write + outputs: + release_created: ${{ steps.release.outputs.release_created }} + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + + publish-npm: + needs: release-please + if: ${{ always() && (needs.release-please.outputs.release_created == 'true' || inputs.publish-only) }} + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v6 + with: + ref: main + + - uses: actions/setup-node@v6 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org" + + - run: npm ci + + - run: npm run build + + - run: npm publish --access public --provenance + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}