From 9cac2fd098147d6fe0dca070d5932ecb586cc512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20L=C3=B3pez=20Gargiulo?= Date: Sat, 25 Jan 2025 19:20:22 -0300 Subject: [PATCH] Add publish.yml GH workflow to publish package to npm repository --- .github/workflows/publish.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 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..3023342 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +name: publish package +on: + release: + types: [published] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - run: cp README.md lib/README.md + - working-directory: lib + run: | + npm ci + npm run build + npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}