Skip to content

Commit

Permalink
CU-86a0k18cn - Neon-Dappkit: Setup auto-release to use `rush publish…
Browse files Browse the repository at this point in the history
… --commit` and Github Token to bump the versions and commit them
  • Loading branch information
Leonardo de Jesus Diz Conde committed Sep 1, 2023
1 parent 568239a commit 17c4c03
Showing 1 changed file with 2 additions and 36 deletions.
38 changes: 2 additions & 36 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,8 @@ jobs:
run: rush update
- name: Build Projects
run: rush rebuild
- name: Publishing neon-dappkit-types
id: dappkit_type
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/neon-dappkit-types
- name: Publishing neon-dappkit
id: dappkit
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/neon-dappkit
- name: Notify packages releases (Github Actions Annotations)
run: |
# Get the values from workflow outputs
hasPublishedDappkit="${{ steps.dappkit.outputs.type }}"
hasPublishedDappkitType="${{ steps.dappkit_type.outputs.type }}"
if [[ ! "$hasPublishedDappkitType" && ! "$hasPublishedDappkit" ]]; then
# Both packages failed to publish
echo "::error ::NPM release error: Both packages failed to publish. Please review the package.json version and try again."
exit 1
elif [[ ! "$hasPublishedDappkitType" ]]; then
# Package DappkitType failed to publish
echo "::error ::No changes have been detected in dappkitType. Please check the package.json version."
echo "::warning ::A new release was made in dappkit. The new version ${{ steps.dappkit.outputs.version }} was released."
elif [[ ! "$hasPublishedDappkit" ]]; then
# Package Dappkit failed to publish
echo "::error ::No changes have been detected in dappkit. Please check the package.json version."
echo "::warning ::A new release was made in dappkit_type. The new version ${{ steps.dappkit_type.outputs.version }} was released."
else
# Both packages were published successfully
echo "::warning ::A new release was made in dappkit_type. The new version ${{ steps.dappkit_type.outputs.version }} was released."
echo "::warning ::A new release was made in dappkit. The new version ${{ steps.dappkit.outputs.version }} was released."
fi
exit 0
- name: Publish Projects
run: rush publish --apply --target-branch main --publish --npm-auth-token ${{ secrets.NPM_TOKEN }} --add-commit-details --include-all
- name: Commit and Push package.json version update
run: |
git add .
Expand Down

0 comments on commit 17c4c03

Please sign in to comment.