From f96e6dbff7d2baf902371ef122e85b6f93e60bf1 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Wed, 4 Sep 2024 12:38:37 -0700 Subject: [PATCH] fix(ci): revert changes to publish workflows --- .github/workflows/publish.yml | 21 --------------------- .github/workflows/release.yml | 26 +++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 2180872..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Publish Package to npmjs - -concurrency: - group: ${{ github.workflow }} - -on: - release: - types: [created] -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - - uses: ./.github/actions/prepare - - run: npm run build - - run: npm publish --provenance --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2277d2..2c4a89b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,5 +20,29 @@ jobs: - name: Create Release id: release uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4 + + # see https://github.com/google-github-actions/release-please-action#automating-publication-to-npm + - name: Checkout Repository + if: ${{ steps.release.outputs.release_created }} + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - name: Setup Node.js + if: ${{ steps.release.outputs.release_created }} + uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 with: - token: ${{ secrets.ACCESS_TOKEN }} + node-version: 20 + registry-url: 'https://registry.npmjs.org' + + - name: Install + if: ${{ steps.release.outputs.release_created }} + uses: bahmutov/npm-install@e5c7e14408aa6089501de32bd16123b41738047e # v1.10.2 + + - name: Build + if: ${{ steps.release.outputs.release_created }} + run: npm run build + + - name: Publish to npm + if: ${{ steps.release.outputs.release_created }} + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + run: npm publish