Skip to content

Commit 1e864c8

Browse files
authored
Add workflow for releasing sparkctl binary (#2264)
Signed-off-by: Yi Chen <[email protected]>
1 parent d0daf2f commit 1e864c8

File tree

1 file changed

+49
-5
lines changed

1 file changed

+49
-5
lines changed

.github/workflows/release.yaml

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,54 @@ jobs:
6565
echo "Tag '${VERSION}' does not exist."
6666
fi
6767
68-
build_images:
68+
release_sparkctl:
6969
needs:
7070
- check-release
7171

7272
runs-on: ubuntu-latest
7373

74+
strategy:
75+
fail-fast: true
76+
matrix:
77+
os:
78+
- linux
79+
- darwin
80+
arch:
81+
- amd64
82+
- arm64
83+
84+
env:
85+
GOOS: ${{ matrix.os }}
86+
GOARCH: ${{ matrix.arch }}
87+
88+
steps:
89+
- name: Checkout source code
90+
uses: actions/checkout@v4
91+
92+
- name: Read version from VERSION file
93+
run: |
94+
VERSION=$(cat VERSION | sed "s/^v//")
95+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
96+
97+
- name: Build sparkctl binary
98+
run: |
99+
make build-sparkctl
100+
tar -czvf sparkctl-${VERSION}-${GOOS}-${GOARCH}.tgz -C bin sparkctl
101+
102+
- name: Upload sparkctl binary
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: sparkctl-${{ env.VERSION }}-${{ env.GOOS }}-${{ env.GOARCH }}
106+
path: sparkctl-${{ env.VERSION }}-${{ env.GOOS }}-${{ env.GOARCH }}.tgz
107+
if-no-files-found: error
108+
retention-days: 1
109+
110+
build_images:
111+
needs:
112+
- release_sparkctl
113+
114+
runs-on: ubuntu-latest
115+
74116
strategy:
75117
fail-fast: false
76118
matrix:
@@ -90,10 +132,6 @@ jobs:
90132
- name: Read version from VERSION file
91133
run: |
92134
VERSION=$(cat VERSION)
93-
if [[ ! ${VERSION} =~ ${{ env.SEMVER_PATTERN }} ]]; then
94-
echo "Version '${VERSION}' does not match semver pattern."
95-
exit 1
96-
fi
97135
echo "VERSION=${VERSION}" >> $GITHUB_ENV
98136
99137
- name: Docker meta
@@ -250,6 +288,11 @@ jobs:
250288
helm package charts/${chart}
251289
done
252290
291+
- name: Download artifacts
292+
uses: actions/download-artifact@v4
293+
with:
294+
pattern: sparkctl-*
295+
253296
- name: Release
254297
id: release
255298
uses: softprops/action-gh-release@v2
@@ -262,3 +305,4 @@ jobs:
262305
draft: true
263306
files: |
264307
*.tgz
308+
sparkctl-*/sparkctl-*.tgz

0 commit comments

Comments
 (0)