Skip to content

Commit cc59097

Browse files
[stable2506] Fix Publish Release Draft flow (#10550)
1 parent 5021c6e commit cc59097

File tree

1 file changed

+33
-43
lines changed

1 file changed

+33
-43
lines changed

.github/workflows/release-30_publish_release_draft.yml

Lines changed: 33 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070

7171
steps:
7272
- name: Checkout sources
73-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
73+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7474

7575
- name: Validate inputs
7676
id: validate_inputs
@@ -80,22 +80,11 @@ jobs:
8080
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
8181
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
8282
83-
build-runtimes:
84-
needs: [ validate-inputs ]
85-
uses: "./.github/workflows/release-srtool.yml"
86-
with:
87-
excluded_runtimes: "asset-hub-rococo bridge-hub-rococo coretime-rococo people-rococo rococo rococo-parachain substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template polkadot-sdk-docs-first pallet-staking-async-parachain pallet-staking-async-rc frame-storage-access-test yet-another-parachain"
88-
build_opts: "--features on-chain-release-build"
89-
profile: production
90-
permissions:
91-
id-token: write
92-
attestations: write
93-
contents: read
9483
9584
publish-release-draft:
9685
runs-on: ubuntu-latest
9786
environment: release
98-
needs: [ validate-inputs, build-runtimes ]
87+
needs: [ validate-inputs ]
9988
outputs:
10089
release_url: ${{ steps.create-release.outputs.html_url }}
10190
asset_upload_url: ${{ steps.create-release.outputs.upload_url }}
@@ -132,13 +121,13 @@ jobs:
132121
id: draft
133122
env:
134123
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135-
ASSET_HUB_WESTEND_DIGEST: ${{ github.workspace}}/asset-hub-westend-runtime/asset-hub-westend-srtool-digest.json
136-
BRIDGE_HUB_WESTEND_DIGEST: ${{ github.workspace}}/bridge-hub-westend-runtime/bridge-hub-westend-srtool-digest.json
137-
COLLECTIVES_WESTEND_DIGEST: ${{ github.workspace}}/collectives-westend-runtime/collectives-westend-srtool-digest.json
138-
CORETIME_WESTEND_DIGEST: ${{ github.workspace}}/coretime-westend-runtime/coretime-westend-srtool-digest.json
139-
GLUTTON_WESTEND_DIGEST: ${{ github.workspace}}/glutton-westend-runtime/glutton-westend-srtool-digest.json
140-
PEOPLE_WESTEND_DIGEST: ${{ github.workspace}}/people-westend-runtime/people-westend-srtool-digest.json
141-
WESTEND_DIGEST: ${{ github.workspace}}/westend-runtime/westend-srtool-digest.json
124+
ASSET_HUB_WESTEND_DIGEST: ${{ github.workspace}}/runtimes/asset-hub-westend-runtime/asset-hub-westend-srtool-digest.json
125+
BRIDGE_HUB_WESTEND_DIGEST: ${{ github.workspace}}/runtimes/bridge-hub-westend-runtime/bridge-hub-westend-srtool-digest.json
126+
COLLECTIVES_WESTEND_DIGEST: ${{ github.workspace}}/runtimes/collectives-westend-runtime/collectives-westend-srtool-digest.json
127+
CORETIME_WESTEND_DIGEST: ${{ github.workspace}}/runtimes/coretime-westend-runtime/coretime-westend-srtool-digest.json
128+
GLUTTON_WESTEND_DIGEST: ${{ github.workspace}}/runtimes/glutton-westend-runtime/glutton-westend-srtool-digest.json
129+
PEOPLE_WESTEND_DIGEST: ${{ github.workspace}}/runtimes/people-westend-runtime/people-westend-srtool-digest.json
130+
WESTEND_DIGEST: ${{ github.workspace}}/runtimes/westend-runtime/westend-srtool-digest.json
142131
RELEASE_TAG: ${{ needs.validate-inputs.outputs.release_tag }}
143132
NO_RUNTIMES: ${{ inputs.no_runtimes }}
144133
CRATES_ONLY: ${{ inputs.crates_only }}
@@ -168,22 +157,13 @@ jobs:
168157
./scripts/release/build-changelogs.sh
169158
170159
- name: Archive artifact context.json
171-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
160+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
172161
with:
173162
name: release-notes-context
174163
path: |
175164
scripts/release/context.json
176165
**/*-srtool-digest.json
177166
178-
- name: Generate content write token for the release automation
179-
id: generate_write_token
180-
uses: actions/create-github-app-token@v2
181-
with:
182-
app-id: ${{ vars.POLKADOT_SDK_RELEASE_RW_APP_ID }}
183-
private-key: ${{ secrets.POLKADOT_SDK_RELEASE_RW_APP_KEY }}
184-
owner: paritytech
185-
repositories: polkadot-sdk
186-
187167
- name: Create draft release
188168
id: create-release
189169
env:
@@ -202,32 +182,42 @@ jobs:
202182
continue-on-error: true
203183
runs-on: ubuntu-latest
204184
strategy:
205-
matrix: ${{ fromJSON(needs.build-runtimes.outputs.published_runtimes) }}
185+
matrix: ${{ fromJSON(inputs.runtimes) }}
206186

207187
steps:
208188
- name: Checkout sources
209-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
189+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
210190

211191
- name: Download artifacts
212-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
213-
214-
- name: Get runtime info
215-
env:
216-
JSON: release-notes-context/${{ matrix.chain }}-runtime/${{ matrix.chain }}-srtool-digest.json
217-
run: |
218-
>>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime -name '*.compact.compressed.wasm')
219-
>>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion)
192+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
220193

221194
- name: Generate content write token for the release automation
222195
id: generate_write_token
223-
uses: actions/create-github-app-token@v2
196+
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
224197
with:
225198
app-id: ${{ vars.POLKADOT_SDK_RELEASE_RW_APP_ID }}
226199
private-key: ${{ secrets.POLKADOT_SDK_RELEASE_RW_APP_KEY }}
227200
owner: paritytech
228201
repositories: polkadot-sdk
229202

203+
- name: Download runtimes
204+
env:
205+
GITHUB_TOKEN: ${{ steps.generate_write_token.outputs.token }}
206+
run: |
207+
mkdir -p ${{ github.workspace}}/runtimes/
208+
gh run download ${{ inputs.build_run_id }} --dir ${{ github.workspace}}/runtimes
209+
ls -la ${{ github.workspace}}/runtimes
210+
211+
- name: Get runtime info
212+
env:
213+
JSON: ${{ github.workspace}}/release-notes-context/runtimes/${{ matrix.chain }}-runtime/${{ matrix.chain }}-srtool-digest.json
214+
run: |
215+
cd ${{ github.workspace}}/runtimes
216+
>>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime -name '*.compact.compressed.wasm')
217+
>>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion)
218+
230219
- name: Upload compressed ${{ matrix.chain }} v${{ env.SPEC }} wasm
220+
working-directory: ${{ github.workspace}}/runtimes
231221
env:
232222
GITHUB_TOKEN: ${{ steps.generate_write_token.outputs.token }}
233223
run: |
@@ -250,7 +240,7 @@ jobs:
250240

251241
steps:
252242
- name: Checkout sources
253-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
243+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
254244

255245
- name: Fetch binaries from s3 based on version
256246
run: |
@@ -273,7 +263,7 @@ jobs:
273263
274264
- name: Generate content write token for the release automation
275265
id: generate_write_token
276-
uses: actions/create-github-app-token@v2
266+
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
277267
with:
278268
app-id: ${{ vars.POLKADOT_SDK_RELEASE_RW_APP_ID }}
279269
private-key: ${{ secrets.POLKADOT_SDK_RELEASE_RW_APP_KEY }}

0 commit comments

Comments
 (0)