From 65ab26cfdd8257fc3e062a703df5541d19d00c6d Mon Sep 17 00:00:00 2001 From: giosuetrapani Date: Mon, 26 Jun 2023 00:58:02 +0200 Subject: [PATCH] :construction_worker: Added ghaction for automatic publishing on npm when pushing on master --- .github/workflows/publish.yml | 26 ++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) 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..b743fa2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,26 @@ +name: Publish revo-cli to npm +on: + push: + branches: + - master + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Log in to npm + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + + - name: Install dependencies + run: npm ci + + - name: Publish to npm + run: npm publish --access public \ No newline at end of file diff --git a/package.json b/package.json index 8c98b11..637f2b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@revodigital/revo-cli", - "version": "0.0.1", + "version": "0.0.2", "main": "index.ts", "bin": { "revo": "./dist/index.js"