55 branches : [ master ]
66 pull_request :
77 branches : [ '*' ]
8- workflow_dispatch :
98
109jobs :
11- test-debian-package :
12- runs-on : ubuntu-latest
13-
10+ bookworm :
11+ runs-on : ubuntu-22.04
12+ # Important: use Debian Bookworm for compatibility
13+ container :
14+ image : debian:bookworm # or debian:bookworm-slim
15+ env :
16+ DEBIAN_FRONTEND : noninteractive
1417 steps :
15- - name : Checkout wolfProvider
16- uses : actions/checkout@v4
17- with :
18- fetch-depth : 1
19- - run : |
20- # Fetch tags
21- git fetch --tags
22- # List all tags
23- git tag -l
24-
2518 - name : Set up environment
2619 run : |
2720 # Update package lists
28- sudo apt-get update
21+ apt-get update
2922 # Install build dependencies
30- sudo apt-get install -y \
23+ apt-get install -y \
3124 build-essential \
3225 devscripts \
3326 debhelper \
@@ -44,27 +37,56 @@ jobs:
4437 fakeroot \
4538 equivs
4639 # Install additional tools for testing
47- sudo apt-get install -y \
40+ apt-get install -y \
4841 expect \
4942 xxd
5043
51- # TODO: this step rebuilds the package for the current architecture
52- # we may be able to remove it if we can ensure the package supports
53- # the architecture of the runner (most likely amd64)
54- - name : Install custom wolfssl
44+ # Avoid "detected dubious ownership" warning
45+ - name : Ensure the working directory safe
46+ run : |
47+ git config --global --add safe.directory "$GITHUB_WORKSPACE"
48+
49+ - name : Checkout wolfProvider
50+ uses : actions/checkout@v4
51+ with :
52+ fetch-depth : 1
53+ - run : |
54+ # Fetch tags
55+ git fetch --tags
56+ # List all tags
57+ git tag -l
58+
59+ - name : Install wolfssl debian package
5560 run : |
5661 mkdir -p "$RUNNER_TEMP/wolfssl-pkg"
5762 cd "$RUNNER_TEMP/wolfssl-pkg"
58- unzip $GITHUB_WORKSPACE/.github/packages/debian-packages-20250731T171211Z-1-001.zip
63+
64+ echo "Using standard wolfSSL package"
65+ tar -xvf $GITHUB_WORKSPACE/.github/packages/debian-wolfssl.tar.gz
66+
67+ # Get current architecture
68+ CURRENT_ARCH=$(dpkg --print-architecture)
69+ echo "Current architecture: $CURRENT_ARCH"
70+
71+ # Look for existing .deb files that match the current architecture
5972 cd debian-packages
60- sudo dpkg-source -x wolfssl_5.8.2-1.dsc
61- cd wolfssl-5.8.2
62- sudo dpkg-buildpackage -b -us -uc
63- sudo dpkg -i ../libwolfssl*.deb
73+ MATCHING_DEB_FILES=$(find . -name "*_${CURRENT_ARCH}.deb" -o -name "*_${CURRENT_ARCH}_*.deb" 2>/dev/null || true)
74+
75+ if [ -n "$MATCHING_DEB_FILES" ]; then
76+ echo "Found matching .deb files for architecture $CURRENT_ARCH:"
77+ echo "$MATCHING_DEB_FILES"
78+ echo "Installing existing .deb files..."
79+ dpkg -i $MATCHING_DEB_FILES
80+ else
81+ echo "No matching .deb files found for architecture $CURRENT_ARCH, rebuilding from source..."
82+ dpkg-source -x wolfssl*.dsc
83+ cd wolfssl*/
84+ dpkg-buildpackage -b -us -uc
85+ dpkg -i ../libwolfssl*.deb
86+ fi
6487
6588 - name : Build Debian package
6689 run : |
67- # Run the build script
6890 # Bypass the warning prompt with 'yes Y'
6991 yes Y | ./scripts/build-wolfprovider.sh --debian
7092
83105 fi
84106
85107 echo "Installing package: $PACKAGE_FILE and dependencies"
86- sudo apt install -y ./"$PACKAGE_FILE"
108+ apt install -y ./"$PACKAGE_FILE"
87109
88110 # Verify installation
89111 echo "Package Installation Verification:"
99121 echo "3. Temporarily disabling wolfprovider for default provider tests:"
100122 mkdir -p /tmp/openssl-test
101123 if [ -f $PROVIDER_CONF ]; then
102- sudo mv $PROVIDER_CONF $PROVIDER_CONF_BACKUP
124+ mv $PROVIDER_CONF $PROVIDER_CONF_BACKUP
103125 echo " - Moved $PROVIDER_CONF to $PROVIDER_CONF_BACKUP"
104126 else
105127 echo "$PROVIDER_CONF not found!"
@@ -113,7 +135,7 @@ jobs:
113135 # Restore wolfprovider configuration
114136 echo "5. Restoring wolfprovider configuration:"
115137 if [ -f $PROVIDER_CONF_BACKUP ]; then
116- sudo mv $PROVIDER_CONF_BACKUP $PROVIDER_CONF
138+ mv $PROVIDER_CONF_BACKUP $PROVIDER_CONF
117139 echo " - Restored $PROVIDER_CONF from $PROVIDER_CONF_BACKUP"
118140 fi
119141
@@ -122,7 +144,7 @@ jobs:
122144 - name : Uninstall package and verify cleanup
123145 run : |
124146 # Uninstall the package
125- sudo apt-get remove --purge -y libwolfprov
147+ apt-get remove --purge -y libwolfprov
126148
127149 # Verify the package is removed
128150 if dpkg -l | grep -q libwolfprov; then
@@ -182,9 +204,9 @@ jobs:
182204 if : always()
183205 uses : actions/upload-artifact@v4
184206 with :
185- name : debian-packages
207+ name : wolfprovider- debian-packages
186208 path : |
187209 ${{ runner.temp }}/*.deb
188210 ${{ runner.temp }}/*.dsc
189211 ${{ runner.temp }}/*.tar.gz
190- retention-days : 7
212+ retention-days : 7
0 commit comments