-
Notifications
You must be signed in to change notification settings - Fork 94
.github: Several CI-related improvements #4105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e8c40e5
.github: Push ca-certificates and Mantle bumps without creating a PR
chewi a17d1fc
.github: Check out workflow branch for ca-certs and kernel bump jobs
chewi 058a37f
.github: Automatically post image changes reports to pull requests
chewi 776dd2c
.github: Allow flatcar-infra to run CI without approval
chewi 552c832
.github: Make approval gate explicit so it is less visually confusing
chewi 58f16f8
.github: Build with Jenkins instead of GHA when jenkins-ci label present
chewi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,82 +1,52 @@ | ||
| name: Get the latest mantle release for branch | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| schedule: | ||
| - cron: '0 7 * * 1' | ||
|
|
||
| jobs: | ||
| get-mantle-release: | ||
| strategy: | ||
| matrix: | ||
| branch: [main,alpha,beta,stable,lts,lts-old] | ||
| channel: [main,alpha,beta,stable,lts,lts-old] | ||
| fail-fast: false | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out scripts at ${{ github.ref }} for GHA scripts only | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.BOT_PR_TOKEN }} | ||
| path: gha | ||
| - name: Figure out branch | ||
| id: figure-out-branch | ||
| run: | | ||
| set -euo pipefail # The line with major=$(curl | awk) requires pipefail for error handling | ||
| skip=0 | ||
| branch='' | ||
| if [ ${{ matrix.branch }} = "main" ]; then | ||
| branch='main' | ||
| elif [[ ${{ matrix.branch }} = 'lts-old' ]]; then | ||
| curl -fsSLO --retry-delay 1 --retry 60 --retry-connrefused --retry-max-time 60 --connect-timeout 20 'https://lts.release.flatcar-linux.net/lts-info' | ||
| if [[ $(grep -e ':supported' lts-info | wc -l) -le 1 ]]; then | ||
| # Only one supported LTS, skip this workflow run | ||
| # as 'lts' matrix branch will handle updating the only | ||
| # supported LTS. | ||
| skip=1 | ||
| else | ||
| major=$(grep -e ':supported' lts-info | sort -V | head -n 1 | awk -F: '{print $1}') | ||
| branch="flatcar-${major}" | ||
| # Drop this corner case when 2605 is not supported. | ||
| if [[ ${major} -eq 2605 ]]; then | ||
| branch='flatcar-lts-2605' | ||
| fi | ||
| fi | ||
| rm -f lts-info | ||
| else | ||
| major=$(curl -fsSL --retry-delay 1 --retry 60 --retry-connrefused --retry-max-time 60 --connect-timeout 20 https://${{ matrix.branch }}.release.flatcar-linux.net/amd64-usr/current/version.txt | awk -F= '/FLATCAR_BUILD=/{ print $2 }') | ||
| branch="flatcar-${major}" | ||
| fi | ||
| echo "BRANCH=${branch}" >>"${GITHUB_OUTPUT}" | ||
| echo "SKIP=${skip}" >>"${GITHUB_OUTPUT}" | ||
| - uses: actions/checkout@v4 | ||
| if: ${{ steps.figure-out-branch.outputs.SKIP == 0 }} | ||
| run: gha/.github/workflows/figure-out-branch.sh '${{ matrix.channel }}' | ||
| - name: Check out work scripts branch for updating | ||
| if: steps.figure-out-branch.outputs.SKIP == 0 | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.BOT_PR_TOKEN }} | ||
| path: work | ||
| ref: ${{ steps.figure-out-branch.outputs.BRANCH }} | ||
| - name: Fetch latest mantle hash | ||
| if: ${{ steps.figure-out-branch.outputs.SKIP == 0 }} | ||
| if: steps.figure-out-branch.outputs.SKIP == 0 | ||
| id: fetch-latest-mantle | ||
| run: | | ||
| set -euo pipefail | ||
| commit=$(git ls-remote https://github.com/flatcar/mantle refs/heads/main | cut -f1) | ||
| echo "COMMIT=${commit}" >>"${GITHUB_OUTPUT}" | ||
| - name: Try to apply patch | ||
| if: ${{ steps.figure-out-branch.outputs.SKIP == 0 }} | ||
| if: steps.figure-out-branch.outputs.SKIP == 0 | ||
| env: | ||
| WORK_SCRIPTS_DIR: "${{ github.workspace }}/work" | ||
| run: | | ||
| set -euo pipefail | ||
| source gha/.github/workflows/common.sh | ||
| set -x | ||
| cd "${WORK_SCRIPTS_DIR}" | ||
| commit=${{ steps.fetch-latest-mantle.outputs.COMMIT }} | ||
| if ! grep -q "ghcr.io/flatcar/mantle:git-${commit}" sdk_container/.repo/manifests/mantle-container; then | ||
| echo "ghcr.io/flatcar/mantle:git-${commit}" > sdk_container/.repo/manifests/mantle-container | ||
| git add sdk_container/.repo/manifests/mantle-container | ||
| fi | ||
| - name: Create pull request for branch | ||
| if: ${{ steps.figure-out-branch.outputs.SKIP == 0 }} | ||
| uses: peter-evans/create-pull-request@v6 | ||
| with: | ||
| token: ${{ secrets.BOT_PR_TOKEN }} | ||
| base: ${{ steps.figure-out-branch.outputs.BRANCH }} | ||
| branch: mantle-update-${{ steps.figure-out-branch.outputs.BRANCH }} | ||
| author: Flatcar Buildbot <buildbot@flatcar-linux.org> | ||
| committer: Flatcar Buildbot <buildbot@flatcar-linux.org> | ||
| title: Upgrade mantle container image to latest HEAD in ${{ steps.figure-out-branch.outputs.BRANCH }} | ||
| commit-message: Update mantle container image to latest HEAD | ||
| delete-branch: true | ||
| signoff: true | ||
| file=sdk_container/.repo/manifests/mantle-container | ||
| echo "ghcr.io/flatcar/mantle:git-${commit}" > "${file}" | ||
| git status --porcelain "${file}" | grep -q "^ M" || exit 0 | ||
| prepare_git_repo | ||
| git commit --signoff -m "Update mantle container image to latest HEAD" "${file}" | ||
| push_changes_with_rebase | ||
|
chewi marked this conversation as resolved.
|
||
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.