-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to publish package workflow, remove npm cache should not be n…
…ecessary for this step, improve slack messaging and only send when package was successfully published
- Loading branch information
Showing
1 changed file
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,6 @@ jobs: | |
SEED_PHRASE_6: ${{ secrets.SEED_PHRASE_6 }} | ||
SEED_PHRASE_7: ${{ secrets.SEED_PHRASE_7 }} | ||
SEED_PHRASE_8: ${{ secrets.SEED_PHRASE_8 }} | ||
outputs: | ||
build-directory: ${{ steps.upload_build.outputs.build_directory }} | ||
|
||
steps: | ||
- name: Checkout code | ||
|
@@ -40,6 +38,10 @@ jobs: | |
- name: Run tests | ||
run: npm run test | ||
|
||
- name: Extract Package Version | ||
id: extract_version | ||
run: echo "package_version=$(jq -r '.version' package.json)" >> $GITHUB_ENV | ||
|
||
- name: Upload build artifacts | ||
id: upload_build | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -63,18 +65,18 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
cache: 'npm' | ||
|
||
- name: Authenticate to npm registry | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc | ||
|
||
- name: Publish to npm | ||
id: publish | ||
run: npm publish | ||
|
||
- name: Send Slack Notification for Publish | ||
if: ${{ !cancelled() }} | ||
if: steps.publish.outcome == 'success' | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
|
@@ -84,7 +86,7 @@ jobs: | |
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*zkVerifyJS Package Published*\n\n*Build URL:* <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here to view the build>" | ||
"text": "*:tada: :zk-logo-icon-square-black: zkVerifyJS Package Published :zk-logo-icon-square-black: :tada:*\n\n*Build URL:* <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here to view the build>\n\n*Published Package:* <https://www.npmjs.com/package/zkverifyjs/v/${{ env.package_version }}|zkverifyjs@${{ env.package_version }}>" | ||
} | ||
} | ||
] | ||
|