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" ;;