Publish Snapshot Chart #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Snapshot Chart | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'list of branches to publish (JSON)' | |
required: true | |
# keep in sync with default value of strategy matrix 'branch' | |
default: '["main"]' | |
jobs: | |
publish-snapshot-chart: | |
if: ${{ startsWith(github.repository, 'apache/') }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# keep in sync with default value of workflow_dispatch input 'branch' | |
branch: ${{ fromJSON( inputs.branch || '["main"]' ) }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ matrix.branch }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
cache: 'gradle' | |
- name: Build Operator | |
run: | | |
./gradlew build spark-operator-api:relocateGeneratedCRD -x check --no-daemon | |
- name: Build Chart | |
run: | | |
cd build-tools/helm | |
sed -i 's/repository: /repository: apache\//' spark-kubernetes-operator/values.yaml | |
sed -i 's/tag: .*$/tag: main-snapshot/' spark-kubernetes-operator/values.yaml | |
mkdir -p tmp/charts | |
helm package spark-kubernetes-operator -d tmp/charts --app-version main-snapshot | |
helm repo index tmp/charts --url https://nightlies.apache.org/spark/charts | |
helm show chart tmp/charts/spark-kubernetes-operator-*.tgz | |
- name: Upload | |
uses: burnett01/rsync-deployments@5.2 | |
with: | |
switches: -avzr | |
path: build-tools/helm/tmp/* | |
remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/spark | |
remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }} | |
remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }} | |
remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }} | |
remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} |