-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (69 loc) · 2.02 KB
/
Copy pathbuild.yml
File metadata and controls
82 lines (69 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Build and Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
go-version: [1.24, 1.25]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Verify dependencies
run: go mod verify
- name: Build binary
shell: bash
run: |
# Debug: Show current directory and contents
echo "=== Debug Info ==="
pwd
ls -la
echo "=== Go Module Info ==="
go mod why
echo "=== Repository Structure ==="
find . -name "*.go" -type f | head -10
echo "========================"
# Build for current platform
if [[ "$RUNNER_OS" == "Windows" ]]; then
OUTPUT="ada.exe"
else
OUTPUT="ada"
fi
# Build with version info - use relative path from current directory
echo "Building from ./cmd/ada"
go build -ldflags="-s -w -X main.Version=dev" -o ${OUTPUT} ./cmd/ada
# Show binary info
echo "=== Binary Information ==="
echo "File: ${OUTPUT}"
echo "Size: $(ls -lh ${OUTPUT} | awk '{print $5}')"
echo "Go Version: $(go version)"
echo "OS: $RUNNER_OS"
echo "Architecture: $(uname -m || echo 'Windows')"
echo "========================"
- name: Test binary
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
OUTPUT="ada.exe"
else
OUTPUT="ada"
fi
# Test version flag
./${OUTPUT} --version
# Test help flag
./${OUTPUT} --help
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ada-${{ matrix.os }}-${{ matrix.go-version }}
path: ada*
retention-days: 1