Skip to content

Commit 3a74f11

Browse files
committed
Initial commit
0 parents  commit 3a74f11

File tree

17 files changed

+1234
-0
lines changed

17 files changed

+1234
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build & Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
goos: [linux]
18+
goarch: [amd64, arm64]
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: '1.24.3'
27+
cache: true
28+
29+
- name: Run Go Tests
30+
run: go test -v ./...
31+
32+
- name: Build Go binary
33+
run: |
34+
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build --trimpath -ldflags="-s -w" -o pacrepo-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/main.go
35+
if [[ "${{ matrix.goos }}" == "linux" && "${{ matrix.goarch }}" == "amd64" ]]; then
36+
cp pacrepo-linux-amd64 pacrepo
37+
fi
38+
39+
- name: Create Release Assets Package
40+
run: tar -czvf pacrepo-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz pacrepo-${{ matrix.goos }}-${{ matrix.goarch }}
41+
42+
- name: Upload Artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: pacrepo-${{ matrix.goos }}-${{ matrix.goarch }}
46+
path: |
47+
pacrepo-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
48+
pacrepo-${{ matrix.goos }}-${{ matrix.goarch }}
49+
pacrepo
50+
51+
release:
52+
name: Create GitHub Release
53+
runs-on: ubuntu-latest
54+
needs: build
55+
steps:
56+
- name: Download Artifacts
57+
uses: actions/download-artifact@v4
58+
with:
59+
path: artifacts
60+
61+
- name: Create or Update GitHub Release
62+
uses: ncipollo/release-action@v1
63+
with:
64+
artifacts: "artifacts/*/*"
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
generateReleaseNotes: true
67+
allowUpdates: true
68+
tag: ${{ github.ref_name }}

.github/workflows/test-lint.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Run Go Tests & Linter
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
test:
15+
name: Test and Lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.24.3'
25+
cache: true
26+
27+
- name: Run Go Tidy
28+
run: go mod tidy
29+
30+
- name: Run Go Vet
31+
run: go vet ./...
32+
33+
- name: Run Go Tests
34+
run: go test -v ./...
35+
36+
- name: Install and run golangci-lint
37+
uses: golangci/golangci-lint-action@v8
38+
with:
39+
version: v2.1.6

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, built with `go test -c`
12+
*.test
13+
14+
# Code coverage profiles and other test artifacts
15+
*.out
16+
coverage.*
17+
*.coverprofile
18+
profile.cov
19+
20+
# Dependency directories (remove the comment below to include it)
21+
# vendor/
22+
23+
# Go workspace file
24+
go.work
25+
go.work.sum
26+
27+
# env file
28+
.env
29+
30+
# Editor/IDE
31+
# .idea/
32+
# .vscode/

0 commit comments

Comments
 (0)