Release v33.10.0-rc.1 #1
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
| on: | |
| issues: | |
| types: | |
| - opened | |
| jobs: | |
| update_network_operator_version: | |
| if: ${{ startsWith(github.event.issue.title, 'Release v') }} | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }} | |
| ISSUE_TITLE: ${{ github.event.issue.title }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: | | |
| echo "RELEASE_VERSION=$(echo $ISSUE_TITLE | awk '{ print $2 }')" >> $GITHUB_ENV | |
| - run: | | |
| echo "CHART_VERSION=$(echo ${RELEASE_VERSION#v})" >> $GITHUB_ENV | |
| - name: Determine base branch | |
| run: | | |
| if echo $RELEASE_VERSION | grep -q beta; then | |
| base_branch=master | |
| else | |
| v_major_minor=$(echo $RELEASE_VERSION | grep -Eo '^v[0-9]+\.[0-9]+') | |
| base_branch=$v_major_minor.x | |
| fi | |
| echo BASE_BRANCH=$base_branch | tee -a $GITHUB_ENV | |
| - name: Create Release branch if release contains "rc" and branch does not exist | |
| run: | | |
| if echo $RELEASE_VERSION | grep -q 'rc'; then | |
| git fetch origin | |
| if git ls-remote --heads origin $BASE_BRANCH | grep -q "$BASE_BRANCH"; then | |
| echo "Branch $BASE_BRANCH already exists. Skipping creation." | |
| else | |
| git config user.name nvidia-ci-cd | |
| git config user.email [email protected] | |
| git checkout -b $BASE_BRANCH | |
| git push -u origin $BASE_BRANCH | |
| fi | |
| fi | |
| - run: | | |
| git config user.name nvidia-ci-cd | |
| git config user.email [email protected] | |
| git checkout -b cicd/update-network-operator-to-$RELEASE_VERSION | |
| yq -i e '.NetworkOperator.version = "${{ env.RELEASE_VERSION }}"' hack/release.yaml | |
| yq -i e '.version = "${{ env.CHART_VERSION }}"' deployment/network-operator/Chart.yaml | |
| yq -i e '.appVersion = "${{ env.RELEASE_VERSION }}"' deployment/network-operator/Chart.yaml | |
| make release-build | |
| if ! git diff --color --unified=0 --exit-code; then | |
| git add deployment/network-operator/ | |
| git add hack/release.yaml | |
| git commit -sam "cicd: update Network Operator to $RELEASE_VERSION in chart values" | |
| git push -u origin cicd/update-network-operator-to-$RELEASE_VERSION | |
| gh pr create \ | |
| --repo ${{ github.repository_owner }}/network-operator \ | |
| --base $BASE_BRANCH \ | |
| --head $(git branch --show-current) \ | |
| --title "cicd: update Network Operator to $RELEASE_VERSION in chart values" \ | |
| --body "Created by the *${{ github.job }}* job." | |
| fi | |
| update_sriov_operator_version: | |
| if: ${{ startsWith(github.event.issue.title, 'Release v') }} | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }} | |
| ISSUE_TITLE: ${{ github.event.issue.title }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }} | |
| repository: ${{ github.repository_owner }}/sriov-network-operator | |
| path: sriov-network-operator-fork | |
| fetch-depth: 0 | |
| - run: | | |
| echo "RELEASE_VERSION=$(echo $ISSUE_TITLE | awk -F 'Release v' '{ print $2 }')" >> $GITHUB_ENV | |
| - name: Determine sriov-network-operator branch | |
| run: | | |
| major_minor=$(echo $RELEASE_VERSION | grep -Eo '[0-9]+\.[0-9]+') | |
| echo BASE_BRANCH=network-operator-$major_minor.x | tee -a $GITHUB_ENV | |
| - name: Create tag to trigger PR that update image tags in network-operator values | |
| run: | | |
| cd sriov-network-operator-fork | |
| git config user.name nvidia-ci-cd | |
| git config user.email [email protected] | |
| git checkout -b $RELEASE_VERSION origin/$BASE_BRANCH | |
| git tag network-operator-$RELEASE_VERSION | |
| git push origin --tags | |