diff --git a/.github/scripts/publish_release_setup_env.py b/.github/scripts/publish_release_setup_env.py deleted file mode 100644 index 048a57f29..000000000 --- a/.github/scripts/publish_release_setup_env.py +++ /dev/null @@ -1,12 +0,0 @@ -import os -import inspect - -chain, version = inspect.get_chain_and_version(os.getenv("GITHUB_REF")) -previous_version = inspect.get_previous_version(chain) - -is_patch = previous_version.split(".")[1] == version.split(".")[1] -scope = "runtime" if is_patch else "full" - -with open(os.getenv("GITHUB_ENV"), "a") as env: - env.write("CHAIN={}\n".format(chain)) - env.write("SCOPE={}\n".format(scope)) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index e16704c4b..b4f1addfa 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -20,28 +20,16 @@ on: default: karura type: choice options: - - mandala - karura - acala - # Get the scope of release note - scope: - description: Release scope (default = full) - required: true - default: full - type: choice - options: - - client - - runtime - - full # Get the SR Tool image used to build srtool_image: description: Default to use the latest. You can use an alternate image, use with caution! required: false env: - SUBWASM_VERSION: 0.20.0 + SUBWASM_VERSION: 0.21.3 CHAIN: ${{ github.event.inputs.chain }} - SCOPE: ${{ github.event.inputs.scope }} jobs: build-release: @@ -57,14 +45,15 @@ jobs: fetch-depth: 0 submodules: true - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - name: Setup ENV - if: ${{ env.CHAIN == '' || env.SCOPE == '' }} - run: python .github/scripts/publish_release_setup_env.py + if: ${{ env.CHAIN == '' }} + uses: actions/github-script@v7 + with: + script: | + const regex = /release-(karura|acala)-(\d+\.\d+\.\d+)/ + const branch = context.ref + const [chain] = branch.match(regex).slice(1) + core.exportVariable("CHAIN", chain) # Build WASM with Substrate Runtime Tool - name: Srtool build @@ -112,7 +101,6 @@ jobs: id: generate-note uses: AcalaNetwork/acala-release-note-action@master with: - scope: ${{ env.SCOPE }} chain: ${{ env.CHAIN }} subwasm_info: ${{ env.CHAIN }}-subwam-info.txt srtool_details: ${{ env.CHAIN }}-srtool-digest.json