EtherGuard-VPN/.github/workflows/go.yml
2021-12-27 14:03:06 +00:00

102 lines
3.0 KiB
YAML

name: Go
on:
- workflow_dispatch
jobs:
x86_64:
runs-on: ubuntu-20.04
name: Build for ${{ matrix.distro }} x86_64 and mipsle
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- 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 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*
- 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
with:
fetch-depth: 0
- 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 curl -y
echo "deb [trusted=yes] https://packagecloud.io/fdio/release/ubuntu focal main" > /etc/apt/sources.list.d/99fd.io.list
curl -L https://packagecloud.io/fdio/release/gpgkey | apt-key add -
add-apt-repository ppa:longsleep/golang-backports
apt-get -y update
apt-get install -y libmemif libmemif-dev || true
apt-get install -y wireguard-tools golang-go build-essential git
run: |
make all static
make vpp || true
mkdir /artifacts/${artifact_dir}
cp etherguard-go* /artifacts/${artifact_dir}
- uses: actions/upload-artifact@v2
if: ${{ matrix.arch == 'armv7' }}
with:
name: etherguard-arm32
path: artifacts/armv7
- uses: actions/upload-artifact@v2
if: ${{ matrix.arch == 'aarch64' }}
with:
name: etherguard-arm64
path: artifacts/aarch64