diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8e358d281..af82bd5d78 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,7 +65,6 @@ env: NPM_REGISTRY_ADDRESS: ${{ secrets.NPM_REGISTRY_ADDRESS }} NPM_REGISTRY_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} - jobs: setup: timeout-minutes: 20 @@ -146,6 +145,9 @@ jobs: timeout-minutes: 15 if: github.event.pull_request.merged == true runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/lib/cli/scripts/npm-publish.ts b/lib/cli/scripts/npm-publish.ts index dda3877297..0bec305a5d 100644 --- a/lib/cli/scripts/npm-publish.ts +++ b/lib/cli/scripts/npm-publish.ts @@ -96,7 +96,8 @@ function changeRegistry(args: PublishArgs, project: string) { const folder = `${args.pathProject}/dist/libs/${project}`; const content = `strict-ssl=true -registry=https://${args.npmRegistry} +always-auth=true +@alfresco:registry=https://${args.npmRegistry} //${args.npmRegistry}/:_authToken="${args.tokenRegistry}"`; try { diff --git a/scripts/travis/release/release-npm.sh b/scripts/travis/release/release-npm.sh index d8d7923409..9b848d378e 100755 --- a/scripts/travis/release/release-npm.sh +++ b/scripts/travis/release/release-npm.sh @@ -23,10 +23,18 @@ then TAG_NPM=alpha fi -echo "Publishing on npm with tag $TAG_NPM" +echo "Publishing on Public npm registry with tag $TAG_NPM" ./node_modules/@alfresco/adf-cli/bin/adf-cli npm-publish \ --npmRegistry $NPM_REGISTRY_ADDRESS \ --tokenRegistry $NPM_REGISTRY_TOKEN \ --tag $TAG_NPM \ --pathProject "$(pwd)" \ "$@" + +echo "Publishing on GH PKG registry with tag $TAG_NPM" +./node_modules/@alfresco/adf-cli/bin/adf-cli npm-publish \ + --npmRegistry "npm.pkg.github.com" \ + --tokenRegistry $github_token \ + --tag $TAG_NPM \ + --pathProject "$(pwd)" \ + "$@" \ No newline at end of file