Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .github/packages/debian-wolfssl.tar.gz
Binary file not shown.
47 changes: 42 additions & 5 deletions .github/workflows/debian-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
branches: [ '*' ]

env:
WOLFSSL_VERSION: master # Can be changed to specific tag like v5.6.4

jobs:
libwolfprov-standalone:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -57,16 +60,50 @@ jobs:
# List all tags
git tag -l

# Cache wolfSSL to speed up builds:
# - Git repository cache: Avoids re-cloning wolfSSL repo
# - Complete build cache: Includes source, built packages, and artifacts
# Cache keys include script hash to invalidate when install script changes
- name: Cache wolfSSL git repository
uses: actions/cache@v4
with:
path: /tmp/wolfssl-pkg/wolfssl/.git
key: wolfssl-git-${{ env.WOLFSSL_VERSION }}-${{ hashFiles('wolfProvider/debian/install-wolfssl.sh') }}-${{ github.sha }}
restore-keys: |
wolfssl-git-${{ env.WOLFSSL_VERSION }}-${{ hashFiles('wolfProvider/debian/install-wolfssl.sh') }}-
wolfssl-git-${{ env.WOLFSSL_VERSION }}-

- name: Cache wolfSSL source and build
uses: actions/cache@v4
with:
path: |
/tmp/wolfssl-pkg/wolfssl
/tmp/wolfssl-pkg/*.deb
/tmp/wolfssl-pkg/*.dsc
/tmp/wolfssl-pkg/*.tar.gz
key: wolfssl-complete-${{ env.WOLFSSL_VERSION }}-${{ hashFiles('wolfProvider/debian/install-wolfssl.sh') }}-${{ github.sha }}
restore-keys: |
wolfssl-complete-${{ env.WOLFSSL_VERSION }}-${{ hashFiles('wolfProvider/debian/install-wolfssl.sh') }}-

- name: Install wolfssl debian package
run: |
mkdir -p "/tmp/wolfssl-pkg"
cd "/tmp/wolfssl-pkg"

# Install wolfssl packages
chmod +x $GITHUB_WORKSPACE/debian/install-wolfssl.sh
$GITHUB_WORKSPACE/debian/install-wolfssl.sh \
$GITHUB_WORKSPACE/.github/packages/debian-wolfssl.tar.gz \
"/tmp/wolfssl-pkg"
# Check if cached packages exist
if ls *.deb 1> /dev/null 2>&1; then
echo "Found cached wolfSSL packages, installing them..."
dpkg -i *.deb || apt-get install -f -y
else
echo "No cached packages found, building from source..."
# Install wolfssl packages with specified version
chmod +x $GITHUB_WORKSPACE/debian/install-wolfssl.sh
if [ "$WOLFSSL_VERSION" != "master" ]; then
$GITHUB_WORKSPACE/debian/install-wolfssl.sh --tag "$WOLFSSL_VERSION" "/tmp/wolfssl-pkg"
else
$GITHUB_WORKSPACE/debian/install-wolfssl.sh "/tmp/wolfssl-pkg"
fi
fi

# Create wolfprov-packages directory and move wolfssl files there
mkdir -p "/tmp/wolfprov-packages"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/libwebsockets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
run: |
mkdir build
cd build
cmake ..
cmake .. -DCMAKE_POLICY_VERSION_MINIMUM=3.5
make -j$(nproc)
sudo make install

Expand Down
26 changes: 24 additions & 2 deletions README-packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,32 @@ To use a build from CI for local install, download the artifacts from the Debian

## Install

If not already done, install the WolfSSL Debian package. The non-FIPS version is available in this repo and is installed by the script below. This step is only needed once, and can be done prior to the `build-wolfprovider.sh` step above.
If not already done, install the WolfSSL Debian package. The script below will clone the wolfSSL repository and build packages from source. This step is only needed once, and can be done prior to the `build-wolfprovider.sh` step above.

Basic usage (builds master branch in temporary directory):
```
./debian/install-wolfssl.sh
```

Build master branch in specific directory:
```
./debian/install-wolfssl.sh /path/to/working/directory
```
./debian/install-wolfssl.sh ./.github/packages/debian-wolfssl.tar.gz

Build specific tag or branch:
```
./debian/install-wolfssl.sh --tag v5.6.4
./debian/install-wolfssl.sh --tag v5.6.4 /path/to/working/directory
```

Build with debug mode enabled:
```
./debian/install-wolfssl.sh --debug
./debian/install-wolfssl.sh --debug --tag v5.6.4
./debian/install-wolfssl.sh --debug --tag v5.6.4 /path/to/working/directory
```

The script will automatically detect if wolfSSL is already cloned in the working directory and reuse it. For older tags that don't include debian packaging files, the script will automatically backport the packaging from master.

For the script above, some systems may require additional packages:
```
Expand Down
Loading
Loading