[dev-v2.10] Auto bump improvement icons version Fix (#5094) #3
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: Auto Chart Bump | ||
on: | ||
workflow_call: | ||
inputs: | ||
eventPayload: | ||
description: "Payload data from upstream repository" | ||
required: true | ||
type: string | ||
jobs: | ||
process-event: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Log Event Payload | ||
run: | | ||
echo "Payload: ${{ github.event.inputs.chart }}; ${{ github.event.inputs.branch }}" | ||
- name: Parse JSON Payload | ||
id: parse_payload | ||
run: | | ||
echo "CHART=${{ github.event.inputs.chart }}" >> $GITHUB_ENV | ||
echo "BRANCH=${{ github.event.inputs.branch }}" >> $GITHUB_ENV | ||
- name: Checkout to new branch | ||
run: | | ||
git checkout -b "auto-bump_${{ env.CHART }}" | ||
- name: make chart-bump | ||
run: | | ||
echo "make chart-bump package=${{ env.CHART }} branch=${{ env.BRANCH }}" | ||
last_line=$(make chart-bump package="${{ env.CHART }}" branch="${{ env.BRANCH }}" | tail -n 1) | ||
echo "new_version=$last_line" >> $GITHUB_ENV | ||
echo "${{ env.new_version }}" | ||
- name: Git status | ||
run: | | ||
git status | ||
if [ -z "$(git status --porcelain)" ]; then | ||
echo "No bump detected" | ||
exit 1 | ||
fi | ||
- name: Read App Secrets | ||
uses: rancher-eio/read-vault-secrets@main | ||
with: | ||
secrets: | | ||
secret/data/github/repo/${{ github.repository }}/github/app-credentials appId | APP_ID ; | ||
secret/data/github/repo/${{ github.repository }}/github/app-credentials privateKey | PRIVATE_KEY | ||
- name: Create App Token | ||
uses: actions/create-github-app-token@v1 | ||
id: app-token | ||
with: | ||
app-id: ${{ env.APP_ID }} | ||
private-key: ${{ env.PRIVATE_KEY }} | ||
- name: Configure Git for Commit | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
- name: Git Add, Commit, Push Changes | ||
run: | | ||
git add . | ||
git commit -m "auto bump chart: ${{ env.CHART }} version: ${{ env.new_version }}" | ||
git push origin "auto-bump_${{ env.CHART }}" | ||
- name: Create Pull Request | ||
env: | ||
GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||
run: | | ||
gh pr create --base <span class="math-inline">\{\{ env\.BRANCH \}\} \-\-head "auto\-bump\_</span>{{ env.CHART }}" --title "[${{ env.BRANCH }}] auto bump: ${{ env.CHART }} - ${{ env.new_version }}" --body <<EOF | ||
This PR auto-bumps the chart version for ${{ env.CHART }} - ${{ env.new_version }}. | ||
--- | ||
## Review Checklist: | ||
- [ ] CRDs | ||
- [ ] templates folder if any | ||
- [ ] Version | ||
##### Checkpoints for Chart Bumps | ||
`release.yaml`: | ||
- [ ] Each chart version in release.yaml DOES NOT modify an already released chart. If so, stop and modify the versions so that it releases a net-new chart. | ||
- [ ] Each chart version in release.yaml IS exactly 1 more patch or minor version than the last released chart version. If not, stop and modify the versions so that it releases a net-new chart. | ||
`Chart.yaml and index.yaml`: | ||
- [ ] The `index.yaml` file has an entry for your new chart version. | ||
- [ ] The `index.yaml` entries for each chart matches the `Chart.yaml` for each chart. | ||
- [ ] Each chart has ALL required annotations | ||
- kube-version annotation | ||
- rancher-version annotation | ||
- permits-os annotation (indicates Windows and/or Linux) | ||
EOF |