Skip to content

Commit 6f60c88

Browse files
committed
add builder
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 79f09fb commit 6f60c88

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/build-pr-cmk.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build cmk on PR
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.go'
7+
- 'go.mod'
8+
- 'go.sum'
9+
10+
jobs:
11+
build:
12+
if: ${{ github.repository == 'shwstppr/cloudstack-cloudmonkey' }}
13+
runs-on: ubuntu-24.04
14+
name: Build cmk binary
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '1.22'
23+
24+
- name: Build cmk binary
25+
run: go build -v -o cmk ./cmk.go
26+
27+
- name: Rename binary with platform and PR number
28+
run: |
29+
pr_number=${{ github.event.pull_request.number }}
30+
mv cmk cmk.linux.x86-64.pr${pr_number}
31+
32+
- name: Upload cmk binary
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: cmk.linux.x86-64.pr${{ github.event.pull_request.number }}
36+
path: cmk.linux.x86-64.pr${{ github.event.pull_request.number }}
37+
if-no-files-found: error
38+

0 commit comments

Comments
 (0)