2021-12-18 16:42:14 +01:00
|
|
|
name: Go
|
|
|
|
|
|
|
|
on:
|
|
|
|
- workflow_dispatch
|
|
|
|
|
|
|
|
jobs:
|
2021-12-18 19:23:59 +01:00
|
|
|
x86_64:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
name: Build for ${{ matrix.distro }} x86_64 and mipsle
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-12-18 16:42:14 +01:00
|
|
|
|
2021-12-18 19:23:59 +01:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.17
|
|
|
|
- name: Install requirements
|
|
|
|
run: |
|
|
|
|
echo "deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu focal main" | sudo tee -a /etc/apt/sources.list.d/99fd.io.list > /dev/null
|
|
|
|
curl -L https://packagecloud.io/fdio/release/gpgkey | sudo apt-key add -
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get install -y vpp vpp-plugin-core python3-vpp-api vpp-dbg vpp-dev libmemif libmemif-dev
|
|
|
|
sudo apt-get install -y wireguard-tools upx-ucl
|
|
|
|
|
|
|
|
- name: Build x86_64
|
|
|
|
run: |
|
|
|
|
make all static vpp
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: etherguard-x86_64
|
|
|
|
path: etherguard-go*
|
|
|
|
|
|
|
|
- name: Build mipsle
|
|
|
|
run: |
|
|
|
|
make clean
|
|
|
|
GOOS=linux GOARCH=mipsle GOMIPS=softfloat make all static
|
|
|
|
upx -9 etherguard-go*
|
2021-12-18 16:42:14 +01:00
|
|
|
|
2021-12-18 19:23:59 +01:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: etherguard-mipsle
|
|
|
|
path: etherguard-go*
|
|
|
|
|
|
|
|
|
|
|
|
multi-arch:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- arch: aarch64
|
|
|
|
- arch: armv7
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: uraimo/run-on-arch-action@v2.0.5
|
|
|
|
name: Build artifact
|
|
|
|
id: build
|
|
|
|
with:
|
|
|
|
arch: ${{ matrix.arch }}
|
|
|
|
distro: ubuntu20.04
|
|
|
|
githubToken: ${{ github.token }}
|
|
|
|
setup: |
|
|
|
|
mkdir -p "${PWD}/artifacts"
|
|
|
|
dockerRunArgs: |
|
|
|
|
--volume "${PWD}/artifacts:/artifacts"
|
|
|
|
env: |
|
|
|
|
artifact_dir: ${{ matrix.arch }}
|
|
|
|
shell: /bin/sh
|
|
|
|
install: |
|
|
|
|
apt-get -y update
|
|
|
|
apt install software-properties-common -y
|
|
|
|
add-apt-repository ppa:longsleep/golang-backports
|
|
|
|
apt-get -y update
|
|
|
|
apt-get install -y wireguard-tools golang-go build-essential git
|
|
|
|
run: |
|
|
|
|
make all static
|
|
|
|
mkdir /artifacts/${artifact_dir}
|
|
|
|
cp etherguard-go* /artifacts/${artifact_dir}
|
2021-12-18 16:42:14 +01:00
|
|
|
|
2021-12-18 19:23:59 +01:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: etherguard-multi_arch
|
|
|
|
path: artifacts/
|