Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/build-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ inputs:
description: "OS for cross-build"
required: false
default: "linux"

goarch:
description: "ARCH for cross-build"
required: false
default: "amd64"

runs:
using: 'docker'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-go/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function build() {
# Copying this from previous build (cpp)
cp -rf ./version.go /src/pkg/client/version.go
cd /src
GOOS=$INPUT_GOOS go build -o pktvisor-cli cmd/pktvisor-cli/main.go
GOOS=$INPUT_GOOS GOARCH=$INPUT_GOARCH go build -o pktvisor-cli cmd/pktvisor-cli/main.go
}

function copy() {
Expand Down
56 changes: 33 additions & 23 deletions .github/workflows/build_cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
branches:
- develop


jobs:
pkvisor:
name: pktvisor
Expand Down Expand Up @@ -173,33 +172,44 @@ jobs:
- os: macos
arch: armv7lh
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Checkout sources
uses: actions/checkout@v3
with:
path: src

- name: Configure
- name: Configure CMake to generate VERSION
shell: bash
run: VERSION_ONLY=1 cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release

- name: Rename folder and copy version
shell: bash
run: |
VERSION_ONLY=1 cmake src

- name: Build
run: |
if [ "${{matrix.os}}" = macos ]; then
export GOOS=darwin
fi
mv src pktvisor-src
cp -rpf golang/pkg/client/version.go .

- name: Build pktvisor-cli macos
if: ${{matrix.os}} == macos
uses: ./.github/actions/build-go
with:
context: "."
file: "./Dockerfile"
goos: "darwin"

if [ "${{matrix.arch}}" = armv7lh ]; then
export GOARCH=arm
elif [ "${{matrix.arch}}" = aarch64 ]; then
export GOARCH=arm64
fi

cd src/golang
go build -o ${{github.workspace}}/pktvisor-cli ./cmd/pktvisor-cli
- name: Build pktvisor-cli linux armv7lh
if: ${{matrix.arch}} == armv7lh
uses: ./.github/actions/build-go
with:
context: "."
file: "./Dockerfile"
goos: "linux"
goarch: "arm"

- name: Build pktvisor-cli linux aarch64
if: ${{matrix.arch}} == aarch64
uses: ./.github/actions/build-go
with:
context: "."
file: "./Dockerfile"
goos: "linux"
goarch: "arm64"

- name: Upload pktvisor-cli
uses: actions/upload-artifact@v2
Expand Down
32 changes: 0 additions & 32 deletions docker/Dockerfile.pktvisor-cli

This file was deleted.

10 changes: 0 additions & 10 deletions docker/entry-cli.sh

This file was deleted.