Skip to content

Commit 47781d2

Browse files
committed
feat: add CI/CD workflows, fix module path, add missing cmd/ entry point
- Add GitHub Actions CI workflow (test + build on push/PR) - Add GitHub Actions Release workflow (auto-build on tag push) - Fix go.mod module path: lume -> github.com/Tyooughtul/lume - Update all import paths to match new module path - Fix .gitignore: /lume instead of lume (was ignoring cmd/lume/) - Add cmd/lume/ entry point (was missing from repo) - Fix history_test.go: add missing argument to RecordSnapshot
1 parent 9bd3349 commit 47781d2

16 files changed

Lines changed: 559 additions & 22 deletions

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: macos-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-go@v5
17+
with:
18+
go-version: "1.21"
19+
20+
- name: Download dependencies
21+
run: go mod download
22+
23+
- name: Vet
24+
run: go vet ./...
25+
26+
- name: Test
27+
run: go test -v -race ./...
28+
29+
build:
30+
name: Build
31+
runs-on: macos-latest
32+
needs: test
33+
strategy:
34+
matrix:
35+
goarch: [amd64, arm64]
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- uses: actions/setup-go@v5
40+
with:
41+
go-version: "1.21"
42+
43+
- name: Build (darwin/${{ matrix.goarch }})
44+
env:
45+
GOOS: darwin
46+
GOARCH: ${{ matrix.goarch }}
47+
CGO_ENABLED: 0
48+
run: go build -ldflags="-s -w" -o lume-darwin-${{ matrix.goarch }} ./cmd/lume/...
49+
50+
- name: Upload artifact
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: lume-darwin-${{ matrix.goarch }}
54+
path: lume-darwin-${{ matrix.goarch }}

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Build & Release
14+
runs-on: macos-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version: "1.21"
21+
22+
- name: Download dependencies
23+
run: go mod download
24+
25+
- name: Run tests
26+
run: go test -v ./...
27+
28+
- name: Build darwin/arm64
29+
env:
30+
GOOS: darwin
31+
GOARCH: arm64
32+
CGO_ENABLED: 0
33+
run: go build -ldflags="-s -w" -o lume-darwin-arm64 ./cmd/lume/...
34+
35+
- name: Build darwin/amd64
36+
env:
37+
GOOS: darwin
38+
GOARCH: amd64
39+
CGO_ENABLED: 0
40+
run: go build -ldflags="-s -w" -o lume-darwin-amd64 ./cmd/lume/...
41+
42+
- name: Generate checksums
43+
run: shasum -a 256 lume-darwin-* > checksums.txt
44+
45+
- name: Create Release
46+
uses: softprops/action-gh-release@v2
47+
with:
48+
generate_release_notes: true
49+
files: |
50+
lume-darwin-arm64
51+
lume-darwin-amd64
52+
checksums.txt

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Binaries
2-
lume
2+
/lume
3+
lume-darwin-*
34
*.exe
45
*.dll
56
*.so

0 commit comments

Comments
 (0)