@@ -29,3 +29,223 @@ jobs:
29
29
cache-key : rust-test
30
30
os : ${{ matrix.os }}
31
31
run : bazel test --test_env=RUST_BACKTRACE=1 --flaky_test_attempts=3 //rust/...
32
+
33
+ windows-stable :
34
+ name : " Windows Stable"
35
+ runs-on : windows-latest
36
+ needs : tests
37
+ if : github.event_name != 'schedule'
38
+ env :
39
+ RUSTFLAGS : ' -Ctarget-feature=+crt-static'
40
+ steps :
41
+ - name : " Checkout project"
42
+ uses : actions/checkout@v4
43
+ - name : " Update Rust"
44
+ run : |
45
+ rustup update
46
+ rustup toolchain install stable-i686-pc-windows-msvc
47
+ rustup default stable-i686-pc-windows-msvc
48
+ rustc -vV
49
+ - name : " Build release binary"
50
+ run : cargo build --release
51
+ working-directory : rust
52
+ - name : " Rename binary"
53
+ run : mv rust/target/release/selenium-manager.exe selenium-manager-windows.exe
54
+ - name : " Upload release binary"
55
+ uses : actions/upload-artifact@v3
56
+ with :
57
+ name : selenium-manager-windows
58
+ path : selenium-manager-windows.exe
59
+ retention-days : 6
60
+
61
+ windows-debug :
62
+ name : " Windows Debug"
63
+ runs-on : windows-latest
64
+ needs : tests
65
+ if : github.event_name != 'schedule'
66
+ env :
67
+ RUSTFLAGS : ' -Ctarget-feature=+crt-static'
68
+ steps :
69
+ - name : " Checkout project"
70
+ uses : actions/checkout@v4
71
+ - name : " Update Rust"
72
+ run : |
73
+ rustup update
74
+ rustup toolchain install stable-i686-pc-windows-msvc
75
+ rustup default stable-i686-pc-windows-msvc
76
+ rustc -vV
77
+ - name : " Build release binary"
78
+ run : cargo build --profile dev
79
+ working-directory : rust
80
+ - name : " Rename binary"
81
+ run : mv rust/target/debug/selenium-manager.exe selenium-manager-windows-debug.exe
82
+ - name : " Upload release binary"
83
+ uses : actions/upload-artifact@v3
84
+ with :
85
+ name : selenium-manager-windows-debug
86
+ path : selenium-manager-windows-debug.exe
87
+ retention-days : 6
88
+
89
+ linux-stable :
90
+ name : " Linux Stable"
91
+ runs-on : ubuntu-latest
92
+ needs : tests
93
+ if : github.event_name != 'schedule'
94
+ steps :
95
+ - name : " Checkout project"
96
+ uses : actions/checkout@v4
97
+ - name : " Update Rust"
98
+ run : |
99
+ rustup update
100
+ rustc -vV
101
+ - name : " Install cross"
102
+ run : |
103
+ cargo install cross --git https://github.com/cross-rs/cross
104
+ cross -V
105
+ - name : " Build release binary"
106
+ run : cross build --target x86_64-unknown-linux-musl --release
107
+ working-directory : rust
108
+ - name : " Rename binary"
109
+ run : mv rust/target/x86_64-unknown-linux-musl/release/selenium-manager selenium-manager-linux
110
+ - name : " Upload release binary"
111
+ uses : actions/upload-artifact@v3
112
+ with :
113
+ name : selenium-manager-linux
114
+ path : selenium-manager-linux
115
+ retention-days : 6
116
+
117
+ linux-debug :
118
+ name : " Linux Debug"
119
+ runs-on : ubuntu-latest
120
+ needs : tests
121
+ if : github.event_name != 'schedule'
122
+ steps :
123
+ - name : " Checkout project"
124
+ uses : actions/checkout@v4
125
+ - name : " Update Rust"
126
+ run : |
127
+ rustup update
128
+ rustc -vV
129
+ - name : " Install cross"
130
+ run : |
131
+ cargo install cross --git https://github.com/cross-rs/cross
132
+ cross -V
133
+ - name : " Build release binary"
134
+ run : |
135
+ cross build --target x86_64-unknown-linux-musl --profile dev
136
+ cd target/x86_64-unknown-linux-musl/debug
137
+ tar -cvf ../../../../selenium-manager-linux-debug.tar selenium-manager
138
+ working-directory : rust
139
+ - name : " Upload release binary"
140
+ uses : actions/upload-artifact@v3
141
+ with :
142
+ name : selenium-manager-linux-debug
143
+ path : selenium-manager-linux-debug.tar
144
+ retention-days : 6
145
+
146
+ macos-stable :
147
+ name : " MacOS Stable"
148
+ runs-on : macos-latest
149
+ needs : tests
150
+ if : github.event_name != 'schedule'
151
+ env :
152
+ RUSTFLAGS : ' -Ctarget-feature=+crt-static'
153
+ steps :
154
+ - name : " Checkout project"
155
+ uses : actions/checkout@v4
156
+ - name : " Update Rust"
157
+ run : |
158
+ rustup update
159
+ rustup target add aarch64-apple-darwin
160
+ rustc -vV
161
+ - name : " Build release binary"
162
+ run : |
163
+ cargo build --target x86_64-apple-darwin --release
164
+ cargo build --target aarch64-apple-darwin --release
165
+ lipo -create -output target/selenium-manager-macos \
166
+ target/aarch64-apple-darwin/release/selenium-manager \
167
+ target/x86_64-apple-darwin/release/selenium-manager
168
+ working-directory : rust
169
+ - name : " Upload release binary"
170
+ uses : actions/upload-artifact@v3
171
+ with :
172
+ name : selenium-manager-macos
173
+ path : rust/target/selenium-manager-macos
174
+ retention-days : 6
175
+
176
+ macos-debug :
177
+ name : " MacOS Debug"
178
+ runs-on : macos-latest
179
+ needs : tests
180
+ if : github.event_name != 'schedule'
181
+ env :
182
+ RUSTFLAGS : ' -Ctarget-feature=+crt-static'
183
+ steps :
184
+ - name : " Checkout project"
185
+ uses : actions/checkout@v4
186
+ - name : " Update Rust"
187
+ run : |
188
+ rustup update
189
+ rustup target add aarch64-apple-darwin
190
+ rustc -vV
191
+ - name : " Build release binary"
192
+ run : |
193
+ cargo build --target x86_64-apple-darwin --profile dev
194
+ cargo build --target aarch64-apple-darwin --profile dev
195
+ lipo -create -output target/selenium-manager \
196
+ target/aarch64-apple-darwin/debug/selenium-manager \
197
+ target/x86_64-apple-darwin/debug/selenium-manager
198
+ cd target
199
+ tar -cvf ../../selenium-manager-macos-debug.tar selenium-manager
200
+ working-directory : rust
201
+ - name : " Upload release binary"
202
+ uses : actions/upload-artifact@v3
203
+ with :
204
+ name : selenium-manager-macos-debug
205
+ path : selenium-manager-macos-debug.tar
206
+ retention-days : 6
207
+
208
+ release :
209
+ name : " Release Binaries"
210
+ runs-on : ubuntu-latest
211
+ needs : [macos-stable, linux-stable, windows-stable, macos-debug, linux-debug, windows-debug]
212
+ if : github.event_name != 'schedule'
213
+ steps :
214
+ - name : " Checkout selenium_manager_artifacts"
215
+ uses : actions/checkout@v4
216
+ with :
217
+ token : ${{ secrets.SELENIUM_CI_TOKEN }}
218
+ repository : SeleniumHQ/selenium_manager_artifacts
219
+ - name : " Download Artifacts"
220
+ uses : actions/download-artifact@v2
221
+ with :
222
+ path : artifacts
223
+ - name : " Prepare and Commit"
224
+ run : |
225
+ linux_sha=$(shasum -a 256 artifacts/selenium-manager-linux/selenium-manager-linux | awk '{print $1}')
226
+ macos_sha=$(shasum -a 256 artifacts/selenium-manager-macos/selenium-manager-macos | awk '{print $1}')
227
+ windows_sha=$(shasum -a 256 artifacts/selenium-manager-windows/selenium-manager-windows.exe | awk '{print $1}')
228
+ echo "{\"macos\": \"$macos_sha\", \"windows\": \"$windows_sha\", \"linux\": \"$linux_sha\"}" > latest.json
229
+ git config --local user.email "[email protected] "
230
+ git config --local user.name "Selenium CI Bot"
231
+ git add latest.json
232
+ git commit -m "Update hash values for latest binaries"
233
+ short_hash=$(git rev-parse --short HEAD)
234
+ echo "TAG_NAME=selenium-manager-$short_hash" >> $GITHUB_ENV
235
+ git tag ${{ env.TAG_NAME }}
236
+ git push && git push --tags
237
+ - name : " Release"
238
+ uses : softprops/action-gh-release@v1
239
+ with :
240
+ token : ${{ secrets.SELENIUM_CI_TOKEN }}
241
+ repository : SeleniumHQ/selenium_manager_artifacts
242
+ tag_name : ${{ env.TAG_NAME }}
243
+ draft : false
244
+ prerelease : false
245
+ files : |
246
+ artifacts/selenium-manager-linux/selenium-manager-linux
247
+ artifacts/selenium-manager-macos/selenium-manager-macos
248
+ artifacts/selenium-manager-windows/selenium-manager-windows.exe
249
+ artifacts/selenium-manager-linux-debug/selenium-manager-linux-debug.tar
250
+ artifacts/selenium-manager-macos-debug/selenium-manager-macos-debug.tar
251
+ artifacts/selenium-manager-windows-debug/selenium-manager-windows-debug.exe
0 commit comments