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