Update to cass-operator v1.19.1 (#1644) #2482
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: Release | |
on: | |
pull_request: | |
paths: | |
- 'pkg/**' | |
- 'cmd/**' | |
- 'charts/**' | |
- 'tests/integration/**' | |
- '.github/workflows/**' | |
push: | |
branches: | |
- main | |
paths: | |
- 'pkg/**' | |
- 'cmd/**' | |
- 'charts/**' | |
- 'tests/integration/**' | |
- '.github/workflows/**' | |
release: | |
types: | |
- published | |
jobs: | |
release: | |
# Release job should never run on forks and should only trigger on main pushes and published releases | |
if: | | |
( github.event_name == 'release' && github.event.action == 'published' ) | |
|| ( github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'k8ssandra' ) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Update PATH | |
run: | | |
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH | |
- name: Create env variables | |
run: ./.github/scripts/env_variables.sh | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: ${{ env.HELM_VERSION }} | |
- name: Install and validate tool versions | |
run: | | |
scripts/install-yq.sh ${{ env.YQ_VERSION }} | |
helm version | |
yq -V | |
- name: Update chart dependencies | |
run: | | |
scripts/update-helm-deps.sh | |
- name: Compute release chart version | |
id: compute_next_version | |
run: | | |
DATE_TIME=$(date '+%Y%m%d%H%M%S') | |
RELEASE_VERSION=$(echo $(yq e '.version' charts/k8ssandra/Chart.yaml) | sed "s/-.*/-${DATE_TIME}-${GITHUB_SHA::8}/") | |
echo "Release version is: $RELEASE_VERSION" | |
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV | |
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_OUTPUT | |
- name: Update Helm chart version | |
run: | | |
yq eval ".version |= \"${RELEASE_VERSION}\"" charts/k8ssandra/Chart.yaml -i | |
cat charts/k8ssandra/Chart.yaml | |
- name: Create working directory and copy charts | |
run: | | |
mkdir -p build/$RELEASE_VERSION | |
cp -rv charts/* build/$RELEASE_VERSION/ | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-integ-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx-integ- | |
- name: Update k8ssandra-tools cleaner tag | |
run: | | |
yq eval ".cleaner.image.tag |= \"${RELEASE_VERSION}\"" charts/k8ssandra/values.yaml -i | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: cmd/k8ssandra-client/Dockerfile | |
push: true | |
tags: k8ssandra/k8ssandra-tools:latest, k8ssandra/k8ssandra-tools:${{ steps.compute_next_version.outputs.RELEASE_VERSION }} | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache | |
- name: Generate package archives | |
run: | | |
ls | while read c; do | |
if [[ -d $c ]]; then | |
helm package $c | |
fi | |
done | |
working-directory: build/${{ steps.compute_next_version.outputs.RELEASE_VERSION }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
# Helm Release | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.GCP_SA_KEY }}' | |
- name: 'Set up Cloud SDK' | |
uses: google-github-actions/setup-gcloud@v1 | |
with: | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
- name: Download current index from Google Cloud | |
env: | |
GCP_HELM_BUCKET_NAME: ${{ secrets.GCP_HELM_BUCKET_NAME }} | |
run: gsutil cp gs://$GCP_HELM_BUCKET_NAME/stable/index.yaml ./ | |
working-directory: build/${{ steps.compute_next_version.outputs.RELEASE_VERSION }} | |
- name: Regenerate Helm index | |
env: | |
GCP_HELM_BUCKET_NAME: ${{ secrets.GCP_HELM_BUCKET_NAME }} | |
run: helm repo index . --merge index.yaml --url "https://$GCP_HELM_BUCKET_NAME/stable/" | |
working-directory: build/${{ steps.compute_next_version.outputs.RELEASE_VERSION }} | |
- name: Upload packages and index | |
env: | |
GCP_HELM_BUCKET_NAME: ${{ secrets.GCP_HELM_BUCKET_NAME }} | |
run: | | |
gsutil cp ./*.tgz gs://$GCP_HELM_BUCKET_NAME/stable/ | |
gsutil cp ./index.yaml gs://$GCP_HELM_BUCKET_NAME/stable/ | |
working-directory: build/${{ steps.compute_next_version.outputs.RELEASE_VERSION }} |