From f48ca1b56ec96ba07b5de2eeaa206cd66e1cbef3 Mon Sep 17 00:00:00 2001 From: Bonnie Date: Fri, 22 Nov 2024 10:25:27 +0800 Subject: [PATCH 1/7] Update release notes workflow --- .github/workflows/publish-package.yaml | 58 +++++++++++++--- .github/workflows/reusable-create-release.yml | 69 +++++++++++++++++++ configs/configuration.json | 34 +++++++++ configs/configuration_react.json | 34 +++++++++ 4 files changed, 187 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/reusable-create-release.yml create mode 100644 configs/configuration.json create mode 100644 configs/configuration_react.json diff --git a/.github/workflows/publish-package.yaml b/.github/workflows/publish-package.yaml index 66c6090e..24c8062c 100644 --- a/.github/workflows/publish-package.yaml +++ b/.github/workflows/publish-package.yaml @@ -157,6 +157,42 @@ jobs: exit 1 fi + fetch_last_tag: + needs: + [ + check_is_publish, + extract_branch_name, + check_if_version_is_valid_for_branch, + ] + # Skip this job if the core-sdk and react-sdk don't need to be published + # and the event triggering the workflow is a push + if: ${{ (needs.check_if_version_is_valid_for_branch.outputs.is_publish_core_sdk == 'true' || needs.check_if_version_is_valid_for_branch.outputs.is_publish_react_sdk == 'true') && github.event_name == 'push' }} + runs-on: ubuntu-latest + outputs: + CORE_SDK_LATEST_TAG: ${{ steps.get_last_tag.outputs.CORE_SDK_LATEST_TAG }} + REACT_SDK_LATEST_TAG: ${{ steps.get_last_tag.outputs.REACT_SDK_LATEST_TAG }} + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Get last tag + id: get_last_tag + run: | + BRANCH_NAME="${{ needs.extract_branch_name.outputs.branch_name }}" + + git fetch --tags + if [[ "$BRANCH_NAME" == "v${{ env.VERSION_1_1 }}" ]]; then + CORE_SDK_LATEST_TAG=$(git tag --sort=creatordate | grep -E "@story-protocol/core-sdk@1.1|core-sdk@1.1" | tail -n1) + REACT_SDK_LATEST_TAG=$(git tag --sort=creatordate | grep -E "@story-protocol/react-sdk@1.1|react-sdk@1.1" | tail -n1) + else + CORE_SDK_LATEST_TAG=$(git tag --sort=creatordate | grep -E "@story-protocol/core-sdk@1.2|core-sdk@1.2" | tail -n1) + REACT_SDK_LATEST_TAG=$(git tag --sort=creatordate | grep -E "@story-protocol/react-sdk@1.2|react-sdk@1.2" | tail -n1) + fi + echo "CORE_SDK_LATEST_TAG=$CORE_SDK_LATEST_TAG" >> $GITHUB_OUTPUT + echo "REACT_SDK_LATEST_TAG=$REACT_SDK_LATEST_TAG" >> $GITHUB_OUTPUT + echo "Last tag for @story-protocol/core-sdk is $CORE_SDK_LATEST_TAG" + echo "Last tag for @story-protocol/react-sdk is $REACT_SDK_LATEST_TAG" + build-test-publish: needs: [ @@ -164,9 +200,9 @@ jobs: fetch_latest_version, check_is_publish, check_if_version_is_valid_for_branch, + fetch_last_tag, ] - # Skip this job if the core-sdk and react-sdk don't need to be published - # and the event triggering the workflow is a push + if: ${{ (needs.check_if_version_is_valid_for_branch.outputs.is_publish_core_sdk == 'true' || needs.check_if_version_is_valid_for_branch.outputs.is_publish_react_sdk == 'true') && github.event_name == 'push' }} runs-on: ubuntu-latest environment: "beta-sepolia" @@ -243,19 +279,22 @@ jobs: build-test-publish, print_version_to_publish, check_if_version_is_valid_for_branch, + fetch_last_tag, ] # Skip this job if core-sdk doesn't need to be published # and the event triggering the workflow is a push if: ${{ github.event_name == 'push' && needs.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_CORE_SDK == 'true'}} - uses: storyprotocol/gha-workflows/.github/workflows/reusable-create-release.yml@main + uses: ./.github/workflows/reusable-create-release.yml with: - tag_name: core-sdk@${{ needs.print_version_to_publish.outputs.core_sdk_version_to_be_published }} + tag_name: \@story-protocol/core-sdk@${{ needs.print_version_to_publish.outputs.core_sdk_version_to_be_published }} + is_core_sdk: true + last_tag: ${{ needs.fetch_last_tag.outputs.CORE_SDK_LATEST_TAG }} send_slack_notif-core-sdk: needs: [print_version_to_publish, create-release-core-sdk] uses: storyprotocol/gha-workflows/.github/workflows/reusable-slack-notifs.yml@main with: - short-desc: "${{ github.repository }}: core-sdk package has been published to NPM Registry, version: ${{ needs.print_version_to_publish.outputs.core_sdk_version_to_be_published}}" + short-desc: "${{ github.repository }}: @story-protocol/core-sdk package has been published to NPM Registry, version: ${{ needs.print_version_to_publish.outputs.core_sdk_version_to_be_published}}" title: "Published to Registry" img-url: "https://i.imgur.com/JHmKB0s.png" img-alt-text: "Published to Registry" @@ -269,19 +308,22 @@ jobs: build-test-publish, print_version_to_publish, check_if_version_is_valid_for_branch, + fetch_last_tag, ] # Skip this job if react-sdk doesn't need to be published # and the event triggering the workflow is a push if: ${{ github.event_name == 'push' && needs.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_REACT_SDK == 'true'}} - uses: storyprotocol/gha-workflows/.github/workflows/reusable-create-release.yml@main + uses: ./.github/workflows/reusable-create-release.yml with: - tag_name: react-sdk@${{ needs.print_version_to_publish.outputs.react_sdk_version_to_be_published }} + tag_name: \@story-protocol/react-sdk@${{ needs.print_version_to_publish.outputs.react_sdk_version_to_be_published }} + is_core_sdk: false + last_tag: ${{ needs.fetch_last_tag.outputs.REACT_SDK_LATEST_TAG }} send_slack_notif-react-sdk: needs: [print_version_to_publish, create-release-react-sdk] uses: storyprotocol/gha-workflows/.github/workflows/reusable-slack-notifs.yml@main with: - short-desc: "${{ github.repository }}: react-sdk package has been published to NPM Registry, version: ${{ needs.print_version_to_publish.outputs.react_sdk_version_to_be_published }}" + short-desc: "${{ github.repository }}: @story-protocol/react-sdk package has been published to NPM Registry, version: ${{ needs.print_version_to_publish.outputs.react_sdk_version_to_be_published }}" title: "Published to Registry" img-url: "https://i.imgur.com/JHmKB0s.png" img-alt-text: "Published to Registry" diff --git a/.github/workflows/reusable-create-release.yml b/.github/workflows/reusable-create-release.yml new file mode 100644 index 00000000..c09a5f76 --- /dev/null +++ b/.github/workflows/reusable-create-release.yml @@ -0,0 +1,69 @@ +name: Reusable workflow to create release in GitHub + +on: + workflow_call: + inputs: + tag_name: + type: string + required: true + description: "Tag name to be published" + is_core_sdk: + type: boolean + description: "Flag to indicate if this is a core SDK release" + required: true + last_tag: + type: string + description: "last tag name" + required: true + +permissions: + contents: write + actions: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 + + - name: Tag and Push + id: tag_and_push + run: | + TAG_NAME=${{ inputs.tag_name}} + git config --global user.name 'GitHub Actions' + git config --global user.email 'actions@github.com' + git tag -a $TAG_NAME -m "Release $TAG_NAME" + git push origin $TAG_NAME + echo "toTag=$TAG_NAME" >> $GITHUB_ENV + echo "The tag $TAG_NAME has been created and pushed to the repository" + echo "The tag $LATEST_TAG has been created and pushed to the repository" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Set Configuration File + id: set_config + run: | + if [ "${{ inputs.is_core_sdk }}" = "true" ]; then + echo "config_file=configs/configuration.json" >> $GITHUB_ENV + else + echo "config_file=configs/configuration_react.json" >> $GITHUB_ENV + fi + + - name: "Build Changelog" + id: github_release + uses: mikepenz/release-changelog-builder-action@a57c1b7c90e56d9c8b26a6ed5d1eed159369e117 #v5.0.0 + with: + configuration: ${{ env.config_file }} + toTag: ${{ inputs.tag_name}} + fromTag: ${{ inputs.last_tag}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Release + uses: mikepenz/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 #softprops/action-gh-release@v2.1.0 + with: + body: ${{steps.github_release.outputs.changelog}} + tag_name: ${{ inputs.tag_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/configs/configuration.json b/configs/configuration.json new file mode 100644 index 00000000..5b742bc8 --- /dev/null +++ b/configs/configuration.json @@ -0,0 +1,34 @@ +{ + "categories": [ + { + "title": "## ๐Ÿš€ Features", + "labels": ["enhancement"] + }, + { + "title": "## ๐Ÿ› Fixes", + "labels": ["bug"] + }, + { + "key": "tests", + "title": "## ๐Ÿงช Tests", + "labels": ["test"] + }, + { + "key": "Others", + "title": "## ๐Ÿ’ฌ Others", + "labels": ["documentation", "other"] + }, + { + "key": "Dependencies", + "title": "## ๐Ÿ“ฆ Dependencies", + "labels": ["dependency"] + } + ], + "ignore_labels": ["ignore"], + "pr_template": "- #{{TITLE}}\n - PR: ##{{NUMBER}}", + "sort": { + "order": "ASC", + "on_property": "mergedAt" + }, + "template": "#{{CHANGELOG}}\n## Contributors:\n- #{{CONTRIBUTORS}}" +} diff --git a/configs/configuration_react.json b/configs/configuration_react.json new file mode 100644 index 00000000..991d03d7 --- /dev/null +++ b/configs/configuration_react.json @@ -0,0 +1,34 @@ +{ + "categories": [ + { + "title": "## ๐Ÿš€ Features", + "labels": ["enhancement-react"] + }, + { + "title": "## ๐Ÿ› Fixes", + "labels": ["bug-react"] + }, + { + "key": "tests", + "title": "## ๐Ÿงช Tests", + "labels": ["test-react"] + }, + { + "key": "Others", + "title": "## ๐Ÿ’ฌ Others", + "labels": ["documentation-react", "other-react"] + }, + { + "key": "Dependencies", + "title": "## ๐Ÿ“ฆ Dependencies", + "labels": ["dependency-react"] + } + ], + "ignore_labels": ["ignore"], + "pr_template": "- #{{TITLE}}\n - PR: ##{{NUMBER}}", + "sort": { + "order": "ASC", + "on_property": "mergedAt" + }, + "template": "#{{CHANGELOG}}\n## Contributors:\n- #{{CONTRIBUTORS}}" +} From 3da1e65b3d726e5851ba483966808b837b30d379 Mon Sep 17 00:00:00 2001 From: Bonnie Date: Fri, 22 Nov 2024 13:57:29 +0800 Subject: [PATCH 2/7] Update tag name --- .github/workflows/publish-package.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-package.yaml b/.github/workflows/publish-package.yaml index 24c8062c..7dfeee88 100644 --- a/.github/workflows/publish-package.yaml +++ b/.github/workflows/publish-package.yaml @@ -202,7 +202,7 @@ jobs: check_if_version_is_valid_for_branch, fetch_last_tag, ] - + if: ${{ (needs.check_if_version_is_valid_for_branch.outputs.is_publish_core_sdk == 'true' || needs.check_if_version_is_valid_for_branch.outputs.is_publish_react_sdk == 'true') && github.event_name == 'push' }} runs-on: ubuntu-latest environment: "beta-sepolia" @@ -286,7 +286,7 @@ jobs: if: ${{ github.event_name == 'push' && needs.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_CORE_SDK == 'true'}} uses: ./.github/workflows/reusable-create-release.yml with: - tag_name: \@story-protocol/core-sdk@${{ needs.print_version_to_publish.outputs.core_sdk_version_to_be_published }} + tag_name: "@story-protocol/core-sdk@${{ needs.print_version_to_publish.outputs.core_sdk_version_to_be_published }}" is_core_sdk: true last_tag: ${{ needs.fetch_last_tag.outputs.CORE_SDK_LATEST_TAG }} @@ -315,7 +315,7 @@ jobs: if: ${{ github.event_name == 'push' && needs.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_REACT_SDK == 'true'}} uses: ./.github/workflows/reusable-create-release.yml with: - tag_name: \@story-protocol/react-sdk@${{ needs.print_version_to_publish.outputs.react_sdk_version_to_be_published }} + tag_name: "@story-protocol/react-sdk@${{ needs.print_version_to_publish.outputs.react_sdk_version_to_be_published }}" is_core_sdk: false last_tag: ${{ needs.fetch_last_tag.outputs.REACT_SDK_LATEST_TAG }} From 41c9d5bc64960624fcdfcfae01a16688d825f910 Mon Sep 17 00:00:00 2001 From: Bonnie Date: Thu, 5 Dec 2024 17:25:14 +0800 Subject: [PATCH 3/7] Update workflow --- ...-create-release.yml => create-release.yml} | 5 +- .github/workflows/pr-external.yaml | 9 - .github/workflows/pr-internal.yml | 12 - .github/workflows/publish-package.yaml | 240 +++++------------- .github/workflows/sync-labels.yml | 93 +++++++ .github/workflows/test-slack-notifs.yml | 16 -- 6 files changed, 157 insertions(+), 218 deletions(-) rename .github/workflows/{reusable-create-release.yml => create-release.yml} (93%) create mode 100644 .github/workflows/sync-labels.yml delete mode 100644 .github/workflows/test-slack-notifs.yml diff --git a/.github/workflows/reusable-create-release.yml b/.github/workflows/create-release.yml similarity index 93% rename from .github/workflows/reusable-create-release.yml rename to .github/workflows/create-release.yml index c09a5f76..9084f2ad 100644 --- a/.github/workflows/reusable-create-release.yml +++ b/.github/workflows/create-release.yml @@ -35,7 +35,6 @@ jobs: git config --global user.email 'actions@github.com' git tag -a $TAG_NAME -m "Release $TAG_NAME" git push origin $TAG_NAME - echo "toTag=$TAG_NAME" >> $GITHUB_ENV echo "The tag $TAG_NAME has been created and pushed to the repository" echo "The tag $LATEST_TAG has been created and pushed to the repository" env: @@ -52,7 +51,7 @@ jobs: - name: "Build Changelog" id: github_release - uses: mikepenz/release-changelog-builder-action@a57c1b7c90e56d9c8b26a6ed5d1eed159369e117 #v5.0.0 + uses: mikepenz/release-changelog-builder-action@a57c1b7c90e56d9c8b26a6ed5d1eed159369e117 with: configuration: ${{ env.config_file }} toTag: ${{ inputs.tag_name}} @@ -61,7 +60,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Release - uses: mikepenz/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 #softprops/action-gh-release@v2.1.0 + uses: mikepenz/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 with: body: ${{steps.github_release.outputs.changelog}} tag_name: ${{ inputs.tag_name }} diff --git a/.github/workflows/pr-external.yaml b/.github/workflows/pr-external.yaml index 62d26244..43bcf309 100644 --- a/.github/workflows/pr-external.yaml +++ b/.github/workflows/pr-external.yaml @@ -5,7 +5,6 @@ on: types: [opened, synchronize] branches: - dev - - dev_v1.1 jobs: Timestamp_PR_CREATED: @@ -30,13 +29,5 @@ jobs: sha: ${{ github.event.pull_request.head.sha }} ENVIRONMENT: "beta-sepolia" secrets: - RPC_PROVIDER_URL: ${{ secrets.RPC_PROVIDER_URL }} WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }} TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }} - SEPOLIA_RPC_PROVIDER_URL: ${{ secrets.SEPOLIA_RPC_PROVIDER_URL }} - TEST_SEPOLIA_RPC_PROVIDER_URL: ${{ secrets.TEST_SEPOLIA_RPC_PROVIDER_URL }} - SEPOLIA_WALLET_PRIVATE_KEY: ${{ secrets.SEPOLIA_WALLET_PRIVATE_KEY }} - SEPOLIA_TEST_WALLET_ADDRESS: ${{ secrets.SEPOLIA_TEST_WALLET_ADDRESS }} - STORY_TEST_NET_RPC_PROVIDER_URL: ${{ secrets.STORY_TEST_NET_RPC_PROVIDER_URL }} - STORY_TEST_NET_WALLET_PRIVATE_KEY: ${{ secrets.STORY_TEST_NET_WALLET_PRIVATE_KEY }} - STORY_TEST_NET_TEST_WALLET_ADDRESS: ${{ secrets.STORY_TEST_NET_TEST_WALLET_ADDRESS }} diff --git a/.github/workflows/pr-internal.yml b/.github/workflows/pr-internal.yml index de434442..5be39c8a 100644 --- a/.github/workflows/pr-internal.yml +++ b/.github/workflows/pr-internal.yml @@ -5,15 +5,11 @@ on: branches: - main - dev - - v1.1 - - dev_v1.1 pull_request: branches: - main - dev - - v1.1 - - dev_v1.1 jobs: Timestamp: @@ -27,13 +23,5 @@ jobs: sha: ${{ github.event.pull_request.head.sha }} ENVIRONMENT: "beta-sepolia" secrets: - RPC_PROVIDER_URL: ${{ secrets.RPC_PROVIDER_URL }} WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }} TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }} - SEPOLIA_RPC_PROVIDER_URL: ${{ secrets.SEPOLIA_RPC_PROVIDER_URL }} - TEST_SEPOLIA_RPC_PROVIDER_URL: ${{ secrets.TEST_SEPOLIA_RPC_PROVIDER_URL }} - SEPOLIA_WALLET_PRIVATE_KEY: ${{ secrets.SEPOLIA_WALLET_PRIVATE_KEY }} - SEPOLIA_TEST_WALLET_ADDRESS: ${{ secrets.SEPOLIA_TEST_WALLET_ADDRESS }} - STORY_TEST_NET_RPC_PROVIDER_URL: ${{ secrets.STORY_TEST_NET_RPC_PROVIDER_URL }} - STORY_TEST_NET_WALLET_PRIVATE_KEY: ${{ secrets.STORY_TEST_NET_WALLET_PRIVATE_KEY }} - STORY_TEST_NET_TEST_WALLET_ADDRESS: ${{ secrets.STORY_TEST_NET_TEST_WALLET_ADDRESS }} diff --git a/.github/workflows/publish-package.yaml b/.github/workflows/publish-package.yaml index 7dfeee88..8a26312e 100644 --- a/.github/workflows/publish-package.yaml +++ b/.github/workflows/publish-package.yaml @@ -4,27 +4,21 @@ on: push: branches: - main - - v1.1 + pull_request: branches: - main - - v1.1 -env: - VERSION_1_1: "1.1" - VERSION_1_2: "1.2" - MAIN: "main" - DEV: "dev" jobs: - Timestamp: + timestamp: uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main print_version_to_publish: - needs: [Timestamp] + needs: [timestamp] runs-on: ubuntu-latest outputs: - core_sdk_version_to_be_published: ${{ steps.get_version_to_publish.outputs.CORE_SDK_VERSION_TO_BE_PUBLISHED }} - react_sdk_version_to_be_published: ${{ steps.get_version_to_publish.outputs.REACT_SDK_VERSION_TO_BE_PUBLISHED }} + CORE_SDK_VERSION_TO_BE_PUBLISHED: ${{ steps.get_version_to_publish.outputs.CORE_SDK_VERSION_TO_BE_PUBLISHED }} + REACT_SDK_VERSION_TO_BE_PUBLISHED: ${{ steps.get_version_to_publish.outputs.REACT_SDK_VERSION_TO_BE_PUBLISHED }} steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -37,136 +31,66 @@ jobs: content=$(cat packages/react-sdk/package.json) echo "REACT_SDK_VERSION_TO_BE_PUBLISHED=$(echo $content | jq -r '.version')" >> $GITHUB_OUTPUT - extract_branch_name: - needs: [Timestamp] - runs-on: ubuntu-latest - outputs: - branch_name: ${{ steps.extract_branch_name.outputs.BRANCH_NAME }} - steps: - - name: Extract branch name - id: extract_branch_name - run: | - if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then - echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT - else - echo "BRANCH_NAME=${GITHUB_BASE_REF}" >> $GITHUB_OUTPUT - fi # Fetch the latest version from NPM fetch_latest_version: - needs: [Timestamp, extract_branch_name] + needs: [timestamp, print_version_to_publish] runs-on: ubuntu-latest outputs: - core_sdk_latest_version: ${{ steps.get_latest_version.outputs.CORE_SDK_LATEST_VERSION }} - react_sdk_latest_version: ${{ steps.get_latest_version.outputs.REACT_SDK_LATEST_VERSION }} + CORE_SDK_LATEST_VERSION: ${{ steps.get_latest_version.outputs.CORE_SDK_LATEST_VERSION }} + REACT_SDK_LATEST_VERSION: ${{ steps.get_latest_version.outputs.REACT_SDK_LATEST_VERSION }} steps: - name: Get latest package version id: get_latest_version run: | - get_latest_version() { - prefix=$1 - package_name=$2 - variable_key=$3 - all_versions=$(npm view "$package_name" versions --json) - if [[ "$all_versions" == "["* ]]; then - filtered_versions=$(echo "$all_versions" | jq -r "[.[] | select(startswith(\"$prefix\"))]") - echo "filtered_versions1: $filtered_versions" - else - filtered_versions=$(echo "[$all_versions]" | jq -r "[.[] | select(startswith(\"$prefix\"))]") - echo "filtered_versions2: $filtered_versions" - fi - latest_version=$(echo "$filtered_versions" | jq -r '.[-1]') - if [ "$latest_version" == "null" ]; then - latest_version="Not_Published" - fi - echo "Latest version of $package_name on NPMJS with prefix $prefix is $latest_version" - echo "$variable_key=$latest_version" >> $GITHUB_OUTPUT - } - - BRANCH_NAME="${{ needs.extract_branch_name.outputs.branch_name }}" - if [[ "$BRANCH_NAME" == "v${{ env.VERSION_1_1 }}" || "$BRANCH_NAME" == "dev_v${{ env.VERSION_1_1 }}" ]]; then - get_latest_version "${{ env.VERSION_1_1 }}" "@story-protocol/core-sdk" "CORE_SDK_LATEST_VERSION" - get_latest_version "${{ env.VERSION_1_1 }}" "@story-protocol/react-sdk" "REACT_SDK_LATEST_VERSION" - elif [[ "$BRANCH_NAME" == "${{ env.MAIN }}" || "$BRANCH_NAME" == ${{ env.DEV }} ]]; then - get_latest_version "${{ env.VERSION_1_2 }}" "@story-protocol/core-sdk" "CORE_SDK_LATEST_VERSION" - get_latest_version "${{ env.VERSION_1_2 }}" "@story-protocol/react-sdk" "REACT_SDK_LATEST_VERSION" - fi - # Fail if the version including react-sdk and core-sdk does not match the branch strategy - check_if_version_is_valid_for_branch: - needs: [extract_branch_name, print_version_to_publish, fetch_latest_version] + CORE_SDK_LATEST_VERSION=$(npm view @story-protocol/core-sdk version --silent) + REACT_SDK_LATEST_VERSION=$(npm view @story-protocol/react-sdk version --silent) + echo "Latest version of @story-protocol/core-sdk on NPMJS is $CORE_SDK_LATEST_VERSION" + echo "CORE_SDK_LATEST_VERSION=$CORE_SDK_LATEST_VERSION" >> $GITHUB_OUTPUT + echo "Latest version of @story-protocol/react-sdk on NPMJS is $REACT_SDK_LATEST_VERSION" + echo "REACT_SDK_LATEST_VERSION=$REACT_SDK_LATEST_VERSION" >> $GITHUB_OUTPUT + + # Fail the PR if the version to be published is the same as the latest version on NPM + fail_if_version_is_same: + needs: [print_version_to_publish, fetch_latest_version] runs-on: ubuntu-latest outputs: - is_publish_core_sdk: ${{ steps.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_CORE_SDK }} - is_publish_react_sdk: ${{ steps.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_REACT_SDK }} + IS_PUBLISH_CORE_SDK: ${{ steps.check_publish_condition.outputs.IS_PUBLISH_CORE_SDK }} + IS_PUBLISH_REACT_SDK: ${{ steps.check_publish_condition.outputs.IS_PUBLISH_REACT_SDK }} steps: - - name: Check if version is valid for branch - id: check_if_version_is_valid_for_branch + - name: check publish condition + id: check_publish_condition run: | - BRANCH_NAME="${{ needs.extract_branch_name.outputs.branch_name }}" - CORE_SDK_PUBLISH_VERSION="${{ needs.print_version_to_publish.outputs.core_sdk_version_to_be_published }}" - REACT_SDK_PUBLISH_VERSION="${{ needs.print_version_to_publish.outputs.react_sdk_version_to_be_published }}" - CORE_SDK_LATEST_VERSION="${{ needs.fetch_latest_version.outputs.core_sdk_latest_version }}" - REACT_SDK_LATEST_VERSION="${{ needs.fetch_latest_version.outputs.react_sdk_latest_version }}" + CORE_SDK_LATEST_VERSION="${{ needs.fetch_latest_version.outputs.CORE_SDK_LATEST_VERSION }}" + CORE_SDK_VERSION_TO_BE_PUBLISHED="${{ needs.print_version_to_publish.outputs.CORE_SDK_VERSION_TO_BE_PUBLISHED }}" + REACT_SDK_LATEST_VERSION="${{ needs.fetch_latest_version.outputs.REACT_SDK_LATEST_VERSION }}" + REACT_SDK_VERSION_TO_BE_PUBLISHED="${{ needs.print_version_to_publish.outputs.REACT_SDK_VERSION_TO_BE_PUBLISHED }}" - if [[ "$BRANCH_NAME" == "v${{ env.VERSION_1_1 }}" || "$BRANCH_NAME" == "dev_v${{ env.VERSION_1_1 }}" ]]; then - if ! [[ "$CORE_SDK_PUBLISH_VERSION" =~ ^${{ env.VERSION_1_1 }} ]] && ! [[ "$REACT_SDK_PUBLISH_VERSION" =~ ^${{ env.VERSION_1_1 }} ]]; then - echo "Error: Invalid version @story-protocol/core-sdk@$CORE_SDK_PUBLISH_VERSION and @story-protocol/react-sdk@$REACT_SDK_PUBLISH_VERSION for branch 'v${{ env.VERSION_1_1 }}', only versions starting with '${{ env.VERSION_1_1 }}' are allowed in v${{ env.VERSION_1_1 }} branch" - exit 1 - fi - if [[ "$CORE_SDK_PUBLISH_VERSION" =~ ^${{ env.VERSION_1_1 }} && "$CORE_SDK_PUBLISH_VERSION" != "$CORE_SDK_LATEST_VERSION" ]]; then - echo "IS_PUBLISH_CORE_SDK=true" >> $GITHUB_OUTPUT - fi - if [[ "$REACT_SDK_PUBLISH_VERSION" =~ ^${{ env.VERSION_1_1 }} && "$REACT_SDK_PUBLISH_VERSION" != "$REACT_SDK_LATEST_VERSION" ]]; then - echo "IS_PUBLISH_REACT_SDK=true" >> $GITHUB_OUTPUT - fi - elif [[ "$BRANCH_NAME" == "${{ env.MAIN }}" || "$BRANCH_NAME" == "${{ env.DEV }}" ]]; then - if ! [[ "$CORE_SDK_PUBLISH_VERSION" =~ ^${{ env.VERSION_1_2 }} ]] && ! [[ "$REACT_SDK_PUBLISH_VERSION" =~ ^${{ env.VERSION_1_2 }} ]]; then - echo "Error: Invalid version @story-protocol/core-sdk@$CORE_SDK_PUBLISH_VERSION and @story-protocol/react-sdk@$REACT_SDK_PUBLISH_VERSION for branch '${{ env.MAIN }}', only versions starting with '${{ env.VERSION_1_2 }}' are allowed in ${{ env.MAIN }} branch" - exit 1 - fi - if [[ "$CORE_SDK_PUBLISH_VERSION" =~ ^${{ env.VERSION_1_2 }} && "$CORE_SDK_PUBLISH_VERSION" != "$CORE_SDK_LATEST_VERSION" ]]; then - echo "IS_PUBLISH_CORE_SDK=true" >> $GITHUB_OUTPUT - fi - if [[ "$REACT_SDK_PUBLISH_VERSION" =~ ^${{ env.VERSION_1_2 }} && "$REACT_SDK_PUBLISH_VERSION" != "$REACT_SDK_LATEST_VERSION" ]]; then - echo "IS_PUBLISH_REACT_SDK=true" >> $GITHUB_OUTPUT - fi + IS_PUBLISH_CORE_SDK=false + IS_PUBLISH_REACT_SDK=false + + if [ "$CORE_SDK_LATEST_VERSION" == "$CORE_SDK_VERSION_TO_BE_PUBLISHED" ]; then + echo "The @story-protocol/core-sdk version to be published is the same as the latest version on NPM." + else + IS_PUBLISH_CORE_SDK=true fi - # Fail react-sdk and core-sdk don't need to be published - check_is_publish: - needs: - [ - print_version_to_publish, - fetch_latest_version, - check_if_version_is_valid_for_branch, - extract_branch_name, - ] - runs-on: ubuntu-latest - steps: - - name: Fail if version is the same - run: | - IS_PUBLISH_CORE_SDK="${{ needs.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_CORE_SDK }}" - IS_PUBLISH_REACT_SDK="${{ needs.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_REACT_SDK }}" - BRANCH_NAME="${{ needs.extract_branch_name.outputs.branch_name }}" - CORE_SDK_PUBLISH_VERSION="${{ needs.print_version_to_publish.outputs.core_sdk_version_to_be_published }}" - REACT_SDK_PUBLISH_VERSION="${{ needs.print_version_to_publish.outputs.react_sdk_version_to_be_published }}" - CORE_SDK_LATEST_VERSION="${{ needs.fetch_latest_version.outputs.core_sdk_latest_version }}" - REACT_SDK_LATEST_VERSION="${{ needs.fetch_latest_version.outputs.react_sdk_latest_version }}" - BRANCH_DESCRIPTION=$([[ "$BRANCH_NAME" == "${{ env.MAIN }}" || "$BRANCH_NAME" == "${{ env.DEV }}" ]] && echo "v${{ env.VERSION_1_2 }}" || echo "v${{ env.VERSION_1_1 }}") - if [ "$IS_PUBLISH_CORE_SDK" != "true" ] && [ "$IS_PUBLISH_REACT_SDK" != "true" ]; then - echo "This is $BRANCH_DESCRIPTION branch, The @story-protocol/core-sdk cannot be published, because the latest version on NPM is $CORE_SDK_LATEST_VERSION and the version to be published is $CORE_SDK_PUBLISH_VERSION. The @story-protocol/react-sdk cannot be published, because the latest version on NPM is $REACT_SDK_LATEST_VERSION and the version to be published is $REACT_SDK_PUBLISH_VERSION." - exit 1 + if [ "$REACT_SDK_LATEST_VERSION" == "$REACT_SDK_VERSION_TO_BE_PUBLISHED" ]; then + echo "The @story-protocol/react-sdk version to be published is the same as the latest version on NPM." + else + IS_PUBLISH_REACT_SDK=true + fi + + if [ "$CORE_SDK_LATEST_VERSION" == "$CORE_SDK_VERSION_TO_BE_PUBLISHED" ] && [ "$REACT_SDK_LATEST_VERSION" == "$REACT_SDK_VERSION_TO_BE_PUBLISHED" ]; then + echo "The @story-protocol/core-sdk and @story-protocol/react-sdk versions to be published are the same as the latest versions on NPM." + exit 1 fi + echo "IS_PUBLISH_CORE_SDK=$IS_PUBLISH_CORE_SDK" >> $GITHUB_OUTPUT + echo "IS_PUBLISH_REACT_SDK=$IS_PUBLISH_REACT_SDK" >> $GITHUB_OUTPUT + fetch_last_tag: - needs: - [ - check_is_publish, - extract_branch_name, - check_if_version_is_valid_for_branch, - ] - # Skip this job if the core-sdk and react-sdk don't need to be published - # and the event triggering the workflow is a push - if: ${{ (needs.check_if_version_is_valid_for_branch.outputs.is_publish_core_sdk == 'true' || needs.check_if_version_is_valid_for_branch.outputs.is_publish_react_sdk == 'true') && github.event_name == 'push' }} + needs: [fail_if_version_is_same] + if: ${{ (needs.fail_if_version_is_same.outputs.IS_PUBLISH_CORE_SDK == 'true' || needs.fail_if_version_is_same.outputs.IS_PUBLISH_REACT_SDK == 'true') && github.event_name == 'push' }} runs-on: ubuntu-latest outputs: CORE_SDK_LATEST_TAG: ${{ steps.get_last_tag.outputs.CORE_SDK_LATEST_TAG }} @@ -178,45 +102,24 @@ jobs: - name: Get last tag id: get_last_tag run: | - BRANCH_NAME="${{ needs.extract_branch_name.outputs.branch_name }}" - git fetch --tags - if [[ "$BRANCH_NAME" == "v${{ env.VERSION_1_1 }}" ]]; then - CORE_SDK_LATEST_TAG=$(git tag --sort=creatordate | grep -E "@story-protocol/core-sdk@1.1|core-sdk@1.1" | tail -n1) - REACT_SDK_LATEST_TAG=$(git tag --sort=creatordate | grep -E "@story-protocol/react-sdk@1.1|react-sdk@1.1" | tail -n1) - else - CORE_SDK_LATEST_TAG=$(git tag --sort=creatordate | grep -E "@story-protocol/core-sdk@1.2|core-sdk@1.2" | tail -n1) - REACT_SDK_LATEST_TAG=$(git tag --sort=creatordate | grep -E "@story-protocol/react-sdk@1.2|react-sdk@1.2" | tail -n1) - fi + CORE_SDK_LATEST_TAG=$(git tag --sort=creatordate | grep -E "@story-protocol/core-sdk|core-sdk" | tail -n1) + REACT_SDK_LATEST_TAG=$(git tag --sort=creatordate | grep -E "@story-protocol/react-sdk|react-sdk" | tail -n1) echo "CORE_SDK_LATEST_TAG=$CORE_SDK_LATEST_TAG" >> $GITHUB_OUTPUT echo "REACT_SDK_LATEST_TAG=$REACT_SDK_LATEST_TAG" >> $GITHUB_OUTPUT echo "Last tag for @story-protocol/core-sdk is $CORE_SDK_LATEST_TAG" echo "Last tag for @story-protocol/react-sdk is $REACT_SDK_LATEST_TAG" build-test-publish: - needs: - [ - print_version_to_publish, - fetch_latest_version, - check_is_publish, - check_if_version_is_valid_for_branch, - fetch_last_tag, - ] - - if: ${{ (needs.check_if_version_is_valid_for_branch.outputs.is_publish_core_sdk == 'true' || needs.check_if_version_is_valid_for_branch.outputs.is_publish_react_sdk == 'true') && github.event_name == 'push' }} + needs: [fail_if_version_is_same, fetch_last_tag] + # Skip this job if the core-sdk and react-sdk don't need to be published + # and the event triggering the workflow is a push + if: ${{ (needs.fail_if_version_is_same.outputs.is_publish_core_sdk == 'true' || needs.fail_if_version_is_same.outputs.is_publish_react_sdk == 'true') && github.event_name == 'push' }} runs-on: ubuntu-latest environment: "beta-sepolia" env: - RPC_PROVIDER_URL: ${{ secrets.RPC_PROVIDER_URL }} WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }} TEST_WALLET_ADDRESS: ${{ secrets.TEST_WALLET_ADDRESS }} - SEPOLIA_RPC_PROVIDER_URL: ${{ secrets.SEPOLIA_RPC_PROVIDER_URL }} - TEST_SEPOLIA_RPC_PROVIDER_URL: ${{ secrets.TEST_SEPOLIA_RPC_PROVIDER_URL }} - SEPOLIA_WALLET_PRIVATE_KEY: ${{ secrets.SEPOLIA_WALLET_PRIVATE_KEY }} - SEPOLIA_TEST_WALLET_ADDRESS: ${{ secrets.SEPOLIA_TEST_WALLET_ADDRESS }} - STORY_TEST_NET_RPC_PROVIDER_URL: ${{ secrets.STORY_TEST_NET_RPC_PROVIDER_URL }} - STORY_TEST_NET_WALLET_PRIVATE_KEY: ${{ secrets.STORY_TEST_NET_WALLET_PRIVATE_KEY }} - STORY_TEST_NET_TEST_WALLET_ADDRESS: ${{ secrets.STORY_TEST_NET_TEST_WALLET_ADDRESS }} steps: - name: Checkout uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -232,33 +135,14 @@ jobs: cache: pnpm registry-url: https://registry.npmjs.org/ - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - name: Install dependencies run: pnpm install - - name: Fix - run: pnpm fix - - - name: Run Anvil - id: run_anvil - run: anvil --fork-url ${SEPOLIA_RPC_PROVIDER_URL} --silent & - - - name: Check on Run Anvil - if: steps.run_anvil.outcome != 'success' - run: exit 1 - - - name: Test - run: pnpm test - - name: Build run: pnpm build - name: Publish core-sdk package to npm - if: ${{ github.event_name == 'push' && needs.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_CORE_SDK == 'true'}} + if: ${{ github.event_name == 'push' && needs.fail_if_version_is_same.outputs.IS_PUBLISH_CORE_SDK == 'true'}} run: | cd packages/core-sdk npm publish @@ -266,7 +150,7 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish react-sdk package to npm - if: ${{ github.event_name == 'push' && needs.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_REACT_SDK == 'true'}} + if: ${{ github.event_name == 'push' && needs.fail_if_version_is_same.outputs.IS_PUBLISH_REACT_SDK == 'true'}} run: | cd packages/react-sdk npm publish @@ -277,14 +161,14 @@ jobs: needs: [ build-test-publish, - print_version_to_publish, - check_if_version_is_valid_for_branch, fetch_last_tag, + fail_if_version_is_same, + print_version_to_publish, ] # Skip this job if core-sdk doesn't need to be published # and the event triggering the workflow is a push - if: ${{ github.event_name == 'push' && needs.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_CORE_SDK == 'true'}} - uses: ./.github/workflows/reusable-create-release.yml + if: ${{ github.event_name == 'push' && needs.fail_if_version_is_same.outputs.IS_PUBLISH_CORE_SDK == 'true'}} + uses: ./.github/workflows/create-release.yml with: tag_name: "@story-protocol/core-sdk@${{ needs.print_version_to_publish.outputs.core_sdk_version_to_be_published }}" is_core_sdk: true @@ -307,13 +191,13 @@ jobs: [ build-test-publish, print_version_to_publish, - check_if_version_is_valid_for_branch, + fail_if_version_is_same, fetch_last_tag, ] # Skip this job if react-sdk doesn't need to be published # and the event triggering the workflow is a push - if: ${{ github.event_name == 'push' && needs.check_if_version_is_valid_for_branch.outputs.IS_PUBLISH_REACT_SDK == 'true'}} - uses: ./.github/workflows/reusable-create-release.yml + if: ${{ github.event_name == 'push' && needs.fail_if_version_is_same.outputs.IS_PUBLISH_REACT_SDK == 'true'}} + uses: ./.github/workflows/create-release.yml with: tag_name: "@story-protocol/react-sdk@${{ needs.print_version_to_publish.outputs.react_sdk_version_to_be_published }}" is_core_sdk: false diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml new file mode 100644 index 00000000..e987e5a2 --- /dev/null +++ b/.github/workflows/sync-labels.yml @@ -0,0 +1,93 @@ +name: Sync Labels from Issue to PR + +on: + pull_request: + types: [edited, opened, reopened] + +jobs: + sync-labels: + runs-on: ubuntu-latest + steps: + - name: Get associated issue number + id: get_issue_number + run: | + ISSUE_NUMBERS=$(echo "${{ github.event.pull_request.body }}" | grep -oE "#[0-9]+" | tr -d "#" | tr '\n' ',') + ISSUE_NUMBERS=$(echo $ISSUE_NUMBERS | sed 's/,$//') + echo "ISSUE_NUMBERS=$ISSUE_NUMBERS" >> $GITHUB_ENV + echo "Issue numbers are $ISSUE_NUMBERS" + + - name: Get labels from issue + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7 + id: get_issue_labels + with: + script: | + const issueNumbers = process.env.ISSUE_NUMBERS.split(","); + let allLabels = new Set(); + for (const issueNumber of issueNumbers) { + try { + const { data: { labels } } = await github.rest.issues.get({ + issue_number: issueNumber, + owner: context.repo.owner, + repo: context.repo.repo, + }); + labels.forEach(label => allLabels.add(label.name)); + } catch (error) { + console.error(`Error fetching labels for issue #${issueNumber}: `, error); + } + } + if (allLabels.size === 0) { + core.setOutput('labels', ''); + } else { + const sortedLabels = Array.from(allLabels).sort().join(","); + core.setOutput('labels', sortedLabels); + } + + - name: Check if labels are the same + id: check_labels_are_same + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7 + with: + script: | + const issueLabels = "${{ steps.get_issue_labels.outputs.labels }}"; + const prLabels = await github.rest.issues.listLabelsOnIssue({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); + const prLabelsNames = prLabels.data.map(label => label.name).sort(); + const isSame = issueLabels === prLabelsNames.join(","); + core.setOutput('isSame', isSame.toString()); + core.setOutput('labels', issueLabels); + + - name: Apply labels to PR + if: steps.check_labels_are_same.outputs.isSame == 'false' + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7 + with: + script: | + const isSame = "${{ steps.check_labels_are_same.outputs.isSame }}"; + const labels = "${{ steps.check_labels_are_same.outputs.labels }}" === "" ? [] : "${{ steps.check_labels_are_same.outputs.labels }}".split(","); + const owner = context.repo.owner; + const repo = context.repo.repo; + const issue_number = context.issue.number; + + if (labels.length === 0) { + const prLabels = await github.rest.issues.listLabelsOnIssue({ + owner: owner, + repo: repo, + issue_number: issue_number, + }); + for (const label of prLabels.data) { + await github.rest.issues.removeLabel({ + owner: owner, + repo: repo, + issue_number: issue_number, + name: label.name, + }); + } + } else { + await github.rest.issues.setLabels({ + owner: owner, + repo: repo, + issue_number: issue_number, + labels: labels, + }); + } diff --git a/.github/workflows/test-slack-notifs.yml b/.github/workflows/test-slack-notifs.yml deleted file mode 100644 index 512d1c52..00000000 --- a/.github/workflows/test-slack-notifs.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: test slack notifications - -on: - workflow_dispatch: - -jobs: - call-slack-notif: - uses: cenevan/gha-workflows/.github/workflows/reusable-slack-notifs.yml@main - with: - short-desc: 'https://www.npmjs.com/package/@story-protocol/core-sdk/v/1.0.0-rc.11' - title: 'Core SDK Package Published' - img-url: 'https://i.imgur.com/eqfFZRb.jpeg' - img-alt-text: 'Test alt text' - secrets: - channel-name: ${{ secrets.SLACK_CHANNEL_ID_STORY_57BLOCKS }} - slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} From a56223d5cd63810f24f8c14226148dd5f0413e51 Mon Sep 17 00:00:00 2001 From: Bonnie Date: Thu, 5 Dec 2024 17:33:44 +0800 Subject: [PATCH 4/7] Update code owner --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1d1e7e7e..476acd57 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @LeoHChen @DonFungible @edisonz0718 @jacob-tucker @AndyBoWu +* @LeoHChen @DonFungible @edisonz0718 @jacob-tucker @AndyBoWu @allenchuang From cd68addaa9473398131947bb99896f35e1c189d4 Mon Sep 17 00:00:00 2001 From: Bonnie Date: Thu, 5 Dec 2024 18:00:22 +0800 Subject: [PATCH 5/7] Delete .gitmodules file --- .gitmodules | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 880305e0..00000000 --- a/.gitmodules +++ /dev/null @@ -1,8 +0,0 @@ -[submodule "packages/core-sdk/protocol-periphery-contracts"] - path = packages/core-sdk/protocol-periphery-contracts - url = https://github.com/storyprotocol/protocol-periphery-v1 - branch = release-v1.x.x -[submodule "packages/core-sdk/protocol-core-contracts"] - path = packages/core-sdk/protocol-core-contracts - url = https://github.com/storyprotocol/protocol-core-v1 - branch = release-v1.x.x From c52853ab80c7f5d3c0097e9530f00757495bc305 Mon Sep 17 00:00:00 2001 From: Bonnie Date: Fri, 6 Dec 2024 13:49:58 +0800 Subject: [PATCH 6/7] Update permission in sync-label workflow --- .github/workflows/sync-labels.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index e987e5a2..7b7cd8e7 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -4,6 +4,9 @@ on: pull_request: types: [edited, opened, reopened] +permissions: + pull-requests: write + jobs: sync-labels: runs-on: ubuntu-latest From 50d89e2cb51f95801aba1e48d63917f145d27135 Mon Sep 17 00:00:00 2001 From: Bonnie Date: Fri, 6 Dec 2024 14:00:40 +0800 Subject: [PATCH 7/7] Update permission in publish package workflow --- .github/workflows/publish-package.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/publish-package.yaml b/.github/workflows/publish-package.yaml index 8a26312e..7cb92769 100644 --- a/.github/workflows/publish-package.yaml +++ b/.github/workflows/publish-package.yaml @@ -9,6 +9,10 @@ on: branches: - main +permissions: + contents: write + actions: write + jobs: timestamp: uses: storyprotocol/gha-workflows/.github/workflows/reusable-timestamp.yml@main