File tree Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 11# This is triggered after the Release workflow successfully completes its run
22name : Publish on crates.io
33on :
4- workflow_run :
5- workflows :
6- - Release
7- types :
8- - completed
4+ workflow_call :
5+ # dist exposes the plan from the plan step, as a JSON string,
6+ # to your job if it needs it
7+ inputs :
8+ plan :
9+ required : true
10+ type : string
11+
912env :
1013 CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
1114jobs :
Original file line number Diff line number Diff line change @@ -274,14 +274,29 @@ jobs:
274274
275275 gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
276276
277+ custom-publish.yml :
278+ needs :
279+ - plan
280+ - host
281+ if : ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
282+ uses : ./.github/workflows/publish.yml.yml
283+ with :
284+ plan : ${{ needs.plan.outputs.val }}
285+ secrets : inherit
286+ # publish jobs get escalated permissions
287+ permissions :
288+ " id-token " : " write"
289+ " packages " : " write"
290+
277291 announce :
278292 needs :
279293 - plan
280294 - host
295+ - custom-publish.yml
281296 # use "always() && ..." to allow us to wait for all publish jobs while
282297 # still allowing individual publish jobs to skip themselves (for prereleases).
283298 # "host" however must run to completion, no skipping allowed!
284- if : ${{ always() && needs.host.result == 'success' }}
299+ if : ${{ always() && needs.host.result == 'success' && (needs.custom-publish.yml.result == 'skipped' || needs.custom-publish.yml.result == 'success') }}
285300 runs-on : " ubuntu-22.04"
286301 env :
287302 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ pr-run-mode = "plan"
1919install-updater = false
2020# Path that installers should place binaries in
2121install-path = " CARGO_HOME"
22+ # Publish jobs to run in CI
23+ publish-jobs = [" ./publish.yml" ]
2224
2325[dist .github-custom-runners ]
2426global = " ubuntu-22.04"
You can’t perform that action at this time.
0 commit comments