Skip to content

Commit 511f85a

Browse files
committed
chore: add project tooling (gitignore, linting, CI, releases)
1 parent c0e6798 commit 511f85a

9 files changed

Lines changed: 155 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: "1.24"
20+
21+
- name: Cache Go modules
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
~/.cache/go-build
26+
~/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod', '**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
31+
- name: Download dependencies
32+
run: go mod download
33+
34+
- name: Run go vet
35+
run: go vet ./...
36+
37+
- name: Run tests
38+
run: go test ./...
39+
40+
- name: Build
41+
run: go build ./...
42+
43+
- name: Run linter
44+
uses: golangci/golangci-lint-action@v8
45+
with:
46+
version: v2.0.0

.github/workflows/ci.yml

Whitespace-only changes.

.github/workflows/release.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: "1.24"
25+
26+
- name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v6
28+
with:
29+
version: v2.0.0
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Whitespace-only changes.

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Compiled binary
2+
nettrace
3+
4+
# Build outputs
5+
dist/
6+
build/
7+
bin/
8+
9+
# Go test artifacts
10+
*.test
11+
*.out
12+
coverage.out
13+
14+
# IDE folders
15+
.vscode/
16+
.idea/
17+
18+
# OS junk
19+
.DS_Store
20+
Thumbs.db
21+
22+
# Local environment files
23+
.env
24+
.env.*

.golangci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: "2"
2+
3+
run:
4+
timeout: 5m
5+
6+
linters:
7+
enable:
8+
- errcheck
9+
- gosimple
10+
- govet
11+
- ineffassign
12+
- staticcheck
13+
- unused

.golangci.yml

Whitespace-only changes.

.goreleaser.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
version: 2
2+
3+
project_name: nettrace
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
- go test ./...
9+
10+
builds:
11+
- id: nettrace
12+
main: ./cmd/nettrace
13+
binary: nettrace
14+
env:
15+
- CGO_ENABLED=0
16+
goos:
17+
- linux
18+
- darwin
19+
- windows
20+
goarch:
21+
- amd64
22+
- arm64
23+
ignore:
24+
- goos: windows
25+
goarch: arm64
26+
ldflags:
27+
- -s -w -X main.version={{.Version}}
28+
29+
archives:
30+
- formats: [tar.gz]
31+
format_overrides:
32+
- goos: windows
33+
formats: [zip]
34+
35+
checksum:
36+
name_template: checksums.txt
37+
38+
changelog:
39+
use: github
40+
sort: asc

.goreleaser.yml

Whitespace-only changes.

0 commit comments

Comments
 (0)