From cf75423934795181d577be16a6ecd009a1d41da1 Mon Sep 17 00:00:00 2001 From: NuclearRedeye Date: Tue, 11 Jun 2024 10:57:33 +0100 Subject: [PATCH] feat: add initial workflow to publish package to npm --- .github/workflows/publish.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..80e7a2f --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,26 @@ +name: Publish to NPM + +on: + push: + branches: + - master + tags: + - v* + pull_request: + +jobs: + cd: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' + # Only publish for a tagged release that starts with a lowercase v + - name: Publish to npmjs.com + if: contains(github.ref, 'refs/tags/v') + run: | + npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} \ No newline at end of file