Skip to content

Commit 6116bb0

Browse files
committed
[SPARK-52004] Improve publish_snapshot_chart GitHub Action job to support branches
### What changes were proposed in this pull request? This PR aims to improve `publish_snapshot_chart` GitHub Action job to support branches. ### Why are the changes needed? Previously, the job supports only `main` branch. After this PR, `branch-0.1` is added to the matrix. However, this PR should land at only `main` branch because GitHub Action supports the schedule job only at `main` branch. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Manual review. This should be tested after merging. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#185 from dongjoon-hyun/SPARK-52004. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent e5e37f3 commit 6116bb0

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/publish_snapshot_chart.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
description: 'list of branches to publish (JSON)'
1111
required: true
1212
# keep in sync with default value of strategy matrix 'branch'
13-
default: '["main"]'
13+
default: '["main", "branch-0.1"]'
1414

1515
jobs:
1616
publish-snapshot-chart:
@@ -20,7 +20,7 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
# keep in sync with default value of workflow_dispatch input 'branch'
23-
branch: ${{ fromJSON( inputs.branch || '["main"]' ) }}
23+
branch: ${{ fromJSON( inputs.branch || '["main", "branch-0.1"]' ) }}
2424
steps:
2525
- name: Checkout repository
2626
uses: actions/checkout@v4
@@ -36,14 +36,19 @@ jobs:
3636
run: |
3737
./gradlew build spark-operator-api:relocateGeneratedCRD -x check --no-daemon
3838
- name: Build Chart
39+
env:
40+
DIR: 'charts'
3941
run: |
42+
if [[ ${{ matrix.branch }} != 'main' ]]; then
43+
export DIR=charts-${{ matrix.branch }}
44+
fi
4045
cd build-tools/helm
4146
sed -i 's/repository: /repository: apache\//' spark-kubernetes-operator/values.yaml
42-
sed -i 's/tag: .*$/tag: main-snapshot/' spark-kubernetes-operator/values.yaml
43-
mkdir -p tmp/charts
44-
helm package spark-kubernetes-operator -d tmp/charts --app-version main-snapshot
45-
helm repo index tmp/charts --url https://nightlies.apache.org/spark/charts
46-
helm show chart tmp/charts/spark-kubernetes-operator-*.tgz
47+
sed -i 's/tag: .*$/tag: ${{ matrix.branch }}-snapshot/' spark-kubernetes-operator/values.yaml
48+
mkdir -p tmp/$DIR
49+
helm package spark-kubernetes-operator -d tmp/$DIR --app-version ${{ matrix.branch }}-snapshot
50+
helm repo index tmp/$DIR --url https://nightlies.apache.org/spark/$DIR
51+
helm show chart tmp/$DIR/spark-kubernetes-operator-*.tgz
4752
- name: Upload
4853
uses: burnett01/[email protected]
4954
with:

0 commit comments

Comments
 (0)