From f91082ee7a84e7c1e76c37c686cc22d1578971a6 Mon Sep 17 00:00:00 2001 From: Weston Pace Date: Mon, 9 Dec 2024 14:09:43 -0800 Subject: [PATCH] ci: add publish workflow --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..318b78d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: NPM Publish + +on: + push: + tags: + - "v*" + +jobs: + node: + name: Publish to NPM + runs-on: ubuntu-latest + # Only runs on tags that matches the make-release action + if: startsWith(github.ref, 'refs/tags/v') + defaults: + run: + shell: bash + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "npm" + cache-dependency-path: package-lock.json + - name: Build + run: | + npm ci + npm run build + - name: Publish to NPM + env: + NODE_AUTH_TOKEN: ${{ secrets.FSQL_PUBLISH_TOKEN }} + run: | + npm publish --access public