Skip to content

Commit

Permalink
Merge pull request #10 from CityOfZion/CU-86a0k18cn
Browse files Browse the repository at this point in the history
CU-86a0k18cn - Neon-Dappkit: Setup auto-release to use `rush publish …
  • Loading branch information
melanke authored Sep 1, 2023
2 parents ea0c2ab + e3db897 commit 57c9f88
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 57c9f88

Please sign in to comment.