1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ jobs :
9+ build-linux :
10+ name : Build Linux
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v4
14+
15+ - name : Install SQLCipher
16+ run : sudo apt-get install -y libsqlcipher-dev
17+
18+ - name : Set up Go
19+ uses : actions/setup-go@v5
20+ with :
21+ go-version : ' 1.22'
22+
23+ - name : Build Linux amd64
24+ run : |
25+ GOOS=linux GOARCH=amd64 CGO_ENABLED=1 \
26+ go build -o dist/enveil-linux-amd64 ./cmd/enveil/
27+
28+ - name : Build Linux arm64
29+ run : |
30+ sudo apt-get install -y gcc-aarch64-linux-gnu
31+ GOOS=linux GOARCH=arm64 CGO_ENABLED=1 \
32+ CC=aarch64-linux-gnu-gcc \
33+ go build -o dist/enveil-linux-arm64 ./cmd/enveil/
34+
35+ - name : Upload Linux artifacts
36+ uses : actions/upload-artifact@v4
37+ with :
38+ name : linux-binaries
39+ path : dist/
40+
41+ build-macos :
42+ name : Build macOS
43+ runs-on : macos-latest
44+ steps :
45+ - uses : actions/checkout@v4
46+
47+ - name : Install SQLCipher
48+ run : brew install sqlcipher
49+
50+ - name : Set up Go
51+ uses : actions/setup-go@v5
52+ with :
53+ go-version : ' 1.22'
54+
55+ - name : Build macOS amd64
56+ run : |
57+ GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 \
58+ go build -o dist/enveil-darwin-amd64 ./cmd/enveil/
59+
60+ - name : Build macOS arm64
61+ run : |
62+ GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 \
63+ go build -o dist/enveil-darwin-arm64 ./cmd/enveil/
64+
65+ - name : Upload macOS artifacts
66+ uses : actions/upload-artifact@v4
67+ with :
68+ name : macos-binaries
69+ path : dist/
70+
71+ release :
72+ name : Create Release
73+ needs : [build-linux, build-macos]
74+ runs-on : ubuntu-latest
75+ permissions :
76+ contents : write
77+ steps :
78+ - name : Download Linux binaries
79+ uses : actions/download-artifact@v4
80+ with :
81+ name : linux-binaries
82+ path : dist/
83+
84+ - name : Download macOS binaries
85+ uses : actions/download-artifact@v4
86+ with :
87+ name : macos-binaries
88+ path : dist/
89+
90+ - name : Create checksums
91+ run : |
92+ cd dist
93+ sha256sum * > checksums.txt
94+ cat checksums.txt
95+
96+ - name : Create GitHub Release
97+ uses : softprops/action-gh-release@v2
98+ with :
99+ files : |
100+ dist/enveil-linux-amd64
101+ dist/enveil-linux-arm64
102+ dist/enveil-darwin-amd64
103+ dist/enveil-darwin-arm64
104+ dist/checksums.txt
105+ generate_release_notes : true
0 commit comments