Skip to content

Commit 70054c2

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 #184 from dongjoon-hyun/SPARK-52004. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 562b1d3 commit 70054c2

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/publish_snapshot_chart.yml

Lines changed: 15 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
@@ -35,15 +35,23 @@ jobs:
3535
- name: Build Operator
3636
run: |
3737
./gradlew build spark-operator-api:relocateGeneratedCRD -x check --no-daemon
38+
- name: Chart Directory
39+
if: ${{ matrix.branch }} == 'main'
40+
env:
41+
DIR: charts
42+
- name: Chart Directory
43+
if: ${{ matrix.branch }} != 'main'
44+
env:
45+
DIR: charts-${{matrix.branch }}
3846
- name: Build Chart
3947
run: |
4048
cd build-tools/helm
4149
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
50+
sed -i 's/tag: .*$/tag: ${{ matrix.branch }}-snapshot/' spark-kubernetes-operator/values.yaml
51+
mkdir -p tmp/$DIR
52+
helm package spark-kubernetes-operator -d tmp/$DIR --app-version ${{ matrix.branch }}-snapshot
53+
helm repo index tmp/$DIR --url https://nightlies.apache.org/spark/$DIR
54+
helm show chart tmp/$DIR/spark-kubernetes-operator-*.tgz
4755
- name: Upload
4856
uses: burnett01/[email protected]
4957
with:

0 commit comments

Comments
 (0)