Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/create release workflow #155

Merged
merged 3 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions .github/workflows/publish-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ on:
- main

jobs:

Timestamp:
uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main

print_version_to_publish:
needs: [ Timestamp ]
needs: [Timestamp]
runs-on: ubuntu-latest
outputs:
version_to_be_published: ${{ steps.get_version_to_publish.outputs.VERSION_TO_BE_PUBLISHED }}
Expand All @@ -30,7 +29,7 @@ jobs:

# Fetch the latest version from NPM
fetch_latest_version:
needs: [ Timestamp ]
needs: [Timestamp]
runs-on: ubuntu-latest
outputs:
LATEST_VERSION: ${{ steps.get_latest_version.outputs.LATEST_VERSION }}
Expand Down Expand Up @@ -74,7 +73,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
with:
version: 8.8.0
Expand Down Expand Up @@ -102,12 +101,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 }}

2 changes: 1 addition & 1 deletion packages/core-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@story-protocol/core-sdk",
"version": "1.0.0-rc.7",
"version": "1.0.0-rc.6",
"description": "Story Protocol Core SDK",
"main": "dist/story-protocol-core-sdk.cjs.js",
"module": "dist/story-protocol-core-sdk.esm.js",
Expand Down
Loading