Skip to content

Commit

Permalink
Add workflow for releasing sparkctl binary
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Chen <github@chenyicn.net>
  • Loading branch information
ChenYi015 committed Oct 24, 2024
1 parent d0daf2f commit b4843d6
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,44 @@ jobs:
echo "Tag '${VERSION}' does not exist."
fi
build_images:
release_sparkctl:
needs:
- check-release

runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v4

- name: Read version from VERSION file
run: |
VERSION=$(cat VERSION)
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Build sparkctl binary
run: |
for OS in linux darwin; do
for ARCH in amd64 arm64; do
GOOS=${OS} GOARCH=${ARCH} make build-sparkctl
tar -czvf sparkctl-${VERSION}-${OS}-${ARCH}.tgz bin/sparkctl
done
done
- name: Upload sparkctl binary
uses: actions/upload-artifact@v4
with:
name: sparkctl-*.tgz
path: /tmp/artifacts
if-no-files-found: error
retention-days: 1

build_images:
needs:
- release_sparkctl

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
Expand All @@ -90,10 +122,6 @@ jobs:
- name: Read version from VERSION file
run: |
VERSION=$(cat VERSION)
if [[ ! ${VERSION} =~ ${{ env.SEMVER_PATTERN }} ]]; then
echo "Version '${VERSION}' does not match semver pattern."
exit 1
fi
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Docker meta
Expand Down Expand Up @@ -249,6 +277,11 @@ jobs:
for chart in $(ls charts); do
helm package charts/${chart}
done
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: /tmp/artifacts
pattern: sparkctl-*.tgz

- name: Release
id: release
Expand Down

0 comments on commit b4843d6

Please # to comment.