-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #306 from inteon/cicd
Migrate makefiles and CI/CD
- Loading branch information
Showing
59 changed files
with
3,336 additions
and
2,991 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. | ||
# Edit https://github.com/cert-manager/makefile-modules/blob/main/modules/repository-base/base/.github/workflows/make-self-upgrade.yaml instead. | ||
|
||
name: make-self-upgrade | ||
concurrency: make-self-upgrade | ||
on: | ||
workflow_dispatch: {} | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
build_images: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Fail if branch is not main | ||
if: github.ref != 'refs/heads/main' | ||
run: | | ||
echo "This workflow should not be run on a branch other than main." | ||
exit 1 | ||
- uses: actions/checkout@v4 | ||
|
||
- id: go-version | ||
run: | | ||
make print-go-version >> "$GITHUB_OUTPUT" | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ steps.go-version.outputs.result }} | ||
|
||
- run: | | ||
git checkout -B "self-upgrade" | ||
- run: | | ||
make -j upgrade-klone | ||
make -j generate | ||
- id: is-up-to-date | ||
shell: bash | ||
run: | | ||
git_status=$(git status -s) | ||
is_up_to_date="true" | ||
if [ -n "$git_status" ]; then | ||
is_up_to_date="false" | ||
echo "The following changes will be committed:" | ||
echo "$git_status" | ||
fi | ||
echo "result=$is_up_to_date" >> "$GITHUB_OUTPUT" | ||
- if: ${{ steps.is-up-to-date.outputs.result != 'true' }} | ||
run: | | ||
git config --global user.name "jetstack-bot" | ||
git config --global user.email "[email protected]" | ||
git commit -a -m "BOT: run 'make upgrade-klone' and 'make generate'" | ||
git push -f origin self-upgrade | ||
- if: ${{ steps.is-up-to-date.outputs.result != 'true' }} | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const { repo, owner } = context.repo; | ||
const pulls = await github.rest.pulls.list({ | ||
owner: owner, | ||
repo: repo, | ||
head: 'self-upgrade', | ||
base: 'main', | ||
state: 'open', | ||
}); | ||
if (pulls.data.length < 1) { | ||
await github.rest.pulls.create({ | ||
title: '[CI] Merge self-upgrade into main', | ||
owner: owner, | ||
repo: repo, | ||
head: 'self-upgrade', | ||
base: 'main', | ||
body: [ | ||
'This PR is auto-generated to bump the Makefile modules.', | ||
].join('\n'), | ||
}); | ||
} |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.