From a743ff104afca73d9c87c932a167535e799b8199 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Mon, 6 Jan 2025 14:21:39 +0100 Subject: [PATCH] Publish to npm via GitHub Actions Fixes #22 --- .github/workflows/build.yml | 15 +++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1cdba8..d4ba872 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,3 +35,18 @@ jobs: env: VERSION: ${{ github.event.release.tag_name }} GH_TOKEN: ${{ github.token }} + publish: + if: github.event_name == 'release' + permissions: + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x + registry-url: "https://registry.npmjs.org" + - run: npm clean-install + - run: npm publish --provenance --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package-lock.json b/package-lock.json index 1ee0418..db8513f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "age-encryption", - "version": "0.2.0", + "version": "0.2.0-rc.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "age-encryption", - "version": "0.2.0", + "version": "0.2.0-rc.0", "license": "BSD-3-Clause", "dependencies": { "@noble/ciphers": "^1.2.0", diff --git a/package.json b/package.json index c26e384..6346ed4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "age-encryption", - "version": "0.2.0", + "version": "0.2.0-rc.0", "main": "dist/index.js", "files": [ "dist/"