24
24
required : false
25
25
type : boolean
26
26
default : false
27
+ ref :
28
+ description : " Reference of the commit to release (default: ${{ github.ref }})"
29
+ required : false
30
+ type : string
31
+ default : " "
27
32
28
33
env :
29
34
CARGO_INCREMENTAL : 0
@@ -43,14 +48,13 @@ jobs:
43
48
steps :
44
49
- id : meta
45
50
env :
46
- SHA : ${{ github.sha }}
47
51
VERSION : ${{ inputs.version }}
48
52
shell : bash
49
53
run : |
50
54
set -euo pipefail
51
55
shopt -s extglob
52
56
if [[ '${{ github.event_name }}' == "pull_request" ]]; then
53
- echo version="0.0.0-test.${SHA :0:7}"
57
+ echo version="0.0.0-test.${GITHUB_SHA :0:7}"
54
58
echo archs='["amd64"]'
55
59
exit 0
56
60
fi >> "$GITHUB_OUTPUT"
78
82
version : ${{ steps.meta.outputs.version }}
79
83
package : ${{ github.event_name == 'workflow_dispatch' || steps.changed.outputs.any_changed == 'true' }}
80
84
profile : ${{ inputs.profile || 'release' }}
85
+ ref : ${{ inputs.ref || github.ref }}
81
86
82
87
info :
83
88
needs : meta
@@ -91,10 +96,12 @@ jobs:
91
96
echo 'inputs.tag-prefix: ${{ inputs.tag-prefix }}'
92
97
echo 'inputs.profile: ${{ inputs.profile }}'
93
98
echo 'inputs.publish: ${{ inputs.publish }}'
99
+ echo 'inputs.ref: ${{ inputs.ref }}'
94
100
echo 'needs.meta.outputs.archs: ${{ needs.meta.outputs.archs }}'
95
101
echo 'needs.meta.outputs.version: ${{ needs.meta.outputs.version }}'
96
102
echo 'needs.meta.outputs.package: ${{ needs.meta.outputs.package }}'
97
103
echo 'needs.meta.outputs.profile: ${{ needs.meta.outputs.profile }}'
104
+ echo 'needs.meta.outputs.ref: ${{ needs.meta.outputs.ref }}'
98
105
99
106
package :
100
107
needs : meta
@@ -146,6 +153,8 @@ jobs:
146
153
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
147
154
# Tag the release.
148
155
- uses : actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
156
+ with :
157
+ ref : ${{ needs.meta.outputs.ref }}
149
158
- run : git tag -a -m "v${{ needs.meta.outputs.version }}" "$TAG"
150
159
# Fetch the artifacts.
151
160
- uses : actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
0 commit comments