From 02d59a0e992ea74fd59914e99e2cdbcf7e4f5f6d Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Mon, 16 Sep 2024 09:11:35 +0200 Subject: [PATCH] chore: re-enable publish workflow This reverts commit 7160eb7eb05fe8e6913660bedae8d03e76404d8e. [skip ci] --- .github/workflows/publish.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 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 00000000..052d308a --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +# reference: https://docs.npmjs.com/generating-provenance-statements + +name: Publish + +on: + push: + tags: + # expected format: @ (example: socket.io@1.2.3) + - '**@*' + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm ci + + - name: Compile each package + run: npm run compile --workspaces --if-present + + - name: Publish package + run: npm publish --workspace=${GITHUB_REF_NAME%@*} --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}