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

Npm publish: Use token as part of workflow #1544

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/js-api-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ env:
GITHUB_BRANCH: ${{ github.ref }}
GITHUB_PULL_REQUEST: ${{ github.event.number }}
GITHUB_BUILD_NUMBER: ${{ github.run_number }}
NPM_REGISTRY_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}
NPM_REGISTRY_ADDRESS: ${{ vars.NPM_REGISTRY_ADDRESS }}

jobs:
build:
Expand Down Expand Up @@ -112,11 +110,11 @@ jobs:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
with:
node-version: 16
registry-url: 'https://${NPM_REGISTRY_ADDRESS}'
registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}'
scope: '@alfresco'
- run: ./scripts/publish.sh
env:
NODE_AUTH_TOKEN: $NPM_REGISTRY_TOKEN
NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }}

- uses: actions/setup-node@v3
name: Release library GH registry
Expand Down
4 changes: 3 additions & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ fi

cd dist/

echo "Publishing on npm registry: ${NPM_REGISTRY_ADDRESS} with tag $TAG_NPM"
echo "Publishing on npm with tag $TAG_NPM"

cat package.json | grep version

npm publish --tag ${TAG_NPM} || exit 1

rm -rf .npmrc