Skip to content

Commit

Permalink
Test/create release workflow (#155)
Browse files Browse the repository at this point in the history
* [test] create release

* [test] create release - 2
  • Loading branch information
AndyBoWu authored and bonnie57 committed Jul 2, 2024
1 parent 6db48c2 commit 2d1dabe
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/publish-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,28 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

test_push_tag:
needs: [print_version_to_publish, fetch_latest_version, fail_if_version_is_same]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Push tag
run: |
VERSION=${{ needs.print_version_to_publish.outputs.version_to_be_published }}
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git tag -a v$VERSION -m "Release v$VERSION"
git push origin v$VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

create_release:
needs: [print_version_to_publish, fetch_latest_version, fail_if_version_is_same]
# Skip this job if the version to be published is the same as the latest version on NPM
# and the event triggering the workflow is a push
if: needs.fetch_latest_version.outputs.LATEST_VERSION != needs.print_version_to_publish.outputs.version_to_be_published && github.event_name == 'push'
# if: needs.fetch_latest_version.outputs.LATEST_VERSION != needs.print_version_to_publish.outputs.version_to_be_published && github.event_name == 'push'
uses: storyprotocol/gha-workflows/.github/workflows/reusable-create-release.yml@main
with:
version_to_publish: ${{ needs.print_version_to_publish.outputs.version_to_be_published }}

0 comments on commit 2d1dabe

Please sign in to comment.