Skip to content

Commit 4f3385b

Browse files
[stable2509] Backport #11433 (#11438)
Backport #11433 into `stable2509` from EgorPopelyaev. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Co-authored-by: Egor_P <egor@parity.io>
1 parent 7e6a45b commit 4f3385b

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/release-80_publish-crates.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ on:
4040
required: false
4141
type: string
4242
default: prdoc
43+
publish_jobs:
44+
description: 'Number of parallel publish jobs (0 = sequential publishing, >0 = parallel with N jobs).'
45+
required: false
46+
type: string
47+
default: '0'
4348

4449
permissions:
4550
contents: write
@@ -251,6 +256,13 @@ jobs:
251256
cargo update --workspace --offline || cargo update --workspace
252257
echo "Cargo.lock updated"
253258
259+
- name: Verify workspace compiles
260+
if: inputs.resume_from == 'full' || inputs.resume_from == 'apply'
261+
run: |
262+
echo "Checking that rewritten manifests compile..."
263+
cargo check --workspace --all-targets 2>&1
264+
echo "Workspace compiles successfully"
265+
254266
- name: Commit version bumps
255267
if: inputs.resume_from == 'full' || inputs.resume_from == 'apply'
256268
shell: bash
@@ -296,15 +308,21 @@ jobs:
296308
PARITY_PUBLISH_CRATESIO_TOKEN: ${{ inputs.registry == 'staging.crates.io' && secrets.STAGING_CRATES_IO_API_TOKEN || secrets.CRATES_IO_API_TOKEN }}
297309
DRY_RUN: ${{ inputs.dry_run }}
298310
REGISTRY: ${{ inputs.registry }}
311+
PUBLISH_JOBS: ${{ inputs.publish_jobs }}
299312
run: |
313+
PARALLEL_ARGS=""
314+
if [ "$PUBLISH_JOBS" -gt 0 ] 2>/dev/null; then
315+
echo "Parallel publishing enabled with $PUBLISH_JOBS jobs"
316+
PARALLEL_ARGS="-j $PUBLISH_JOBS --no-verify"
317+
fi
300318
301319
if [ "$DRY_RUN" = true ]; then
302320
echo "DRY RUN - Not actually publishing crates"
303321
echo "Target registry: $REGISTRY"
304-
parity-publish apply -p -d
322+
parity-publish apply -p -d $PARALLEL_ARGS
305323
else
306324
echo "Publishing crates to $REGISTRY..."
307-
parity-publish apply -p
325+
parity-publish apply -p $PARALLEL_ARGS
308326
echo "Crates published successfully to $REGISTRY!"
309327
fi
310328
@@ -331,6 +349,7 @@ jobs:
331349
if: failure()
332350
env:
333351
CRATES_RELEASE_BRANCH: ${{ steps.derive_branch.outputs.CRATES_RELEASE_BRANCH }}
352+
GITHUB_TOKEN: ${{ github.token }}
334353
run: |
335354
echo "Job failed. Pushing branch '$CRATES_RELEASE_BRANCH' to origin (paritytech-release) to preserve state for resume..."
336355
# Restore origin to the fork repo in case it was changed by the upstream push step

0 commit comments

Comments
 (0)