File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build binary packages
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ - main
8+ pull_request :
9+ workflow_dispatch :
10+
11+ env :
12+ GOBGP_VERSION : 3.14.0
13+
14+ jobs :
15+ build-packages :
16+ runs-on : ubuntu-latest
17+ permissions :
18+ actions : write
19+ contents : read
20+ strategy :
21+ fail-fast : false
22+ matrix :
23+ arch :
24+ - amd64
25+ - arm64
26+
27+ steps :
28+ - name : Checkout
29+ uses : actions/checkout@v4
30+
31+ - name : Set up Go
32+ uses : actions/setup-go@v5
33+ with :
34+ go-version-file : go.mod
35+
36+ - name : Build country_lockdown binary
37+ run : |
38+ mkdir -p bin dist
39+ CGO_ENABLED=0 GOOS=linux GOARCH=${{ matrix.arch }} go build -mod=vendor -o bin/country_lockdown .
40+
41+ - name : Download gobgp tools
42+ run : |
43+ wget "https://github.com/osrg/gobgp/releases/download/v${GOBGP_VERSION}/gobgp_${GOBGP_VERSION}_linux_${{ matrix.arch }}.tar.gz" -O /tmp/gobgp.tar.gz
44+ tar -xf /tmp/gobgp.tar.gz -C bin/
45+
46+ - name : Install nfpm
47+ run : go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.42.0
48+
49+ - name : Build deb/rpm packages
50+ run : |
51+ cp nfpm.yaml "${RUNNER_TEMP}/nfpm.yaml"
52+ sed -i -E 's/^arch:[[:space:]]*".*"/arch: "${{ matrix.arch }}"/' "${RUNNER_TEMP}/nfpm.yaml"
53+ ~/go/bin/nfpm pkg --config "${RUNNER_TEMP}/nfpm.yaml" --packager deb --target dist/
54+ ~/go/bin/nfpm pkg --config "${RUNNER_TEMP}/nfpm.yaml" --packager rpm --target dist/
55+
56+ - name : Upload package artifacts
57+ uses : actions/upload-artifact@v4
58+ with :
59+ name : country-lockdown-packages-${{ matrix.arch }}
60+ path : dist/*
61+ if-no-files-found : error
You can’t perform that action at this time.
0 commit comments