Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Rely on action to create npmrc (#1542)
Browse files Browse the repository at this point in the history
* Rely on action to create npmrc

* Fix url for npm
  • Loading branch information
mauriziovitale committed Mar 6, 2023
1 parent 3dea8b1 commit d697c76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/js-api-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_BUILD_NUMBER: ${{ github.run_number }}
NPM_REGISTRY_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
NPM_REGISTRY_ADDRESS: ${{ secrets.NPM_REGISTRY_ADDRESS }}
NPM_REGISTRY_ADDRESS: ${{ vars.NPM_REGISTRY_ADDRESS }}

jobs:
build:
Expand Down Expand Up @@ -123,9 +123,9 @@ jobs:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
with:
node-version: 16
registry-url: $NPM_REGISTRY_ADDRESS
registry-url: 'https://${NPM_REGISTRY_ADDRESS}'
scope: '@alfresco'
- run: ./scripts/publish.sh nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=$TAG_NPM || exit 1
- run: ./scripts/publish.sh
env:
NODE_AUTH_TOKEN: $NPM_REGISTRY_TOKEN

Expand Down
8 changes: 1 addition & 7 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,8 @@ fi

cd dist/

echo "Publishing on npm with tag $TAG_NPM"

touch .npmrc
echo 'strict-ssl=true' >>.npmrc
echo 'registry=https://${NPM_REGISTRY_ADDRESS}' >>.npmrc
echo '//${NPM_REGISTRY_ADDRESS}/:_authToken="${NPM_REGISTRY_TOKEN}"' >>.npmrc
echo "Publishing on npm registry: ${NPM_REGISTRY_ADDRESS} with tag $TAG_NPM"

cat package.json | grep version

npm publish --tag ${TAG_NPM} || exit 1
rm -rf .npmrc

0 comments on commit d697c76

Please sign in to comment.