-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from DefGuard/cross-platform-builds
feat: build target freebsd
- Loading branch information
Showing
2 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |