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 <[email protected]>
  • Loading branch information
ChenYi015 committed Oct 24, 2024
1 parent d0daf2f commit 74261da
Showing 1 changed file with 48 additions and 6 deletions.
54 changes: 48 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
env:
SEMVER_PATTERN: '^v([0-9]+)\.([0-9]+)\.([0-9]+)(-rc\.([0-9]+))?$'
IMAGE_REGISTRY: docker.io
IMAGE_REPOSITORY: kubeflow/spark-operator
IMAGE_REPOSITORY: chenyi015/spark-operator

jobs:
check-release:
Expand Down Expand Up @@ -65,12 +65,54 @@ jobs:
echo "Tag '${VERSION}' does not exist."
fi
build_images:
release_sparkctl:
needs:
- check-release

runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
os:
- linux
- darwin
arch:
- amd64
- arm64

env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}

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: |
make build-sparkctl
tar -czvf sparkctl-${VERSION}-${GOOS}-${GOARCH}.tgz bin/sparkctl
- name: Upload sparkctl binary
uses: actions/upload-artifact@v4
with:
name: sparkctl-${{ env.VERSION }}-${{ env.GOOS }}-${{ env.GOARCH }}.tgz
path: sparkctl-${{ env.VERSION }}-${{ env.GOOS }}-${{ env.GOARCH }}.tgz
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 +132,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 +287,10 @@ jobs:
for chart in $(ls charts); do
helm package charts/${chart}
done
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: sparkctl-*.tgz

- name: Release
id: release
Expand Down

0 comments on commit 74261da

Please sign in to comment.