@@ -17,7 +17,7 @@ name: Release
17
17
permissions :
18
18
" contents " : " write"
19
19
20
- # This task will run whenever you push a git tag that looks like a version
20
+ # This task will run whenever you workflow_dispatch with a tag that looks like a version
21
21
# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
22
22
# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where
23
23
# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
@@ -39,19 +39,23 @@ permissions:
39
39
# If there's a prerelease-style suffix to the version, then the release(s)
40
40
# will be marked as a prerelease.
41
41
on :
42
- push :
43
- tags :
44
- - ' **[0-9]+.[0-9]+.[0-9]+*'
42
+ workflow_dispatch :
43
+ inputs :
44
+ tag :
45
+ description : Release Tag
46
+ required : true
47
+ default : dry-run
48
+ type : string
45
49
46
50
jobs :
47
51
# Run 'dist plan' (or host) to determine what tasks we need to do
48
52
plan :
49
53
runs-on : " ubuntu-20.04"
50
54
outputs :
51
55
val : ${{ steps.plan.outputs.manifest }}
52
- tag : ${{ !github.event.pull_request && github.ref_name || '' }}
53
- tag-flag : ${{ !github.event.pull_request && format('--tag={0}', github.ref_name ) || '' }}
54
- publishing : ${{ !github.event.pull_request }}
56
+ tag : ${{ (inputs.tag != 'dry-run' && inputs.tag) || '' }}
57
+ tag-flag : ${{ inputs.tag && inputs.tag != 'dry-run' && format('--tag={0}', inputs.tag ) || '' }}
58
+ publishing : ${{ inputs.tag && inputs.tag != 'dry-run' }}
55
59
env :
56
60
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57
61
steps :
75
79
# but also really annoying to build CI around when it needs secrets to work right.)
76
80
- id : plan
77
81
run : |
78
- dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name )) || 'plan' }} --output-format=json > plan-dist-manifest.json
82
+ dist ${{ (inputs.tag && inputs.tag != 'dry-run' && format('host --steps=create --tag={0}', inputs.tag )) || 'plan' }} --output-format=json > plan-dist-manifest.json
79
83
echo "dist ran successfully"
80
84
cat plan-dist-manifest.json
81
85
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
91
95
# Let the initial task tell us to not run (currently very blunt)
92
96
needs :
93
97
- plan
94
- if : ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
98
+ if : ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') || inputs.tag == 'dry-run' }}
95
99
strategy :
96
100
fail-fast : false
97
101
# Target platforms/runners are computed by dist in create-release.
0 commit comments