Skip to content

Commit

Permalink
Merge branch 'main' into test/create_release_workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyBoWu committed Apr 26, 2024
2 parents fd1b6e5 + 4320c22 commit f253b22
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions .github/workflows/publish-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,28 +101,29 @@ jobs:
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

test_push_tag:
# 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]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# 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'
uses: storyprotocol/gha-workflows/.github/workflows/reusable-create-release.yml@fix/workflow_permission
with:
version_to_publish: ${{ needs.print_version_to_publish.outputs.version_to_be_published }}

- 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'
# uses: storyprotocol/gha-workflows/.github/workflows/reusable-create-release.yml@fix/workflow_permission
# with:
# version_to_publish: ${{ needs.print_version_to_publish.outputs.version_to_be_published }}

0 comments on commit f253b22

Please sign in to comment.