7
7
inputs :
8
8
tag :
9
9
type : string
10
- description : ' Release version tag (e.g. v1.2.3)'
10
+ description : " Release version tag (e.g. v1.2.3)"
11
11
required : true
12
12
ref :
13
13
type : string
14
- description : ' Git ref from which to release'
14
+ description : " Git ref from which to release"
15
15
required : true
16
- default : ' master'
16
+ default : " master"
17
17
do_build_native_images :
18
18
type : boolean
19
- description : ' Native Test Server'
19
+ description : " Native Test Server"
20
20
required : true
21
- default : ' true'
21
+ default : " true"
22
22
do_publish_jars :
23
23
type : boolean
24
- description : ' Publish Java Artifacts'
24
+ description : " Publish Java Artifacts"
25
25
required : true
26
- default : ' true'
26
+ default : " true"
27
27
env :
28
28
INPUT_REF : ${{ github.event.inputs.ref }}
29
29
INPUT_TAG : ${{ github.event.inputs.tag }}
30
-
30
+
31
31
jobs :
32
32
create_draft_release :
33
33
name : Create Github draft release
64
64
--notes-file releases/"$INPUT_TAG"
65
65
env :
66
66
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67
-
67
+
68
68
publish_java_artifacts :
69
69
name : Publish Java Artifacts
70
70
if : github.event.inputs.do_publish_jars == 'true'
75
75
uses : actions/checkout@v3
76
76
with :
77
77
ref : ${{ env.INPUT_REF }}
78
-
78
+
79
79
# Our custom gradle version sniffing builds the maven release artifact
80
80
# names out of the git tag ... but the repo isn't tagged (yet) so add a
81
81
# tag to the _local_ clone just to get the right jar names. This tag
@@ -84,21 +84,21 @@ jobs:
84
84
# release creates the tag.
85
85
- name : Temporary tag
86
86
run : git tag "$INPUT_TAG"
87
-
87
+
88
88
- name : Set up Java
89
89
uses : actions/setup-java@v3
90
90
with :
91
- java-version : ' 11 '
92
- distribution : ' temurin'
93
-
91
+ java-version : " 11 "
92
+ distribution : " temurin"
93
+
94
94
- name : Set up Gradle
95
95
uses : gradle/gradle-build-action@v2
96
96
97
97
- name : Set up signing key
98
98
run : mkdir -p "$HOME/.gnupg" && echo -n "$KEY" | base64 -d > "$HOME/.gnupg/secring.gpg"
99
99
env :
100
100
KEY : ${{ secrets.JAR_SIGNING_KEY }}
101
-
101
+
102
102
# Prefer env variables here rather than inline ${{ secrets.FOO }} to
103
103
# decrease the likelihood that secrets end up printed to stdout.
104
104
- name : Set up secret gradle properties
@@ -116,27 +116,27 @@ jobs:
116
116
KEY_ID : ${{ secrets.JAR_SIGNING_KEY_ID }}
117
117
RH_USER : ${{ secrets.RH_USER }}
118
118
RH_PASSWORD : ${{ secrets.RH_PASSWORD }}
119
-
119
+
120
120
- name : Publish
121
121
run : ./gradlew publishToSonatype
122
-
122
+
123
123
build_native_images :
124
124
name : Build native test server
125
125
needs : create_draft_release
126
126
if : github.event.inputs.do_build_native_images == 'true'
127
127
strategy :
128
128
matrix :
129
129
include :
130
- - dist : ubuntu-latest
130
+ - runner : buildjet-2vcpu- ubuntu-1804
131
131
os_family : linux
132
132
arch : amd64
133
- - dist : macos-latest
133
+ - runner : macos-latest
134
134
os_family : macOS
135
135
arch : amd64
136
- - dist : windows-2019
136
+ - runner : windows-2019
137
137
os_family : windows
138
138
arch : amd64
139
- runs-on : ${{ matrix.dist }}
139
+ runs-on : ${{ matrix.runner }}
140
140
steps :
141
141
- name : Checkout repo
142
142
uses : actions/checkout@v3
@@ -147,19 +147,19 @@ jobs:
147
147
# gets pushed
148
148
- name : Temporary tag
149
149
run : git tag "$INPUT_TAG"
150
-
150
+
151
151
- name : Set up Java
152
152
uses : actions/setup-java@v3
153
153
with :
154
- java-version : ' 11 '
155
- distribution : ' temurin'
156
-
154
+ java-version : " 11 "
155
+ distribution : " temurin"
156
+
157
157
- name : Set up Gradle
158
158
uses : gradle/gradle-build-action@v2
159
-
159
+
160
160
- name : Build native test server
161
161
run : ./gradlew :temporal-test-server:build
162
-
162
+
163
163
# path ends in a wildcard because on windows the file ends in '.exe'
164
164
# path excludes *.txt because native-image also writes a build manifest txt file
165
165
- name : Upload executable to workflow
@@ -171,7 +171,7 @@ jobs:
171
171
!temporal-test-server/build/graal/*.txt
172
172
if-no-files-found : error
173
173
retention-days : 1
174
-
174
+
175
175
attach_to_release :
176
176
name : Attach native executables to release
177
177
needs : build_native_images
@@ -183,21 +183,21 @@ jobs:
183
183
# when no artifact is specified, all artifacts are downloaded and expanded into CWD
184
184
- name : Fetch executables
185
185
uses : actions/download-artifact@v3
186
-
186
+
187
187
# example: linux_amd64/ -> temporal-test-server_1.2.3_linux_amd64
188
- # the name of the directory created becomes the basename of the archive (*.tar.gz or *.zip) and
188
+ # the name of the directory created becomes the basename of the archive (*.tar.gz or *.zip) and
189
189
# the root directory of the contents of the archive.
190
190
- name : Rename dirs
191
191
run : |
192
192
version="$(sed 's/^v//'<<<"$INPUT_TAG")"
193
- for dir in *; do mv "$dir" "temporal-test-server_${version}_${dir}"; done
194
-
193
+ for dir in *; do mv "$dir" "temporal-test-server_${version}_${dir}"; done
194
+
195
195
- name : Tar (linux, macOS)
196
196
run : for dir in *{linux,macOS}*; do tar cvzf "${dir}.tar.gz" "$dir"; done
197
-
197
+
198
198
- name : Zip (windows)
199
199
run : for dir in *windows*; do zip -r "${dir}.zip" "$dir"; done
200
-
200
+
201
201
- name : Upload release archives
202
202
uses : actions/upload-artifact@v3
203
203
with :
@@ -210,10 +210,10 @@ jobs:
210
210
211
211
- name : Upload
212
212
run : |
213
- until gh release upload --clobber --repo $GITHUB_REPOSITORY "$INPUT_TAG" *.zip *.tar.gz; do
214
- echo "Attempt $((++attempts)) to upload release artifacts failed. Will retry in 20s"
215
- sleep 20
216
- done
213
+ until gh release upload --clobber --repo $GITHUB_REPOSITORY "$INPUT_TAG" *.zip *.tar.gz; do
214
+ echo "Attempt $((++attempts)) to upload release artifacts failed. Will retry in 20s"
215
+ sleep 20
216
+ done
217
217
timeout-minutes : 10
218
218
env :
219
219
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments