Skip to content

Commit 7155150

Browse files
EgorPopelyaevgithub-actions[bot]
authored andcommitted
[Release|CI/CD] Add parallel crates publishing (#11433)
This PR adds option to publish crates in parallel to the Publish Crates flow (cherry picked from commit fa14a5a)
1 parent 0f6558b commit 7155150

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 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
@@ -297,15 +302,21 @@ jobs:
297302
PARITY_PUBLISH_CRATESIO_TOKEN: ${{ inputs.registry == 'staging.crates.io' && secrets.STAGING_CRATES_IO_API_TOKEN || secrets.CRATES_IO_API_TOKEN }}
298303
DRY_RUN: ${{ inputs.dry_run }}
299304
REGISTRY: ${{ inputs.registry }}
305+
PUBLISH_JOBS: ${{ inputs.publish_jobs }}
300306
run: |
307+
PARALLEL_ARGS=""
308+
if [ "$PUBLISH_JOBS" -gt 0 ] 2>/dev/null; then
309+
echo "Parallel publishing enabled with $PUBLISH_JOBS jobs"
310+
PARALLEL_ARGS="-j $PUBLISH_JOBS"
311+
fi
301312
302313
if [ "$DRY_RUN" = true ]; then
303314
echo "DRY RUN - Not actually publishing crates"
304315
echo "Target registry: $REGISTRY"
305-
parity-publish apply -p -d
316+
parity-publish apply -p -d $PARALLEL_ARGS
306317
else
307318
echo "Publishing crates to $REGISTRY..."
308-
parity-publish apply -p
319+
parity-publish apply -p $PARALLEL_ARGS
309320
echo "Crates published successfully to $REGISTRY!"
310321
fi
311322

0 commit comments

Comments
 (0)