From 3ca5403f49c97dbfaab877b8b5ff9ff2b3eaa7bc Mon Sep 17 00:00:00 2001 From: Frederik Prijck Date: Tue, 29 Aug 2023 05:36:28 +0200 Subject: [PATCH] Add npm publish to GitHub actions (#203) Co-authored-by: Jon Koops --- .github/workflows/publish.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 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..ae1b64e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +name: Publish Release + +on: + workflow_dispatch: + release: + types: + - published + +permissions: + contents: read + +jobs: + publish-npm: + name: Publish to NPM + runs-on: ubuntu-latest + environment: release + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + + - name: Build package + run: npm run build + + - name: Publish release to NPM + run: npm publish --tag beta + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}