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 1
1
# This is triggered after the Release workflow successfully completes its run
2
2
name : Publish on crates.io
3
3
on :
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
+
9
12
env :
10
13
CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
11
14
jobs :
Original file line number Diff line number Diff line change @@ -274,14 +274,29 @@ jobs:
274
274
275
275
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
276
276
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
+
277
291
announce :
278
292
needs :
279
293
- plan
280
294
- host
295
+ - custom-publish.yml
281
296
# use "always() && ..." to allow us to wait for all publish jobs while
282
297
# still allowing individual publish jobs to skip themselves (for prereleases).
283
298
# "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') }}
285
300
runs-on : " ubuntu-22.04"
286
301
env :
287
302
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ pr-run-mode = "plan"
19
19
install-updater = false
20
20
# Path that installers should place binaries in
21
21
install-path = " CARGO_HOME"
22
+ # Publish jobs to run in CI
23
+ publish-jobs = [" ./publish.yml" ]
22
24
23
25
[dist .github-custom-runners ]
24
26
global = " ubuntu-22.04"
You can’t perform that action at this time.
0 commit comments