Skip to content

Commit

Permalink
Get rid of custom docker images in favor of pre-build hook
Browse files Browse the repository at this point in the history
  • Loading branch information
dzania committed Jul 28, 2023
1 parent 92c7719 commit d1b4278
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
10 changes: 8 additions & 2 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[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 ",
Expand Down

0 comments on commit d1b4278

Please sign in to comment.