From 328972f7e025fc22ec41f219a38b54819fb925a5 Mon Sep 17 00:00:00 2001 From: amalcaraz Date: Sun, 26 Feb 2023 15:36:25 +0100 Subject: [PATCH] updated publish action --- .github/workflows/publish.yml | 29 +++++++++++++++-------------- .npmrc_ci | 6 ++++++ 2 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 .npmrc_ci diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index acf9ef8a..0238988d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,23 +20,24 @@ jobs: with: fetch-depth: 0 - - name: Install deps and build - uses: actions/setup-node@v3 - run: | - npm config set "@fortawesome:registry" https://npm.fontawesome.com/ - npm config set "//npm.fontawesome.com/:_authToken" FONTAWESOME_NPM_AUTH_TOKEN - npm ci - npm run build - env: - FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }} - - - name: "Publish package" + - name: "Setup node" uses: actions/setup-node@v3 with: node-version: 18 registry-url: 'https://registry.npmjs.org' scope: '@aleph-front' - run: | - npm publish --ignore-scripts --access public + + - name: "Prepare npmrc" + run: envsubst < .npmrc_ci > .npmrc env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN}} + + - name: "Install deps" + run: npm ci + + - name: "Build" + run: npm run build + + - name: "Publish package" + run: npm publish --ignore-scripts --access public diff --git a/.npmrc_ci b/.npmrc_ci new file mode 100644 index 00000000..04ac5f74 --- /dev/null +++ b/.npmrc_ci @@ -0,0 +1,6 @@ +always-auth = true +@fortawesome:registry=https://npm.fontawesome.com/ +@aleph-front:registry=https://registry.npmjs.org/ + +//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN} +//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} \ No newline at end of file