From 16d0392ff41a36b03dc878b08ea0bc66d555fc7c Mon Sep 17 00:00:00 2001 From: Luca Rickli <109034482+LucaRickli@users.noreply.github.com> Date: Fri, 18 Aug 2023 20:14:15 +0200 Subject: [PATCH] Create publish.yml --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 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..e0d4755 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish npm package + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js emvironment + uses: actions/setup-node@v3 + with: + node-version: 18.x + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm ci + + - name: Build package + run: npm run build + + - name: Publish package + run: npm publish --access=public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}