8
8
9
9
jobs :
10
10
build :
11
- name : Build Binaries
11
+ name : Build All Platforms
12
12
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
30
13
31
14
steps :
32
15
- name : Check out code
@@ -48,27 +31,38 @@ jobs:
48
31
restore-keys : |
49
32
${{ runner.os }}-go-
50
33
51
- - name : Download dependencies
52
- run : go mod download
34
+ - name : Download and verify dependencies
35
+ run : make deps
53
36
54
- - name : Verify dependencies
55
- run : go mod verify
37
+ - name : Build all platforms
38
+ run : make build-all
56
39
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
66
60
67
- - name : Upload binary as artifact
61
+ - name : Upload macOS Apple Silicon binary
68
62
uses : actions/upload-artifact@v4
69
63
with :
70
- name : ${{ matrix.name }}
71
- path : ${{ matrix.name }}
64
+ name : boundary-darwin-arm64
65
+ path : build/boundary-darwin-arm64
72
66
retention-days : 7
73
67
74
68
release :
@@ -81,55 +75,31 @@ jobs:
81
75
- name : Check out code
82
76
uses : actions/checkout@v4
83
77
78
+ - name : Set up Go
79
+ uses : actions/setup-go@v5
80
+ with :
81
+ go-version : ' 1.25'
82
+ check-latest : true
83
+
84
84
- name : Download all artifacts
85
85
uses : actions/download-artifact@v4
86
86
with :
87
87
path : ./binaries
88
88
89
89
- name : Prepare release assets
90
90
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
+
100
94
# 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
127
96
128
97
- name : Create GitHub Release
129
98
uses : softprops/action-gh-release@v2
130
99
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
134
104
env :
135
105
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments