Skip to content

Commit 204d0d2

Browse files
committed
set go version && add github actions
1 parent 772219e commit 204d0d2

3 files changed

Lines changed: 67 additions & 1 deletion

File tree

.github/workflows/go.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
name: Go
3+
4+
on:
5+
push:
6+
branches:
7+
- '**'
8+
tags:
9+
- 'v*'
10+
pull_request:
11+
branches:
12+
- main
13+
14+
jobs:
15+
build_and_publish:
16+
runs-on: ubuntu-latest
17+
# Need for gh release
18+
permissions:
19+
contents: write
20+
21+
steps:
22+
- uses: actions/checkout@v6
23+
- name: Set up Go
24+
uses: actions/setup-go@v6
25+
with:
26+
go-version-file: go.mod
27+
28+
- name: Test
29+
run: make test
30+
31+
- name: Build
32+
env:
33+
VERSION: ${{ github.ref_name }}
34+
COMMIT: ${{ github.sha }}
35+
run: make build
36+
37+
- name: Build arm
38+
env:
39+
VERSION: ${{ github.ref_name }}
40+
COMMIT: ${{ github.sha }}
41+
run: make build_arm
42+
43+
- name: List builded
44+
run: ls bin/
45+
46+
- name: Create GitHub Release
47+
if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
48+
env:
49+
GH_TOKEN: ${{ github.token }}
50+
run: |
51+
gh release create "${{ github.ref_name }}" \
52+
--verify-tag \
53+
--notes-file release.md \
54+
--generate-notes
55+
56+
- name: Upload release assets
57+
if: github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
58+
env:
59+
GH_TOKEN: ${{ github.token }}
60+
run: |
61+
gh release upload "${GITHUB_REF_NAME}" \
62+
bin/sflowgen-linux-amd64 \
63+
bin/sflowgen_linux-arm64

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module sflowgen
22

3-
go 1.22
3+
go 1.26.5
44

55
require (
66
github.com/Cistern/sflow v0.0.0-20240622235316-ed105e3cf9fb

release.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This is an sFlow v5 traffic generator intended for FastNetMon testing and demonstrations.
2+
3+
Usage and configuration instructions are available in [README.md](README.md). Prebuilt Linux binaries are provided for AMD64 and ARM64.

0 commit comments

Comments
 (0)