diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 981a4f10..14702984 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,7 +68,7 @@ jobs: strategy: fail-fast: false matrix: - build: [linux, linux-arm] + build: [linux, linux-arm, freebsd] include: - build: linux os: self-hosted @@ -78,6 +78,10 @@ jobs: os: self-hosted asset_name: defguard-gateway-linux-armv7 target: armv7-unknown-linux-gnueabihf + - build: freebsd + os: self-hosted + asset_name: defguard-gateway-freebsd-x86_64 + target: x86_64-unknown-freebsd steps: # Store the version, stripping any v-prefix - name: Write release version @@ -172,14 +176,14 @@ jobs: asset_content_type: application/octet-stream - name: Build freebsd package - if: matrix.build == 'linux' + if: matrix.build == 'freebsd' uses: bpicode/github-action-fpm@master with: fpm_args: "${{ matrix.asset_name }}-${{ github.ref_name }}=/usr/sbin/defguard-gateway defguard-gateway.service=/usr/lib/systemd/system/defguard-gateway.service example-config.toml=/etc/defguard/gateway.toml" fpm_opts: "--debug -t freebsd --version=${{ env.VERSION }} -p defguard-gateway_${{ env.VERSION }}_${{ matrix.target }}.txz" - name: Upload freebsd - if: matrix.build == 'linux' + if: matrix.build == 'freebsd' uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Cross.toml b/Cross.toml index 8dba9f33..523f423c 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,5 +1,17 @@ [target.x86_64-unknown-linux-gnu] -image = "ghcr.io/defguard/cross:x86_64-unknown-linux-gnu" +pre-build = ["apt-get update && apt-get install --assume-yes unzip ", +"PB_REL='https://github.com/protocolbuffers/protobuf/releases'", +"PB_VERSION='3.20.0' && curl -LO $PB_REL/download/v$PB_VERSION/protoc-$PB_VERSION-linux-x86_64.zip", +"unzip protoc-$PB_VERSION-linux-x86_64.zip bin/protoc include/google/* -d /usr"] [target.armv7-unknown-linux-gnueabihf] -image = "ghcr.io/defguard/cross:armv7-unknown-linux-gnueabihf" +pre-build = ["apt-get update && apt-get install --assume-yes unzip ", +"PB_REL='https://github.com/protocolbuffers/protobuf/releases'", +"PB_VERSION='3.20.0' && curl -LO $PB_REL/download/v$PB_VERSION/protoc-$PB_VERSION-linux-x86_64.zip", +"unzip protoc-$PB_VERSION-linux-x86_64.zip bin/protoc include/google/* -d /usr"] + +[target.x86_64-unknown-freebsd] +pre-build = ["apt-get update && apt-get install --assume-yes unzip ", +"PB_REL='https://github.com/protocolbuffers/protobuf/releases'", +"PB_VERSION='3.20.0' && curl -LO $PB_REL/download/v$PB_VERSION/protoc-$PB_VERSION-linux-x86_64.zip", +"unzip protoc-$PB_VERSION-linux-x86_64.zip bin/protoc include/google/* -d /usr"]