diff --git a/.github/workflows/release-80_publish-crates.yml b/.github/workflows/release-80_publish-crates.yml index 090d9706f4fd0..176a4ef25e2f6 100644 --- a/.github/workflows/release-80_publish-crates.yml +++ b/.github/workflows/release-80_publish-crates.yml @@ -40,6 +40,11 @@ on: required: false type: string default: prdoc + publish_jobs: + description: 'Number of parallel publish jobs (0 = sequential publishing, >0 = parallel with N jobs).' + required: false + type: string + default: '0' permissions: contents: write @@ -251,6 +256,13 @@ jobs: cargo update --workspace --offline || cargo update --workspace echo "Cargo.lock updated" + - name: Verify workspace compiles + if: inputs.resume_from == 'full' || inputs.resume_from == 'apply' + run: | + echo "Checking that rewritten manifests compile..." + cargo check --workspace --all-targets 2>&1 + echo "Workspace compiles successfully" + - name: Commit version bumps if: inputs.resume_from == 'full' || inputs.resume_from == 'apply' shell: bash @@ -296,15 +308,21 @@ jobs: PARITY_PUBLISH_CRATESIO_TOKEN: ${{ inputs.registry == 'staging.crates.io' && secrets.STAGING_CRATES_IO_API_TOKEN || secrets.CRATES_IO_API_TOKEN }} DRY_RUN: ${{ inputs.dry_run }} REGISTRY: ${{ inputs.registry }} + PUBLISH_JOBS: ${{ inputs.publish_jobs }} run: | + PARALLEL_ARGS="" + if [ "$PUBLISH_JOBS" -gt 0 ] 2>/dev/null; then + echo "Parallel publishing enabled with $PUBLISH_JOBS jobs" + PARALLEL_ARGS="-j $PUBLISH_JOBS --no-verify" + fi if [ "$DRY_RUN" = true ]; then echo "DRY RUN - Not actually publishing crates" echo "Target registry: $REGISTRY" - parity-publish apply -p -d + parity-publish apply -p -d $PARALLEL_ARGS else echo "Publishing crates to $REGISTRY..." - parity-publish apply -p + parity-publish apply -p $PARALLEL_ARGS echo "Crates published successfully to $REGISTRY!" fi @@ -331,6 +349,7 @@ jobs: if: failure() env: CRATES_RELEASE_BRANCH: ${{ steps.derive_branch.outputs.CRATES_RELEASE_BRANCH }} + GITHUB_TOKEN: ${{ github.token }} run: | echo "Job failed. Pushing branch '$CRATES_RELEASE_BRANCH' to origin (paritytech-release) to preserve state for resume..." # Restore origin to the fork repo in case it was changed by the upstream push step