11
11
- ' !**'
12
12
tags :
13
13
# To include pre-releases: 'v0.1.[0-9]+-?*'
14
- - ' v0.[0-9]+.[0-9]+'
14
+ - ' trigger- v0.[0-9]+.[0-9]+'
15
15
16
16
env :
17
- # Note: used for test and clippy, not for publish. Test features are different from other CIs.
18
- CLIPPY_TEST_FEATURES : " --features godot/experimental-godot-api,godot/codegen-rustfmt,godot/serde"
19
-
20
17
# Crates to publish -- important, this doesn't work when there are spaces in any of the paths!
21
18
# Keep in sync with update-version.sh
22
19
GDEXT_CRATES : >
28
25
godot-core
29
26
godot
30
27
28
+ # Used for integration test artifact, must be without patch version.
29
+ GODOT_ARTIFACT_VERSION : " 4.4"
30
+
31
+ # Note: used for test and clippy, not for publish. Test features are different from other CIs.
32
+ CLIPPY_TEST_FEATURES : " --features godot/experimental-godot-api,godot/codegen-rustfmt,godot/serde"
33
+
34
+ CLIPPY_ARGS : >-
35
+ -D clippy::suspicious
36
+ -D clippy::style
37
+ -D clippy::complexity
38
+ -D clippy::perf
39
+ -D clippy::dbg_macro
40
+ -D clippy::todo
41
+ -D clippy::unimplemented
42
+ -D warnings
43
+
31
44
defaults :
32
45
run :
33
46
shell : bash
36
49
validation :
37
50
runs-on : ubuntu-latest
38
51
outputs :
39
- GDEXT_PUBLISHED_VERSION : ${{ steps.parse-crate-version.outputs.GDEXT_PUBLISHED_VERSION }}
52
+ PUBLISHED_CRATE_VERSION : ${{ steps.parse-crate-version.outputs.PUBLISHED_CRATE_VERSION }}
40
53
steps :
41
54
- uses : actions/checkout@v4
42
55
@@ -56,92 +69,55 @@ jobs:
56
69
# exit 2
57
70
# fi
58
71
#
59
- # echo "GDEXT_PUBLISHED_VERSION =$crateVer" >> $GITHUB_OUTPUT
72
+ # echo "PUBLISHED_CRATE_VERSION =$crateVer" >> $GITHUB_OUTPUT
60
73
# echo "Validated version: $crateVer"
61
74
62
75
- name : " Parse crate version from tag"
63
76
id : parse-crate-version
64
77
run : |
65
- crateVer=$(echo "$GITHUB_REF" | sed -n "s#refs/tags/v\(.*\)#\1#p")
78
+ crateVer=$(echo "$GITHUB_REF" | sed -n "s#refs/tags/trigger- v\(.*\)#\1#p")
66
79
if [[ -z "$crateVer" ]]; then
67
80
printf "\n::error::Failed to parse GitHub ref '$GITHUB_REF'.\n"
68
81
exit 2
69
82
fi
70
-
71
- echo "GDEXT_PUBLISHED_VERSION =$crateVer" >> $GITHUB_OUTPUT
83
+
84
+ echo "PUBLISHED_CRATE_VERSION =$crateVer" >> $GITHUB_OUTPUT
72
85
echo "Validated version: $crateVer"
73
86
74
- - name : " Verify that Cargo.toml versions match ${{ steps.parse-crate-version.outputs.GDEXT_PUBLISHED_VERSION }}"
87
+ - name : " Verify that Cargo.toml versions match ${{ steps.parse-crate-version.outputs.PUBLISHED_CRATE_VERSION }}"
75
88
run : |
76
89
echo "Checking crate versions..."
77
- publishedVersion="${{ steps.parse-crate-version.outputs.GDEXT_PUBLISHED_VERSION }}"
78
-
90
+ publishedVersion="${{ steps.parse-crate-version.outputs.PUBLISHED_CRATE_VERSION }}"
91
+
79
92
# Check if each Cargo.toml has that version
80
93
IFS=' ' read -r -a publishedCrates <<< "$GDEXT_CRATES"
81
94
for crate in "${publishedCrates[@]}"; do
82
95
readVersion=$(grep -Po '^version = "\K[^"]*' "$crate/Cargo.toml")
83
96
printf "* $crate -> $readVersion"
84
-
97
+
85
98
if [[ "$readVersion" != "$publishedVersion" ]]; then
86
99
printf " ERROR\n"
87
100
versionMismatch="1"
88
101
else
89
102
printf "\n"
90
103
fi
91
104
done
92
-
105
+
93
106
if [[ -n "$versionMismatch" ]]; then
94
107
printf "\n::error::At least one crate has a version mismatching the git tag.\n"
95
108
exit 2
96
109
else
97
110
printf "\nAll versions OK.\n"
98
111
fi
99
112
100
- # Keep all in sync with minimal-ci and full-ci.
101
- unit-test :
102
- runs-on : ubuntu-latest
103
- needs : validation
104
- steps :
105
- - uses : actions/checkout@v4
106
- with :
107
- ref : ' v${{ needs.validation.outputs.GDEXT_PUBLISHED_VERSION }}'
108
-
109
- - name : " Install Rust (uncached)"
110
- run : rustup update stable
111
-
112
- - name : " Compile and run test"
113
- run : cargo test $CLIPPY_TEST_FEATURES
114
-
115
- clippy :
116
- runs-on : ubuntu-latest
117
- needs : validation
118
- steps :
119
- - uses : actions/checkout@v4
120
- with :
121
- ref : ' v${{ needs.validation.outputs.GDEXT_PUBLISHED_VERSION }}'
122
-
123
- - name : " Install Rust (uncached)"
124
- run : rustup update stable
125
-
126
- - name : " Check clippy"
127
- run : |
128
- cargo clippy --all-targets $CLIPPY_TEST_FEATURES -- \
129
- -D clippy::suspicious \
130
- -D clippy::style \
131
- -D clippy::complexity \
132
- -D clippy::perf \
133
- -D clippy::dbg_macro \
134
- -D clippy::todo \
135
- -D clippy::unimplemented \
136
- -D warnings
137
113
138
114
rustfmt :
139
115
runs-on : ubuntu-latest
140
116
needs : validation
141
117
steps :
142
118
- uses : actions/checkout@v4
143
119
with :
144
- ref : ' v ${{ needs.validation.outputs.GDEXT_PUBLISHED_VERSION }}'
120
+ ref : ${{ github.ref }}
145
121
146
122
- name : " Install Rust (uncached)"
147
123
run : rustup update stable
@@ -161,25 +137,41 @@ jobs:
161
137
exit 1
162
138
}
163
139
140
+
141
+ clippy :
142
+ runs-on : ubuntu-latest
143
+ needs : validation
144
+ steps :
145
+ - uses : actions/checkout@v4
146
+ with :
147
+ ref : ${{ github.ref }}
148
+
149
+ - name : " Install Rust (uncached)"
150
+ run : rustup update stable
151
+
152
+ - name : " Check clippy"
153
+ run : |
154
+ cargo clippy --all-targets $CLIPPY_TEST_FEATURES -- $CLIPPY_ARGS
155
+
156
+
164
157
docs-and-commit :
165
158
runs-on : ubuntu-latest
166
159
needs :
167
160
- validation
168
- - unit-test
169
- - clippy
170
161
- rustfmt
162
+ - clippy
171
163
env :
172
- GDEXT_PUBLISHED_VERSION : ${{ needs.validation.outputs.GDEXT_PUBLISHED_VERSION }}
164
+ PUBLISHED_CRATE_VERSION : ${{ needs.validation.outputs.PUBLISHED_CRATE_VERSION }}
173
165
steps :
174
166
- uses : actions/checkout@v4
175
167
with :
176
- ref : ' v${{ needs.validation.outputs.GDEXT_PUBLISHED_VERSION }}'
168
+ ref : ' trigger- v${{ needs.validation.outputs.PUBLISHED_CRATE_VERSION }}'
177
169
178
170
- name : " Install Rust (uncached)"
179
171
run : rustup update stable
180
172
181
173
# - name: "Tag base commit"
182
- # run: git tag "v$GDEXT_PUBLISHED_VERSION "
174
+ # run: git tag "v$PUBLISHED_CRATE_VERSION "
183
175
184
176
# - name: "Commit raw changes"
185
177
# # Note: first block was for an alternative approach, where a separate `releases` branch tracks deployments.
@@ -194,7 +186,7 @@ jobs:
194
186
# rsync -av --ignore-existing /tmp/repo/ .
195
187
#
196
188
# git add .
197
- # git commit -m "Repo state for v${{ env.GDEXT_PUBLISHED_VERSION }}"
189
+ # git commit -m "Repo state for v${{ env.PUBLISHED_CRATE_VERSION }}"
198
190
199
191
- name : " Apply #[doc(cfg(...))]"
200
192
# Skip --rustfmt, as it causes weird reformatting of quote! {} statements.
@@ -206,27 +198,69 @@ jobs:
206
198
git config user.name "Godot-Rust Automation"
207
199
git config user.email "GodotRust@users.noreply.github.com"
208
200
git switch -c tmp
209
- git commit -am "v${{ env.GDEXT_PUBLISHED_VERSION }} (with doc attributes)"
201
+ git commit -am "v${{ env.PUBLISHED_CRATE_VERSION }} (with doc attributes)"
210
202
211
- - name : " Tag processed commit + push"
203
+ - name : " Tag post- processed library, commit + push, remove trigger tag "
212
204
run : |
213
- docTag="docs-v$GDEXT_PUBLISHED_VERSION "
205
+ docTag="v$PUBLISHED_CRATE_VERSION "
214
206
git tag "$docTag"
215
207
git push origin "$docTag"
208
+ git push origin --delete "trigger-v$PUBLISHED_CRATE_VERSION"
209
+
210
+
211
+ # Keep all in sync with minimal-ci and full-ci.
212
+ unit-test :
213
+ runs-on : ubuntu-latest
214
+ needs :
215
+ - validation # for outputs
216
+ - docs-and-commit
217
+ steps :
218
+ - uses : actions/checkout@v4
219
+ with :
220
+ ref : ' v${{ needs.validation.outputs.PUBLISHED_CRATE_VERSION }}'
221
+
222
+ - name : " Install Rust (uncached)"
223
+ run : rustup update stable
224
+
225
+ - name : " Compile and run test"
226
+ run : cargo test $CLIPPY_TEST_FEATURES
227
+
228
+
229
+ godot-itest :
230
+ name : godot-itest
231
+ runs-on : ubuntu-latest
232
+ needs :
233
+ - validation # for outputs
234
+ - docs-and-commit
235
+ timeout-minutes : 15
236
+ steps :
237
+ - uses : actions/checkout@v4
238
+ with :
239
+ ref : ' v${{ needs.validation.outputs.PUBLISHED_CRATE_VERSION }}'
240
+
241
+ - name : " Run Godot integration test"
242
+ uses : ./.github/composite/godot-itest
243
+ with :
244
+ artifact-name : godot-linux-${{ env.GODOT_ARTIFACT_VERSION }}
245
+ godot-binary : godot.linuxbsd.editor.dev.x86_64
246
+ rust-extra-args : --features itest/codegen-full
247
+ rust-toolchain : stable
248
+
216
249
217
250
publish :
218
251
runs-on : ubuntu-latest
219
252
if : ${{ github.event.inputs.skip-release != 'y' }}
220
253
environment : ' Crates.io'
221
254
needs :
222
- - validation
223
- - docs-and-commit
255
+ - validation # for outputs
256
+ - unit-test
257
+ - godot-itest
224
258
steps :
225
259
# Note: we cannot dry-run the publishing, since crates depend on each other, and dry-run will fail if they aren't yet on crates.io.
226
260
# Sleep to leave crates.io and docs.rs some time to index the dependencies, before releasing dependents.
227
261
- uses : actions/checkout@v4
228
262
with :
229
- ref : ' v${{ needs.validation.outputs.GDEXT_PUBLISHED_VERSION }}'
263
+ ref : ' v${{ needs.validation.outputs.PUBLISHED_CRATE_VERSION }}'
230
264
231
265
- name : " Install Rust (uncached)"
232
266
run : rustup update stable
@@ -243,5 +277,5 @@ jobs:
243
277
exit 2
244
278
}
245
279
echo "Wait..."
246
- sleep 10s
280
+ sleep 5s
247
281
done
0 commit comments