Skip to content

Commit 981aad7

Browse files
committed
use make dist
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent f67facf commit 981aad7

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,28 @@ jobs:
3838
with:
3939
go-version: '1.22'
4040

41-
- name: Build cmk binary
42-
id: build_cmk
43-
run: go build -v -o cmk ./cmk.go
41+
- name: Build dist
42+
run: make dist
4443
continue-on-error: true
4544

46-
- name: Rename binary
45+
- name: Zip dist directory
4746
if: success()
4847
run: |
49-
mv cmk cmk.linux.x86-64.pr${{ github.event.pull_request.number }}
48+
zip -r cmk-dist.pr${{ github.event.pull_request.number }}.zip dist/
5049
51-
- name: Upload cmk binary
50+
- name: Upload zipped dist artifact
5251
id: upload_artifact
5352
uses: actions/upload-artifact@v4
5453
if: success()
5554
with:
56-
name: cmk.linux.x86-64.pr${{ github.event.pull_request.number }}
57-
path: cmk.linux.x86-64.pr${{ github.event.pull_request.number }}
55+
name: cmk-binaries.pr${{ github.event.pull_request.number }}
56+
path: cmk-binaries.pr${{ github.event.pull_request.number }}.zip
5857
if-no-files-found: error
5958
retention-days: 10
6059

6160
- name: Calculate artifact expiry date
6261
id: expiry_date
62+
if: success()
6363
run: |
6464
echo "expiry_date=$(date -d '+10 days' '+%B %d, %Y')" >> $GITHUB_OUTPUT
6565
@@ -84,6 +84,7 @@ jobs:
8484
${{ job.status == 'success' && '✅ Build complete' || '❌ Build failed' }} for PR #${{ github.event.pull_request.number }}.
8585
8686
${{ job.status == 'success'
87-
&& format('🔗 Download the [cmk binary for linux.x86-64]({0}) (expires on {1})', steps.upload_artifact.outputs.artifact-url, steps.expiry_date.outputs.expiry_date)
87+
&& format('🔗 Download the [cmk binaries]({0}) (expires on {1})', steps.upload_artifact.outputs.artifact-url, steps.expiry_date.outputs.expiry_date)
8888
|| format('See the [workflow run](https://github.com/{0}/actions/runs/{1}) for details.', github.repository, github.run_id) }}
8989
edit-mode: replace
90+

0 commit comments

Comments
 (0)