Remove vpp-static build (#3)

This commit is contained in:
Dark Litss 2021-12-19 23:06:10 +08:00 committed by GitHub
parent 9db9b73ffd
commit 0cb900db02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 190 additions and 151 deletions

View File

@ -69,16 +69,30 @@ jobs:
shell: /bin/sh shell: /bin/sh
install: | install: |
apt-get -y update apt-get -y update
apt install software-properties-common -y
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 add-apt-repository ppa:longsleep/golang-backports
apt-get -y update apt-get -y update
apt-get install -y vpp vpp-plugin-core python3-vpp-api vpp-dbg vpp-dev libmemif libmemif-dev || true
apt-get install -y wireguard-tools golang-go build-essential git apt-get install -y wireguard-tools golang-go build-essential git
run: | run: |
make all static make all static
make vpp || true
mkdir /artifacts/${artifact_dir} mkdir /artifacts/${artifact_dir}
cp etherguard-go* /artifacts/${artifact_dir} cp etherguard-go* /artifacts/${artifact_dir}
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
if: ${{ matrix.arch == 'armv7' }}
with: with:
name: etherguard-multi_arch name: etherguard-arm32
path: artifacts/ path: artifacts/armv7
- uses: actions/upload-artifact@v2
if: ${{ matrix.arch == 'aarch64' }}
with:
name: etherguard-arm64
path: artifacts/aarch64

View File

@ -41,6 +41,14 @@ jobs:
asset_name: etherguard-go-x86_64 asset_name: etherguard-go-x86_64
tag: ${{ github.ref }} tag: ${{ github.ref }}
- name: Upload x86_64 dynamic vpp build
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: etherguard-go-vpp
asset_name: etherguard-go-x86_64
tag: ${{ github.ref }}
- name: Upload x86_64 static build - name: Upload x86_64 static build
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
@ -68,6 +76,16 @@ jobs:
asset_name: etherguard-go-mipsle asset_name: etherguard-go-mipsle
tag: ${{ github.ref }} tag: ${{ github.ref }}
- name: Upload mipsle dynamic vpp build
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: etherguard-go-vpp
asset_name: etherguard-go-mipsle
tag: ${{ github.ref }}
- name: Upload mipsle static build - name: Upload mipsle static build
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
@ -102,21 +120,35 @@ jobs:
shell: /bin/sh shell: /bin/sh
install: | install: |
apt-get -y update apt-get -y update
apt install software-properties-common -y
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 add-apt-repository ppa:longsleep/golang-backports
apt-get -y update apt-get -y update
apt-get install -y vpp vpp-plugin-core python3-vpp-api vpp-dbg vpp-dev libmemif libmemif-dev || true
apt-get install -y wireguard-tools golang-go build-essential git apt-get install -y wireguard-tools golang-go build-essential git
run: | run: |
make all static make all static
make vpp || true
mkdir /artifacts/${artifact_dir} mkdir /artifacts/${artifact_dir}
cp etherguard-go* /artifacts/${artifact_dir} cp etherguard-go* /artifacts/${artifact_dir}
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with:
name: etherguard-multi_arch
path: artifacts/
- name: Upload dynamic build 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
- name: Upload ${{ matrix.arch }} dynamic build
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
@ -124,7 +156,16 @@ jobs:
asset_name: etherguard-go-${{ martix.arch }} asset_name: etherguard-go-${{ martix.arch }}
tag: ${{ github.ref }} tag: ${{ github.ref }}
- name: Upload static build - name: Upload ${{ matrix.arch }} dynamic vpp build
if: ${{ matrix.arch == 'aarch64' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/${{ martix.arch }}/etherguard-go
asset_name: etherguard-go-${{ martix.arch }}
tag: ${{ github.ref }}
- name: Upload ${{ matrix.arch }} static build
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
repo_token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -45,13 +45,6 @@ etherguard-go-vpp: $(wildcard *.go) $(wildcard */*.go)
patch -p0 -i govpp_remove_crcstring_check.patch && \ patch -p0 -i govpp_remove_crcstring_check.patch && \
go build -v -tags vpp -o "$@" go build -v -tags vpp -o "$@"
etherguard-go-vpp-static: $(wildcard *.go) $(wildcard */*.go)
go mod download && \
go mod tidy && \
go mod vendor && \
patch -p0 -i govpp_remove_crcstring_check.patch && \
CGO_ENABLED=0 go build -trimpath -a -ldflags '-s -w -extldflags "-static"' -v -tags vpp -o "$@"
static: static:
@export GIT_CEILING_DIRECTORIES="$(realpath $(CURDIR)/..)" && \ @export GIT_CEILING_DIRECTORIES="$(realpath $(CURDIR)/..)" && \
tag="$$(git describe 2>/dev/null)" && \ tag="$$(git describe 2>/dev/null)" && \
@ -61,15 +54,6 @@ static:
git update-index --assume-unchanged version.go || true git update-index --assume-unchanged version.go || true
@$(MAKE) etherguard-go-static @$(MAKE) etherguard-go-static
static-vpp:
@export GIT_CEILING_DIRECTORIES="$(realpath $(CURDIR)/..)" && \
tag="$$(git describe 2>/dev/null)" && \
ver="$$(printf 'package main\n\nconst Version = "%s"\n' "$$tag")" && \
[ "$$(cat version.go 2>/dev/null)" != "$$ver" ] && \
echo "$$ver" > version.go && \
git update-index --assume-unchanged version.go || true
@$(MAKE) etherguard-go-vpp-static
install: etherguard-go install: etherguard-go
@install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 "$<" "$(DESTDIR)$(BINDIR)/etherguard-go" @install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 "$<" "$(DESTDIR)$(BINDIR)/etherguard-go"