From 8288277cb0ed715d02ae945f7518655a94a55470 Mon Sep 17 00:00:00 2001 From: sverweij Date: Mon, 29 Jan 2024 20:53:47 +0100 Subject: [PATCH] ci: sets up automated publishing with provenance --- .github/workflows/prerelease.yml | 21 +++++++++++++++++++++ .github/workflows/release.yml | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/prerelease.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml new file mode 100644 index 00000000..42587a69 --- /dev/null +++ b/.github/workflows/prerelease.yml @@ -0,0 +1,21 @@ +name: publish pre-releases as beta to npmjs +on: + release: + types: [prereleased] + +jobs: + publish-as-beta: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v4 + with: + node-version: 21.x + registry-url: https://registry.npmjs.org + - run: npm clean-install + - run: npm publish --provenance --access public --tag beta + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..03f4446f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +name: publish to npmjs +on: + release: + types: [released] + +jobs: + publish-as-latest: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v4 + with: + node-version: 21.x + registry-url: https://registry.npmjs.org + - run: npm clean-install + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file