|
| 1 | +name: Release - Publish draft |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + # Catches v1.2.3 and v1.2.3-rc1 |
| 7 | + - v[0-9]+.[0-9]+.[0-9]+* |
| 8 | + |
| 9 | + workflow_dispatch: |
| 10 | + inputs: |
| 11 | + version: |
| 12 | + description: Current release/rc version |
| 13 | + |
| 14 | +jobs: |
| 15 | + get-rust-versions: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + outputs: |
| 18 | + rustc-stable: ${{ steps.get-rust-versions.outputs.stable }} |
| 19 | + steps: |
| 20 | + - id: get-rust-versions |
| 21 | + run: | |
| 22 | + RUST_STABLE_VERSION=$(curl -sS https://raw.githubusercontent.com/paritytech/scripts/master/dockerfiles/ci-unified/Dockerfile | grep -oP 'ARG RUST_STABLE_VERSION=\K[^ ]+') |
| 23 | + echo "stable=$RUST_STABLE_VERSION" >> $GITHUB_OUTPUT |
| 24 | +
|
| 25 | + build-runtimes: |
| 26 | + uses: "./.github/workflows/srtool.yml" |
| 27 | + with: |
| 28 | + excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template" |
| 29 | + |
| 30 | + publish-release-draft: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + needs: [get-rust-versions, build-runtimes] |
| 33 | + outputs: |
| 34 | + release_url: ${{ steps.create-release.outputs.html_url }} |
| 35 | + asset_upload_url: ${{ steps.create-release.outputs.upload_url }} |
| 36 | + steps: |
| 37 | + - name: Checkout |
| 38 | + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 |
| 39 | + |
| 40 | + - name: Prepare tooling |
| 41 | + run: | |
| 42 | + URL=https://github.com/chevdor/tera-cli/releases/download/v0.2.4/tera-cli_linux_amd64.deb |
| 43 | + wget $URL -O tera.deb |
| 44 | + sudo dpkg -i tera.deb |
| 45 | + tera --version |
| 46 | +
|
| 47 | + - name: Download artifacts |
| 48 | + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 |
| 49 | + |
| 50 | + - name: Prepare draft |
| 51 | + id: draft |
| 52 | + env: |
| 53 | + RUSTC_STABLE: ${{ needs.get-rust-versions.outputs.rustc-stable }} |
| 54 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + ASSET_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/asset-hub-rococo-runtime/asset-hub-rococo-srtool-digest.json |
| 56 | + ASSET_HUB_WESTEND_DIGEST: ${{ github.workspace}}/asset-hub-westend-runtime/asset-hub-westend-srtool-digest.json |
| 57 | + BRIDGE_HUB_ROCOCO_DIGEST: ${{ github.workspace}}/bridge-hub-rococo-runtime/bridge-hub-rococo-srtool-digest.json |
| 58 | + BRIDGE_HUB_WESTEND_DIGEST: ${{ github.workspace}}/bridge-hub-westend-runtime/bridge-hub-westend-srtool-digest.json |
| 59 | + COLLECTIVES_WESTEND_DIGEST: ${{ github.workspace}}/collectives-westend-runtime/collectives-westend-srtool-digest.json |
| 60 | + CONTRACTS_ROCOCO_DIGEST: ${{ github.workspace}}/contracts-rococo-runtime/contracts-rococo-srtool-digest.json |
| 61 | + CORETIME_ROCOCO_DIGEST: ${{ github.workspace}}/coretime-rococo-runtime/coretime-rococo-srtool-digest.json |
| 62 | + CORETIME_WESTEND_DIGEST: ${{ github.workspace}}/coretime-westend-runtime/coretime-westend-srtool-digest.json |
| 63 | + GLUTTON_WESTEND_DIGEST: ${{ github.workspace}}/glutton-westend-runtime/glutton-westend-srtool-digest.json |
| 64 | + PEOPLE_ROCOCO_DIGEST: ${{ github.workspace}}/people-rococo-runtime/people-rococo-srtool-digest.json |
| 65 | + PEOPLE_WESTEND_DIGEST: ${{ github.workspace}}/people-westend-runtime/people-westend-srtool-digest.json |
| 66 | + ROCOCO_DIGEST: ${{ github.workspace}}/rococo-runtime/rococo-srtool-digest.json |
| 67 | + WESTEND_DIGEST: ${{ github.workspace}}/westend-runtime/westend-srtool-digest.json |
| 68 | + run: | |
| 69 | + . ./.github/scripts/common/lib.sh |
| 70 | +
|
| 71 | + export REF1=$(get_latest_release_tag) |
| 72 | + if [[ -z "${{ inputs.version }}" ]]; then |
| 73 | + export REF2="${{ github.ref }}" |
| 74 | + else |
| 75 | + export REF2="${{ inputs.version }}" |
| 76 | + fi |
| 77 | + echo "REL_TAG=$REF2" >> $GITHUB_ENV |
| 78 | + export VERSION=$(echo "$REF2" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+).*$/\1/') |
| 79 | +
|
| 80 | + ./scripts/release/build-changelogs.sh |
| 81 | +
|
| 82 | + echo "Checking the folder state" |
| 83 | + pwd |
| 84 | + ls -la scripts/release |
| 85 | +
|
| 86 | + - name: Archive artifact context.json |
| 87 | + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 |
| 88 | + with: |
| 89 | + name: release-notes-context |
| 90 | + path: | |
| 91 | + scripts/release/context.json |
| 92 | + **/*-srtool-digest.json |
| 93 | +
|
| 94 | + - name: Create draft release |
| 95 | + id: create-release |
| 96 | + uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4 |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 99 | + with: |
| 100 | + tag_name: ${{ env.REL_TAG }} |
| 101 | + release_name: Polkadot ${{ env.REL_TAG }} |
| 102 | + body_path: ${{ github.workspace}}/scripts/release/RELEASE_DRAFT.md |
| 103 | + draft: true |
| 104 | + |
| 105 | + publish-runtimes: |
| 106 | + needs: [ build-runtimes, publish-release-draft ] |
| 107 | + continue-on-error: true |
| 108 | + runs-on: ubuntu-latest |
| 109 | + strategy: |
| 110 | + matrix: ${{ fromJSON(needs.build-runtimes.outputs.published_runtimes) }} |
| 111 | + |
| 112 | + steps: |
| 113 | + - name: Checkout sources |
| 114 | + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 |
| 115 | + |
| 116 | + - name: Download artifacts |
| 117 | + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 |
| 118 | + |
| 119 | + - name: Get runtime info |
| 120 | + env: |
| 121 | + JSON: release-notes-context/${{ matrix.chain }}-runtime/${{ matrix.chain }}-srtool-digest.json |
| 122 | + run: | |
| 123 | + >>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime -name '*.compact.compressed.wasm') |
| 124 | + >>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion) |
| 125 | +
|
| 126 | + - name: Upload compressed ${{ matrix.chain }} v${{ env.SPEC }} wasm |
| 127 | + if: ${{ matrix.chain != 'rococo-parachain' }} |
| 128 | + uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 #v1.0.2 |
| 129 | + env: |
| 130 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 131 | + with: |
| 132 | + upload_url: ${{ needs.publish-release-draft.outputs.asset_upload_url }} |
| 133 | + asset_path: ${{ env.ASSET }} |
| 134 | + asset_name: ${{ matrix.chain }}_runtime-v${{ env.SPEC }}.compact.compressed.wasm |
| 135 | + asset_content_type: application/wasm |
| 136 | + |
| 137 | + post_to_matrix: |
| 138 | + runs-on: ubuntu-latest |
| 139 | + needs: publish-release-draft |
| 140 | + strategy: |
| 141 | + matrix: |
| 142 | + channel: |
| 143 | + - name: "Team: RelEng Internal" |
| 144 | + room: '!GvAyzgCDgaVrvibaAF:parity.io' |
| 145 | + |
| 146 | + steps: |
| 147 | + - name: Send Matrix message to ${{ matrix.channel.name }} |
| 148 | + uses: s3krit/matrix-message-action@70ad3fb812ee0e45ff8999d6af11cafad11a6ecf # v0.0.3 |
| 149 | + with: |
| 150 | + room_id: ${{ matrix.channel.room }} |
| 151 | + access_token: ${{ secrets.RELEASENOTES_MATRIX_V2_ACCESS_TOKEN }} |
| 152 | + server: m.parity.io |
| 153 | + message: | |
| 154 | + **New version of polkadot tagged**: ${{ github.ref }}<br/> |
| 155 | + Draft release created: ${{ needs.publish-release-draft.outputs.release_url }} |
0 commit comments