From 00d2fa7f3131122ef9eb373e3d7b4a234402ee02 Mon Sep 17 00:00:00 2001 From: Jochen Delabie Date: Fri, 2 Oct 2026 12:48:37 +0200 Subject: [PATCH] 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. --- .github/workflows/test.yml | 33 ++++++++++++++++++++++++++++++++- dist/archive.sh | 10 +++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 91b95b0..0f63793 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -87,4 +87,35 @@ jobs: uses: actions/upload-artifact@v7 with: name: tunnel-jar - path: target/TestingBotTunnel-*.jar \ No newline at end of file + path: target/TestingBotTunnel-*.jar + # The self-contained distributions are otherwise only built by release.yml, on a + # tag -- after Maven Central has already published. The Windows leg had never + # passed there: dist/archive.sh called `zip`, which Git Bash on the runners lacks, + # and nothing before the 5.0 tag could have said so. Linux and Windows cover the + # two launchers and both archive formats; macOS adds signing, which needs secrets + # a pull request does not get. + runtime: + needs: test + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout code + uses: actions/checkout@v7.0.1 + - name: Set up JDK 17 + uses: actions/setup-java@v6.0.1 + with: + java-version: 17 + distribution: 'temurin' + cache: 'maven' + - name: Build JAR + shell: bash + run: mvn -B -DskipTests package + - name: Build self-contained runtime + shell: bash + run: dist/build-runtime.sh + - name: Verify runtime + shell: bash + run: dist/verify-runtime.sh "$(ls -d dist/testingbot-tunnel-*/ | head -1)" diff --git a/dist/archive.sh b/dist/archive.sh index 128c285..864de8f 100755 --- a/dist/archive.sh +++ b/dist/archive.sh @@ -40,7 +40,15 @@ checksum() { case "$NAME" in *windows*) rm -f "$NAME.zip" - zip -qr "$NAME.zip" "$NAME" + # Git Bash on the Windows runners has no zip; 7-Zip is preinstalled there instead. + if command -v zip >/dev/null 2>&1; then + zip -qr "$NAME.zip" "$NAME" + elif command -v 7z >/dev/null 2>&1; then + 7z a -tzip -bso0 -bsp0 "$NAME.zip" "$NAME" + else + echo " !! neither zip nor 7z found; dist/$NAME.zip not written" >&2 + exit 1 + fi echo " -> dist/$NAME.zip" checksum "$NAME.zip" ;;