From 33253f661df4b4f1abc36ecabe3404a721a6e8e9 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 1 Feb 2021 00:18:54 +0100 Subject: [PATCH] add npm publish job --- .github/workflows/ci.yml | 16 ++++++++++++++++ README.md | 2 -- package.json | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62b8d22..de76498 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,3 +27,19 @@ jobs: - run: npm ci - run: npm test - run: npm run build + + publish: + needs: test + if: success() && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + registry-url: 'https://registry.npmjs.org' + + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + \ No newline at end of file diff --git a/README.md b/README.md index 5cdcb07..faa66d6 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,6 @@ npm run build # publishing to npm & GitHub releases # uses https://github.com/webpro/release-it npm run release -npm run release minor -npm run release major ``` ## Changelog diff --git a/package.json b/package.json index 943ed22..f5e19e6 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "release": true }, "npm": { - "publish": true + "publish": false } } }