88
99jobs :
1010 build :
11- name : Build Binaries
11+ name : Build All Platforms
1212 runs-on : ubuntu-latest
13- strategy :
14- matrix :
15- include :
16- # Linux builds
17- - goos : linux
18- goarch : amd64
19- name : jail-linux-amd64
20- - goos : linux
21- goarch : arm64
22- name : jail-linux-arm64
23- # macOS builds
24- - goos : darwin
25- goarch : amd64
26- name : jail-darwin-amd64
27- - goos : darwin
28- goarch : arm64
29- name : jail-darwin-arm64
3013
3114 steps :
3215 - name : Check out code
@@ -48,27 +31,38 @@ jobs:
4831 restore-keys : |
4932 ${{ runner.os }}-go-
5033
51- - name : Download dependencies
52- run : go mod download
34+ - name : Download and verify dependencies
35+ run : make deps
5336
54- - name : Verify dependencies
55- run : go mod verify
37+ - name : Build all platforms
38+ run : make build-all
5639
57- - name : Build binary
58- run : |
59- # Set target for cross-compilation
60- export GOOS=${{ matrix.goos }}
61- export GOARCH=${{ matrix.goarch }}
62- export CGO_ENABLED=0
63-
64- # Build using Go directly for cross-compilation
65- go build -ldflags="-s -w -X main.version=${{ github.ref_name }}" -o ${{ matrix.name }} ./cmd/jail
40+ - name : Upload Linux x64 binary
41+ uses : actions/upload-artifact@v4
42+ with :
43+ name : boundary-linux-amd64
44+ path : build/boundary-linux-amd64
45+ retention-days : 7
46+
47+ - name : Upload Linux ARM64 binary
48+ uses : actions/upload-artifact@v4
49+ with :
50+ name : boundary-linux-arm64
51+ path : build/boundary-linux-arm64
52+ retention-days : 7
53+
54+ - name : Upload macOS Intel binary
55+ uses : actions/upload-artifact@v4
56+ with :
57+ name : boundary-darwin-amd64
58+ path : build/boundary-darwin-amd64
59+ retention-days : 7
6660
67- - name : Upload binary as artifact
61+ - name : Upload macOS Apple Silicon binary
6862 uses : actions/upload-artifact@v4
6963 with :
70- name : ${{ matrix.name }}
71- path : ${{ matrix.name }}
64+ name : boundary-darwin-arm64
65+ path : build/boundary-darwin-arm64
7266 retention-days : 7
7367
7468 release :
@@ -81,55 +75,31 @@ jobs:
8175 - name : Check out code
8276 uses : actions/checkout@v4
8377
78+ - name : Set up Go
79+ uses : actions/setup-go@v5
80+ with :
81+ go-version : ' 1.25'
82+ check-latest : true
83+
8484 - name : Download all artifacts
8585 uses : actions/download-artifact@v4
8686 with :
8787 path : ./binaries
8888
8989 - name : Prepare release assets
9090 run : |
91- cd binaries
92- # Create compressed archives for each binary
93- for dir in */; do
94- binary_name=$(basename "$dir")
95- cd "$dir"
96- # Unix: create tar.gz
97- tar -czf "../${binary_name}.tar.gz" "$binary_name"
98- cd ..
99- done
91+ # Create archives directly from artifacts using make target
92+ make release-archives
93+
10094 # List all release assets
101- ls -la *.tar.gz
102-
103- - name : Generate release notes
104- id : release_notes
105- run : |
106- echo "## 🚀 Release ${{ github.ref_name }}" > release_notes.md
107- echo "" >> release_notes.md
108- echo "### 📦 Downloads" >> release_notes.md
109- echo "" >> release_notes.md
110- echo "Choose the appropriate binary for your platform:" >> release_notes.md
111- echo "" >> release_notes.md
112- echo "- **Linux (x64)**: \`jail-linux-amd64.tar.gz\`" >> release_notes.md
113- echo "- **Linux (ARM64)**: \`jail-linux-arm64.tar.gz\`" >> release_notes.md
114- echo "- **macOS (Intel)**: \`jail-darwin-amd64.tar.gz\`" >> release_notes.md
115- echo "- **macOS (Apple Silicon)**: \`jail-darwin-arm64.tar.gz\`" >> release_notes.md
116- echo "" >> release_notes.md
117- echo "### 🛠️ Installation" >> release_notes.md
118- echo "" >> release_notes.md
119- echo "1. Download the appropriate binary for your platform" >> release_notes.md
120- echo "2. Extract the archive" >> release_notes.md
121- echo "3. Make the binary executable (Unix): `chmod +x jail`" >> release_notes.md
122- echo "4. Move to your PATH: `sudo mv jail /usr/local/bin/` (Unix)" >> release_notes.md
123- echo "" >> release_notes.md
124- echo "### ✅ Verification" >> release_notes.md
125- echo "" >> release_notes.md
126- echo "Verify installation: `jail --help`" >> release_notes.md
95+ ls -la archives/*.tar.gz
12796
12897 - name : Create GitHub Release
12998 uses : softprops/action-gh-release@v2
13099 with :
131- files : |
132- binaries/*.tar.gz
133- body_path : release_notes.md
100+ files : ' archives/*.tar.gz'
101+ draft : false
102+ prerelease : ${{ contains(github.ref_name, '-') }}
103+ generate_release_notes : true
134104 env :
135105 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments