Skip to content

Commit b0f52b3

Browse files
committed
github
1 parent 6772e7f commit b0f52b3

File tree

3 files changed

+238
-0
lines changed

3 files changed

+238
-0
lines changed

.github/workflows/build.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build Binaries
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
name: Build All Platforms
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.25'
20+
check-latest: true
21+
22+
- name: Cache Go modules
23+
uses: actions/cache@v4
24+
with:
25+
path: |
26+
~/.cache/go-build
27+
~/go/pkg/mod
28+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
31+
32+
- name: Download and verify dependencies
33+
run: make deps
34+
35+
- name: Build all platforms
36+
run: make build-all
37+
38+
- name: Upload Linux x64 binary
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: boundary-linux-amd64
42+
path: build/boundary-linux-amd64
43+
retention-days: 30
44+
45+
- name: Upload Linux ARM64 binary
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: boundary-linux-arm64
49+
path: build/boundary-linux-arm64
50+
retention-days: 30
51+
52+
- name: Upload macOS Intel binary
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: boundary-darwin-amd64
56+
path: build/boundary-darwin-amd64
57+
retention-days: 30
58+
59+
- name: Upload macOS Apple Silicon binary
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: boundary-darwin-arm64
63+
path: build/boundary-darwin-arm64
64+
retention-days: 30
65+
66+
summary:
67+
name: Build Summary
68+
needs: build
69+
runs-on: ubuntu-latest
70+
if: always()
71+
72+
steps:
73+
- name: Build Summary
74+
run: |
75+
echo "## 🛠️ Build Summary" >> $GITHUB_STEP_SUMMARY
76+
echo "" >> $GITHUB_STEP_SUMMARY
77+
echo "Cross-platform binaries have been built and are available as artifacts." >> $GITHUB_STEP_SUMMARY
78+
echo "" >> $GITHUB_STEP_SUMMARY
79+
echo "### 📦 Available Binaries" >> $GITHUB_STEP_SUMMARY
80+
echo "" >> $GITHUB_STEP_SUMMARY
81+
echo "- 🐧 **Linux (x64)**: boundary-linux-amd64" >> $GITHUB_STEP_SUMMARY
82+
echo "- 🐧 **Linux (ARM64)**: boundary-linux-arm64" >> $GITHUB_STEP_SUMMARY
83+
echo "- 🍎 **macOS (Intel)**: boundary-darwin-amd64" >> $GITHUB_STEP_SUMMARY
84+
echo "- 🍎 **macOS (Apple Silicon)**: boundary-darwin-arm64" >> $GITHUB_STEP_SUMMARY
85+
echo "" >> $GITHUB_STEP_SUMMARY
86+
echo "### 📎 Download Instructions" >> $GITHUB_STEP_SUMMARY
87+
echo "" >> $GITHUB_STEP_SUMMARY
88+
echo "Artifacts can be downloaded from the [Actions tab](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})." >> $GITHUB_STEP_SUMMARY

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest]
16+
runs-on: ${{ matrix.os }}
17+
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '1.25'
26+
check-latest: true
27+
28+
- name: Cache Go modules
29+
uses: actions/cache@v4
30+
with:
31+
path: |
32+
~/.cache/go-build
33+
~/go/pkg/mod
34+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
35+
restore-keys: |
36+
${{ runner.os }}-go-
37+
38+
- name: Download and verify dependencies
39+
run: make deps
40+
41+
- name: Run tests
42+
run: make test
43+
44+
- name: Check build
45+
run: make build

.github/workflows/release.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags like v1.0.0, v1.2.3, etc.
7+
workflow_dispatch: # Allow manual triggering
8+
9+
jobs:
10+
build:
11+
name: Build All Platforms
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.25'
22+
check-latest: true
23+
24+
- name: Cache Go modules
25+
uses: actions/cache@v4
26+
with:
27+
path: |
28+
~/.cache/go-build
29+
~/go/pkg/mod
30+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
31+
restore-keys: |
32+
${{ runner.os }}-go-
33+
34+
- name: Download and verify dependencies
35+
run: make deps
36+
37+
- name: Build all platforms
38+
run: make build-all
39+
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
60+
61+
- name: Upload macOS Apple Silicon binary
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: boundary-darwin-arm64
65+
path: build/boundary-darwin-arm64
66+
retention-days: 7
67+
68+
release:
69+
name: Create Release
70+
needs: build
71+
runs-on: ubuntu-latest
72+
if: startsWith(github.ref, 'refs/tags/')
73+
74+
steps:
75+
- name: Check out code
76+
uses: actions/checkout@v4
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+
- name: Download all artifacts
85+
uses: actions/download-artifact@v4
86+
with:
87+
path: ./binaries
88+
89+
- name: Prepare release assets
90+
run: |
91+
# Create archives directly from artifacts using make target
92+
make release-archives
93+
94+
# List all release assets
95+
ls -la archives/*.tar.gz
96+
97+
- name: Create GitHub Release
98+
uses: softprops/action-gh-release@v2
99+
with:
100+
files: 'archives/*.tar.gz'
101+
draft: false
102+
prerelease: ${{ contains(github.ref_name, '-') }}
103+
generate_release_notes: true
104+
env:
105+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)