diff --git a/.github/workflows/nodejs-sdk.workflow.yml b/.github/workflows/nodejs-sdk.workflow.yml index 1dfde79..0f14831 100644 --- a/.github/workflows/nodejs-sdk.workflow.yml +++ b/.github/workflows/nodejs-sdk.workflow.yml @@ -109,13 +109,23 @@ jobs: - name: Commit Version Locally for Github npm run: git add .npmrc && git commit -am "Prepare to release" working-directory: ${{ env.SDK_PATH }} - # Publish - - name: Publish + # Set Github Packages Token + - name: Set Github Packages Token + run: sed -i 's/GITHUB_TOKEN/${{ secrets.GITHUB_TOKEN }}/' .npmrc + # Publish Github Repo + - name: Publish Github Repo if: ${{ env.GLOBAL_ENV == 'prod' || env.GLOBAL_ENV == 'rc' }} - run: npm publish ${{ github.repository_owner }}-${{ env.SDK_NAME }}-${{ env.SDK_NEW_VERSION }}.tgz --tag ${{ env.RELEASE_TAG }} --access public --userconfig ./.npmrc --force - env: + run: npm publish ${{ github.repository_owner }}-${{ env.SDK_NAME }}-${{ env.SDK_NEW_VERSION }}.tgz --registry=https://npm.pkg.github.com --tag ${{ env.RELEASE_TAG }} --access public --userconfig ./.npmrc --force + env: RELEASE_TAG: ${{ env.GLOBAL_ENV == 'prod' && format('{0}', 'latest' ) || env.RC_SUFFIX }} working-directory: ${{ env.SDK_PATH }} +# # Publish NpmJS +# - name: Publish +# if: ${{ env.GLOBAL_ENV == 'prod' || env.GLOBAL_ENV == 'rc' }} +# run: npm publish ${{ github.repository_owner }}-${{ env.SDK_NAME }}-${{ env.SDK_NEW_VERSION }}.tgz --tag ${{ env.RELEASE_TAG }} --access public --userconfig ./.npmrc --force +# env: +# RELEASE_TAG: ${{ env.GLOBAL_ENV == 'prod' && format('{0}', 'latest' ) || env.RC_SUFFIX }} +# working-directory: ${{ env.SDK_PATH }} # Upload Artifacts - name: Upload Artifact if: success() diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..c3492c8 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +//npm.pkg.github.com/:_authToken=GITHUB_TOKEN