From 712b0c337dfbec8df0c73a3ff94db106b93753d1 Mon Sep 17 00:00:00 2001 From: Napoleon-Christos Oikonomou Date: Sun, 26 May 2024 18:30:31 +0300 Subject: [PATCH] prepare to publish with provenance --- .github/workflows/publish.yml | 24 +++++++++++++++++++----- package.json | 4 ++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c4901ee..243d461 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Publish to GitHub registry +name: Publish on: release: @@ -7,12 +7,24 @@ on: jobs: publish: runs-on: ubuntu-latest + permissions: + contents: read + packages: write + id-token: write steps: - name: ⬇️ Checkout repo uses: actions/checkout@v4 - - name: 🏗 Run replace-in-file - run: npx replace-in-file "eslint-config-iamnapo" "@iamnapo/eslint-config-iamnapo" package.json + - name: ⎔ Setup node + uses: actions/setup-node@v4 + with: + node-version: 22 + registry-url: "https://registry.npmjs.org" + + - name: 🚀 Release to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: ⎔ Setup node uses: actions/setup-node@v4 @@ -21,8 +33,10 @@ jobs: registry-url: "https://npm.pkg.github.com" scope: "@iamnapo" - - name: 🚀 Release + - name: 🏗 Run replace-in-file + run: npx replace-in-file "eslint-config-iamnapo" "@iamnapo/eslint-config-iamnapo" package.json + + - name: 🚀 Release to GitHub run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - diff --git a/package.json b/package.json index a82332a..5e28006 100644 --- a/package.json +++ b/package.json @@ -67,5 +67,9 @@ }, "engines": { "node": ">=20" + }, + "publishConfig": { + "access": "public", + "provenance": true } }