24
24
description : ' Publish Java Artifacts'
25
25
required : true
26
26
default : ' true'
27
-
27
+ env :
28
+ INPUT_REF : ${{ github.event.inputs.ref }}
29
+ INPUT_TAG : ${{ github.event.inputs.tag }}
30
+
28
31
jobs :
29
32
create_draft_release :
30
33
name : Create Github draft release
37
40
id : check_release
38
41
run : |
39
42
echo "::echo::on"
40
- gh release view --repo '${{ github.repository }}' '${{ github.event.inputs.tag }}' \
43
+ gh release view --repo "$GITHUB_REPOSITORY" "$INPUT_TAG" \
41
44
&& echo "::set-output name=already_exists::true" \
42
45
|| echo "::set-output name=already_exists::false"
43
46
env :
@@ -47,18 +50,18 @@ jobs:
47
50
if : steps.check_release.outputs.already_exists == 'false'
48
51
uses : actions/checkout@v3
49
52
with :
50
- ref : ' ${{ github.event.inputs.ref }}'
53
+ ref : ${{ env.INPUT_REF }}
51
54
52
55
- name : Create release
53
56
if : steps.check_release.outputs.already_exists == 'false'
54
57
run : >
55
58
gh release create
56
- '${{ github.event.inputs.tag }}'
59
+ "$INPUT_REF"
57
60
--draft
58
- --repo '${{ github.repository }}'
59
- --title '${{ github.event.inputs.tag }}'
60
- --target '${{ github.event.inputs.ref }}'
61
- --notes-file ' releases/${{ github.event.inputs.tag }}'
61
+ --repo "$GITHUB_REPOSITORY"
62
+ --title "$INPUT_TAG"
63
+ --target "$INPUT_REF"
64
+ --notes-file releases/"$INPUT_TAG"
62
65
env :
63
66
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
64
67
71
74
- name : Checkout repo
72
75
uses : actions/checkout@v3
73
76
with :
74
- ref : ' ${{ github.event.inputs.ref }}'
77
+ ref : ${{ env.INPUT_REF }}
75
78
76
79
# Our custom gradle version sniffing builds the maven release artifact
77
80
# names out of the git tag ... but the repo isn't tagged (yet) so add a
80
83
# inspected and verified, the manual act of publishing the draft GH
81
84
# release creates the tag.
82
85
- name : Temporary tag
83
- run : git tag '${{ github.event.inputs.tag }}'
86
+ run : git tag "$INPUT_TAG"
84
87
85
88
- name : Set up Java
86
89
uses : actions/setup-java@v3
@@ -138,12 +141,12 @@ jobs:
138
141
- name : Checkout repo
139
142
uses : actions/checkout@v3
140
143
with :
141
- ref : ' ${{ github.event.inputs.ref }}'
144
+ ref : ${{ env.INPUT_REF }}
142
145
143
146
# See comment on temporary tag above. tldr: this is a local tag; never
144
147
# gets pushed
145
148
- name : Temporary tag
146
- run : git tag '${{ github.event.inputs.tag }}'
149
+ run : git tag "$INPUT_TAG"
147
150
148
151
- name : Set up Java
149
152
uses : actions/setup-java@v3
@@ -186,7 +189,7 @@ jobs:
186
189
# the root directory of the contents of the archive.
187
190
- name : Rename dirs
188
191
run : |
189
- version="$(sed 's/^v//'<<<'${{ github.event.inputs.tag }}' )"
192
+ version="$(sed 's/^v//'<<<"$INPUT_TAG" )"
190
193
for dir in *; do mv "$dir" "temporal-test-server_${version}_${dir}"; done
191
194
192
195
- name : Tar (linux, macOS)
@@ -207,7 +210,7 @@ jobs:
207
210
208
211
- name : Upload
209
212
run : |
210
- until gh release upload --clobber --repo ${{ github.repository }} ${{ github.event.inputs.tag }} *.zip *.tar.gz; do
213
+ until gh release upload --clobber --repo $GITHUB_REPOSITORY "$INPUT_TAG" *.zip *.tar.gz; do
211
214
echo "Attempt $((++attempts)) to upload release artifacts failed. Will retry in 20s"
212
215
sleep 20
213
216
done
0 commit comments