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 17c98e0
Showing 1 changed file with 47 additions and 6 deletions.
53 changes: 47 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,53 @@ 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 | sed "s/^v//")
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Build sparkctl binary
run: |
make build-sparkctl
tar -czvf sparkctl-${VERSION}-${GOOS}-${GOARCH}.tgz -C bin sparkctl
- name: Upload sparkctl binary
uses: actions/upload-artifact@v4
with:
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 +131,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 @@ -250,6 +287,9 @@ jobs:
helm package charts/${chart}
done
- name: Download artifacts
uses: actions/download-artifact@v4

- name: Release
id: release
uses: softprops/action-gh-release@v2
Expand All @@ -262,3 +302,4 @@ jobs:
draft: true
files: |
*.tgz
artifacts/sparkctl-*.tgz

0 comments on commit 17c98e0

Please sign in to comment.