Skip to content

Commit 00d2fa7

Browse files
Package the Windows runtime with 7-Zip, and build runtimes in PR CI
The v5.0 release built no Windows distribution: dist/archive.sh calls zip, which Git Bash on the windows-latest runners does not have, so the job failed with "zip: command not found" before verifying anything. Fall back to 7z, which the runners do have. That leg had never passed, and nothing before a tag could show it, because only release.yml builds the runtimes -- and a tag also publishes to Maven Central. CI now builds and verifies the Linux and Windows runtimes on every pull request.
1 parent 70287b7 commit 00d2fa7

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,35 @@ jobs:
8787
uses: actions/upload-artifact@v7
8888
with:
8989
name: tunnel-jar
90-
path: target/TestingBotTunnel-*.jar
90+
path: target/TestingBotTunnel-*.jar
91+
# The self-contained distributions are otherwise only built by release.yml, on a
92+
# tag -- after Maven Central has already published. The Windows leg had never
93+
# passed there: dist/archive.sh called `zip`, which Git Bash on the runners lacks,
94+
# and nothing before the 5.0 tag could have said so. Linux and Windows cover the
95+
# two launchers and both archive formats; macOS adds signing, which needs secrets
96+
# a pull request does not get.
97+
runtime:
98+
needs: test
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
os: [ubuntu-latest, windows-latest]
103+
runs-on: ${{ matrix.os }}
104+
steps:
105+
- name: Checkout code
106+
uses: actions/checkout@v7.0.1
107+
- name: Set up JDK 17
108+
uses: actions/setup-java@v6.0.1
109+
with:
110+
java-version: 17
111+
distribution: 'temurin'
112+
cache: 'maven'
113+
- name: Build JAR
114+
shell: bash
115+
run: mvn -B -DskipTests package
116+
- name: Build self-contained runtime
117+
shell: bash
118+
run: dist/build-runtime.sh
119+
- name: Verify runtime
120+
shell: bash
121+
run: dist/verify-runtime.sh "$(ls -d dist/testingbot-tunnel-*/ | head -1)"

‎dist/archive.sh‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@ checksum() {
4040
case "$NAME" in
4141
*windows*)
4242
rm -f "$NAME.zip"
43-
zip -qr "$NAME.zip" "$NAME"
43+
# Git Bash on the Windows runners has no zip; 7-Zip is preinstalled there instead.
44+
if command -v zip >/dev/null 2>&1; then
45+
zip -qr "$NAME.zip" "$NAME"
46+
elif command -v 7z >/dev/null 2>&1; then
47+
7z a -tzip -bso0 -bsp0 "$NAME.zip" "$NAME"
48+
else
49+
echo " !! neither zip nor 7z found; dist/$NAME.zip not written" >&2
50+
exit 1
51+
fi
4452
echo " -> dist/$NAME.zip"
4553
checksum "$NAME.zip"
4654
;;

0 commit comments

Comments
 (0)