From ae6b20324ab764c8017fcce7eda18906933ee634 Mon Sep 17 00:00:00 2001 From: Nitesh Sandal Date: Wed, 11 Mar 2026 11:25:48 -0400 Subject: [PATCH] add publish workflow for this to publish to npm on tag creation --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4f47d37 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: ci + +on: [push] + +jobs: + compile: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + - run: npm ci + - run: npm run build + + publish: + needs: [compile] + if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + - run: npm ci + - run: npm run build + - name: Publish to npm + run: | + publish() { + npx -y npm@latest publish "$@" + } + if [[ ${GITHUB_REF} == *alpha* ]]; then + publish --access public --tag alpha + elif [[ ${GITHUB_REF} == *beta* ]]; then + publish --access public --tag beta + else + publish --access public + fi