release-0.25.2 #38
Workflow file for this run
This file contains hidden or 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_chart | |
| on: | |
| release: | |
| types: | |
| - published | |
| - edited | |
| jobs: | |
| release_chart: | |
| name: Release Chart | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install chart-releaser | |
| run: | | |
| wget https://github.com/helm/chart-releaser/releases/download/v1.4.1/chart-releaser_1.4.1_linux_amd64.tar.gz | |
| tar -zxf chart-releaser_1.4.1_linux_amd64.tar.gz cr | |
| sudo install cr /usr/local/bin/ | |
| rm -f cr chart-releaser_1.4.1_linux_amd64.tar.gz | |
| - name: Package Chart | |
| run: cr package deploy/helm/clickhouse-operator | |
| - name: Get Release Assets | |
| id: get_assets | |
| run: | | |
| CHART_PATH=$(ls .cr-release-packages/altinity-clickhouse-operator-*.tgz) | |
| ASSET_NAME=$(basename ${CHART_PATH}) | |
| ASSET_ID=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| "https://api.github.com/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets" | \ | |
| jq -r ".[] | select(.name == \"$ASSET_NAME\") | .id") | |
| echo "Asset ID is $ASSET_ID" | |
| echo "asset_id=$ASSET_ID" >> $GITHUB_OUTPUT | |
| - name: Delete Existing Release Artifacts | |
| if: steps.get_assets.outputs.asset_id != '' | |
| run: | | |
| curl -X DELETE -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| "https://api.github.com/repos/${{ github.repository }} | |
| - name: Upload Release Artifacts | |
| run: | | |
| CHART_PATH=$(ls .cr-release-packages/altinity-clickhouse-operator-*.tgz) | |
| curl -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| -H "Content-Type: application/gzip" \ | |
| -T "${CHART_PATH}" \ | |
| "https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ github.event.release.id }}/assets?name=$(basename ${CHART_PATH})" | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| - name: Release Chart | |
| run: | | |
| git remote add httpsorigin "https://github.com/${GITHUB_REPOSITORY}.git" | |
| git fetch httpsorigin | |
| cr index \ | |
| --git-repo=${GITHUB_REPOSITORY#*/} \ | |
| --owner=${GITHUB_REPOSITORY_OWNER} \ | |
| --release-name-template=${{ github.event.release.name }} \ | |
| --token=${{ secrets.GITHUB_TOKEN }} \ | |
| --index-path=index.yaml \ | |
| --remote=httpsorigin \ | |
| --push |