diff --git a/.github/workflows/publish-package.yaml b/.github/workflows/publish-package.yaml index 92100a27..8a912138 100644 --- a/.github/workflows/publish-package.yaml +++ b/.github/workflows/publish-package.yaml @@ -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 }} @@ -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 }} @@ -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 @@ -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 'actions@github.com' + 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 }} - diff --git a/packages/core-sdk/package.json b/packages/core-sdk/package.json index 3a3deb22..1798238a 100644 --- a/packages/core-sdk/package.json +++ b/packages/core-sdk/package.json @@ -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",