From 255c3bec13da7f3e63aecfc69ec70ee0594c5075 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Thu, 16 Jan 2025 08:07:51 -0600 Subject: [PATCH] Adds github release workflow --- .github/workflows/release.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 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..685ae10 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Publish Release to npm +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "20" + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm test + - if: ${{ github.event.release.tag_name != '' && env.NPM_PUBLISH_TAG != '' }} + run: npm publish --provenance --access=public --tag=${{ env.NPM_PUBLISH_TAG }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_PUBLISH_TAG: ${{ contains(github.event.release.tag_name, '-beta.') && 'beta' || 'latest' }}