From d5161afb93ae54ed762606dc443f742b1aa3af5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Berson?= Date: Wed, 15 Jan 2020 16:35:42 +0100 Subject: [PATCH 1/2] Add action to release on NPM --- .github/workflows/release.yml | 7 +++++++ package.json | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 87a058c481..0257d06fd2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,3 +39,10 @@ jobs: GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }} with: token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create an NPM release + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc + yarn publish + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index a7b393d912..384e8de0f4 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,9 @@ "bundle": "lerna run bundle", "test": "lerna run --concurrency 1 test", "clean": "lerna run --parallel clean && lerna clean --yes && rimraf node_modules", - "release": "lerna version" + "release": "lerna version", + "publish": "lerna publish from-packages --ignore-scripts --yes", + "prepublish": "yarn clean && yarn bootstrap && yarn build && yarn bundle" }, "devDependencies": { "@cliqz/metalint": "^0.2.0", From 07e9543ee5b16f0d0c987eabbf2a2a73992fe229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Berson?= Date: Wed, 15 Jan 2020 16:50:44 +0100 Subject: [PATCH 2/2] Remove prepublish hook --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 384e8de0f4..377370824b 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,7 @@ "test": "lerna run --concurrency 1 test", "clean": "lerna run --parallel clean && lerna clean --yes && rimraf node_modules", "release": "lerna version", - "publish": "lerna publish from-packages --ignore-scripts --yes", - "prepublish": "yarn clean && yarn bootstrap && yarn build && yarn bundle" + "publish": "yarn clean && yarn bootstrap && yarn build && yarn bundle && lerna publish from-packages --ignore-scripts --yes" }, "devDependencies": { "@cliqz/metalint": "^0.2.0",