|
| 1 | +name: Discover wolfSSL + OpenSSL versions |
| 2 | + |
| 3 | +# Reusable workflow that resolves at run time: |
| 4 | +# - latest wolfSSL v*-stable tag (from upstream wolfssl/wolfssl) |
| 5 | +# - Debian Bookworm's stock OpenSSL version (matches what the |
| 6 | +# wolfprov-patched .deb on ghcr.io was built against) |
| 7 | +# |
| 8 | +# Consumers use these outputs to populate matrix values so the |
| 9 | +# matrix labels honestly reflect what the test actually installed. |
| 10 | +# Today: latest -> v5.8.4-stable, openssl -> 3.0.20 (Bookworm stock). |
| 11 | +# When Bookworm bumps OpenSSL or wolfSSL ships a new -stable, the |
| 12 | +# resolver picks it up without a CI edit. |
| 13 | + |
| 14 | +on: |
| 15 | + workflow_call: |
| 16 | + outputs: |
| 17 | + wolfssl_ref: |
| 18 | + description: 'Plain string, e.g. v5.8.4-stable' |
| 19 | + value: ${{ jobs.discover.outputs.wolfssl_ref }} |
| 20 | + wolfssl_ref_array: |
| 21 | + description: 'JSON array for matrix use, e.g. ["v5.8.4-stable"]' |
| 22 | + value: ${{ jobs.discover.outputs.wolfssl_ref_array }} |
| 23 | + openssl_ref: |
| 24 | + description: 'Plain string, e.g. openssl-3.0.20' |
| 25 | + value: ${{ jobs.discover.outputs.openssl_ref }} |
| 26 | + openssl_ref_array: |
| 27 | + description: 'JSON array for matrix use, e.g. ["openssl-3.0.20"]' |
| 28 | + value: ${{ jobs.discover.outputs.openssl_ref_array }} |
| 29 | + |
| 30 | +jobs: |
| 31 | + discover: |
| 32 | + name: Resolve wolfSSL + OpenSSL refs |
| 33 | + runs-on: ubuntu-latest |
| 34 | + timeout-minutes: 5 |
| 35 | + outputs: |
| 36 | + wolfssl_ref: ${{ steps.resolve.outputs.wolfssl_ref }} |
| 37 | + wolfssl_ref_array: ${{ steps.resolve.outputs.wolfssl_ref_array }} |
| 38 | + openssl_ref: ${{ steps.resolve.outputs.openssl_ref }} |
| 39 | + openssl_ref_array: ${{ steps.resolve.outputs.openssl_ref_array }} |
| 40 | + steps: |
| 41 | + - name: Resolve versions |
| 42 | + id: resolve |
| 43 | + run: | |
| 44 | + set -euo pipefail |
| 45 | +
|
| 46 | + # ---- wolfSSL: highest v*-stable tag from upstream ---- |
| 47 | + WOLFSSL=$(git ls-remote --tags --refs https://github.com/wolfSSL/wolfssl.git 'v*-stable' \ |
| 48 | + | awk -F/ '{print $NF}' | sort -V | tail -n 1) |
| 49 | + if [ -z "${WOLFSSL:-}" ]; then |
| 50 | + echo "::error::Could not resolve latest wolfSSL -stable tag" |
| 51 | + exit 1 |
| 52 | + fi |
| 53 | +
|
| 54 | + # ---- OpenSSL: whatever Debian Bookworm apt-resolves to ---- |
| 55 | + # The wolfprov-patched .deb on ghcr.io is built by patching |
| 56 | + # Bookworm's stock libssl3 source, so this is the actual |
| 57 | + # OpenSSL the Debian-container workflows end up linking against. |
| 58 | + # Use docker to ask Bookworm's apt directly, then strip the |
| 59 | + # Debian revision (3.0.20-1~deb12u1 -> 3.0.20). |
| 60 | + OSSL_RAW=$(docker run --rm debian:bookworm sh -c \ |
| 61 | + 'apt-get update -qq >/dev/null 2>&1 && apt-cache madison openssl | head -1' \ |
| 62 | + | awk '{print $3}') |
| 63 | + if [ -z "${OSSL_RAW:-}" ]; then |
| 64 | + echo "::error::Could not resolve Bookworm OpenSSL version" |
| 65 | + exit 1 |
| 66 | + fi |
| 67 | + OSSL=$(echo "$OSSL_RAW" | sed 's/-.*//') |
| 68 | +
|
| 69 | + echo "wolfSSL latest -stable: $WOLFSSL" |
| 70 | + echo "Bookworm OpenSSL: openssl-$OSSL (raw: $OSSL_RAW)" |
| 71 | +
|
| 72 | + { |
| 73 | + echo "wolfssl_ref=$WOLFSSL" |
| 74 | + echo "wolfssl_ref_array=[\"$WOLFSSL\"]" |
| 75 | + echo "openssl_ref=openssl-$OSSL" |
| 76 | + echo "openssl_ref_array=[\"openssl-$OSSL\"]" |
| 77 | + } >> "$GITHUB_OUTPUT" |
0 commit comments