Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,39 @@ jobs:
gh release upload $TAG $f
done
echo "Charts successfully uploaded to GitHub release $TAG"

- name: Add charts to branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version=$(echo '${{ steps.goreleaser.outputs.metadata }}' | jq -r '.version')
branch_version=v$(echo "$version" | cut -d'.' -f1,2)
charts_branch=charts/$branch_version
if [ ! -e ~/.gitconfig ]; then
git config --global user.name "aks-operator-bot"
git config --global user.email aks-operator@suse.de
fi
echo "Publishing helm chart in the branch $charts_branch"
if ! git ls-remote --exit-code --heads origin "$charts_branch"; then
git checkout --orphan "$charts_branch"
git rm -rf .
echo "# AKS Operator Helm Charts for $branch_version versions" > README.md
echo "The documentation is centralized in a unique place, checkout https://github.com/rancher/aks-operator." >> README.md
git checkout origin/main -- License .gitignore
git add README.md License .gitignore
git commit -m "Initial commit for $charts_branch"
else
git checkout .
git checkout "$charts_branch"
fi
mkdir -p charts
for f in $(find bin/ -name '*.tgz'); do
tar -xf $f -C charts/
done
git add charts/**/*
git commit -m "Update charts to version $version"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
git push origin "$charts_branch"

dispatch-chart-release:
permissions:
Expand Down