build-deb #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-deb | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-22.04 | |
| - ubuntu-24.04 | |
| varnish: | |
| - varnish77 | |
| - varnish80 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Varnish from packagecloud | |
| run: | | |
| curl -s https://packagecloud.io/install/repositories/varnishcache/${{ matrix.varnish }}/script.deb.sh | sudo bash | |
| sudo apt-get update | |
| sudo apt-get install -y varnish varnish-dev | |
| - name: Install cargo-deb | |
| run: cargo install cargo-deb | |
| - name: Set Varnish version dependency | |
| run: | | |
| if [ "${{ matrix.varnish }}" = "varnish77" ]; then | |
| echo "VARNISH_DEB_DEPENDS=varnish (>= 7.7.0)" >> $GITHUB_ENV | |
| elif [ "${{ matrix.varnish }}" = "varnish80" ]; then | |
| echo "VARNISH_DEB_DEPENDS=varnish (>= 8.0.0)" >> $GITHUB_ENV | |
| else | |
| echo "Error: Unknown varnish version ${{ matrix.varnish }}" | |
| exit 1 | |
| fi | |
| - name: Build Debian package | |
| run: | | |
| if [ -z "$VARNISH_DEB_DEPENDS" ]; then | |
| echo "Error: VARNISH_DEB_DEPENDS not set" | |
| exit 1 | |
| fi | |
| cargo deb | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vmod-lambda-${{ matrix.os }}-${{ matrix.varnish }}.deb | |
| path: target/debian/*.deb |