Skip to content

Commit

Permalink
chore: adjust ci to publish on github repo
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelavoyan committed May 15, 2024
1 parent 5181a97 commit a448415
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/nodejs-sdk.workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//npm.pkg.github.com/:_authToken=GITHUB_TOKEN

0 comments on commit a448415

Please sign in to comment.