-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5739e7d
commit 9228063
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up environment variables | ||
run: | | ||
echo "VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
before: | ||
hooks: | ||
- go mod download | ||
|
||
builds: | ||
- id: skbdump | ||
binary: skbdump | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
|
||
archives: | ||
- replacements: | ||
linux: Linux | ||
amd64: x86_64 | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
|
||
release: | ||
prerelease: auto | ||
|
||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package main | ||
|
||
import ( | ||
"strings" | ||
|
||
flag "github.com/spf13/pflag" | ||
) | ||
|
||
type Config struct { | ||
Iface string | ||
Priority uint32 | ||
SkbFilename string | ||
PcapFilename string | ||
PcapFilterExp string | ||
} | ||
|
||
var config Config | ||
|
||
func initConfig() { | ||
flag.StringVarP(&config.Iface, "interface", "i", "lo", "interface to capture") | ||
flag.Uint32VarP(&config.Priority, "priority", "p", 1, "filter priority") | ||
flag.StringVarP(&config.SkbFilename, "skb-filename", "s", "skbdump.skb", "output skb filename") | ||
flag.StringVarP(&config.PcapFilename, "pcap-filename", "w", "skbdump.pcap", "output pcap filename") | ||
flag.Parse() | ||
config.PcapFilterExp = strings.Join(flag.Args(), " ") | ||
} |