Skip to content

Commit 57559eb

Browse files
committed
add workflow for build
1 parent 76bd550 commit 57559eb

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed

.github/release.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
changelog:
2+
categories:
3+
- title: 💪 Features
4+
labels:
5+
- '*'
6+
exclude:
7+
labels:
8+
- dependencies
9+
- title: 👊 Dependencies
10+
labels:
11+
- dependencies

.github/workflows/build.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
goos: [linux, windows, darwin]
14+
goarch: [amd64, arm64]
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: '1.24.2'
22+
23+
- name: Install dependencies
24+
run: |
25+
apt install -y libpcap-dev
26+
go get -v -t -d ./...
27+
28+
- name: Test
29+
run: go test -v ./...
30+
31+
- name: Build
32+
env:
33+
goos: ${{ matrix.goos }}
34+
goarch: ${{ matrix.arch }}
35+
run: |
36+
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -ldflags="-s -w" -trimpath -o boop-${{ matrix.goos }}.${{ matrix.goarch }} ./...

.github/workflows/release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
goos: [linux, windows, darwin]
14+
goarch: [amd64, arm64]
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v4
20+
with:
21+
go-version: '1.24.2'
22+
23+
- name: Install dependencies
24+
run: go get -v -t -d ./...
25+
26+
- name: Test
27+
run: go test -v ./...
28+
29+
- name: Build
30+
env:
31+
goos: ${{ matrix.goos }}
32+
goarch: ${{ matrix.arch }}
33+
run: |
34+
GOOS=$goos GOARCH=$goarch go build -v -ldflags="-s -w" -trimpath -o boop-${goos}.${goarch} ./...
35+
36+
- name: Release
37+
uses: softprops/action-gh-release@v2
38+
if: github.ref_type == 'tag'
39+
with:
40+
files: |
41+
Release.txt
42+
LICENSE

0 commit comments

Comments
 (0)