Skip to content

Commit 15b5e98

Browse files
authored
Merge pull request #1747 from erikgb/manual-self-upgrade
Manual self upgrade
2 parents 853323a + 7b35910 commit 15b5e98

File tree

9 files changed

+327
-20
lines changed

9 files changed

+327
-20
lines changed

.github/dependabot.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44
# Update Go dependencies and GitHub Actions dependencies daily.
55
version: 2
66
updates:
7-
- package-ecosystem: gomod
8-
directory: /
9-
schedule:
10-
interval: daily
11-
groups:
12-
all-go-deps:
13-
patterns: ["*"]
147
- package-ecosystem: github-actions
158
directory: /
169
schedule:
1710
interval: daily
11+
exclude-paths: # Exclude files that are mastered from makefile-modules and shouldn't be upgraded in projects using makefile-modules.
12+
- .github/workflows/govulncheck.yaml
13+
- .github/workflows/make-self-upgrade.yaml
14+
- .github/workflows/renovate.yaml
1815
groups:
1916
all-gh-actions:
2017
patterns: ["*"]
18+
labels:
19+
- dependencies
20+
- kind/cleanup
21+
- release-note-none
22+
- ok-to-test

.github/renovate.json5

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
2+
// Edit https://github.com/cert-manager/makefile-modules/blob/main/modules/repository-base/base-dependabot/.github/renovate.json5 instead.
3+
4+
{
5+
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
6+
enabled: true,
7+
enabledManagers: [
8+
'gomod',
9+
],
10+
separateMajorMinor: false,
11+
extends: [
12+
'config:best-practices',
13+
':gitSignOff',
14+
':semanticCommits',
15+
':disableVulnerabilityAlerts',
16+
':prConcurrentLimit10', // Set a limit to avoid too many PRs, at least on the first run
17+
':prHourlyLimitNone',
18+
],
19+
timezone: 'Europe/London',
20+
labels: [
21+
'dependencies',
22+
'kind/cleanup',
23+
'release-note-none',
24+
],
25+
postUpgradeTasks: {
26+
commands: [
27+
'make generate',
28+
],
29+
executionMode: 'branch',
30+
},
31+
packageRules: [
32+
{
33+
groupName: 'Misc Go deps',
34+
matchManagers: [
35+
'gomod',
36+
],
37+
matchPackageNames: [
38+
'*',
39+
],
40+
},
41+
{
42+
groupName: 'Kubernetes Go deps',
43+
matchManagers: [
44+
'gomod',
45+
],
46+
matchPackageNames: [
47+
'sigs.k8s.io**/**',
48+
'k8s.io**/**',
49+
],
50+
},
51+
{
52+
groupName: 'Cloud Go deps',
53+
matchManagers: [
54+
'gomod',
55+
],
56+
matchPackageNames: [
57+
'github.com/akamai**/**',
58+
'github.com/aws**/**',
59+
'github.com/Azure**/**',
60+
'github.com/AzureAD**/**',
61+
'github.com/cloudflare**/**',
62+
'github.com/digitalocean**/**',
63+
'google.golang.org/api',
64+
],
65+
},
66+
{
67+
groupName: 'golang.org/x deps',
68+
matchManagers: [
69+
'gomod',
70+
],
71+
matchPackageNames: [
72+
'golang.org/x**/*',
73+
],
74+
addLabels: [
75+
'skip-review', // Adding label to allow PRs to automerge
76+
],
77+
},
78+
{
79+
description: 'Disable Go pseudo-version updates',
80+
matchManagers: [
81+
'gomod',
82+
],
83+
matchPackageNames: [
84+
'*',
85+
],
86+
matchCurrentValue: 'v0.0.0*',
87+
enabled: false,
88+
},
89+
],
90+
ignorePaths: [
91+
'**/vendor/**',
92+
],
93+
}

.github/workflows/renovate.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
2+
# Edit https://github.com/cert-manager/makefile-modules/blob/main/modules/repository-base/base-dependabot/.github/workflows/renovate.yaml instead.
3+
4+
name: Renovate
5+
on:
6+
workflow_dispatch: {}
7+
schedule:
8+
- cron: '0 2 * * *'
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
renovate:
15+
runs-on: ubuntu-latest
16+
17+
if: github.repository == 'cert-manager/website'
18+
19+
permissions:
20+
contents: write
21+
issues: write
22+
statuses: write
23+
pull-requests: write
24+
25+
steps:
26+
- name: Fail if branch is not head of branch.
27+
if: ${{ !startsWith(github.ref, 'refs/heads/') && env.SOURCE_BRANCH != '' && env.SELF_UPGRADE_BRANCH != '' }}
28+
run: |
29+
echo "This workflow should not be run on a non-branch-head."
30+
exit 1
31+
32+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
33+
# Adding `fetch-depth: 0` makes sure tags are also fetched. We need
34+
# the tags so `git describe` returns a valid version.
35+
# see https://github.com/actions/checkout/issues/701 for extra info about this option
36+
with: { fetch-depth: 0 }
37+
38+
- id: go-version
39+
run: |
40+
make print-go-version >> "$GITHUB_OUTPUT"
41+
42+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
43+
with:
44+
go-version: ${{ steps.go-version.outputs.result }}
45+
46+
- name: Self-hosted Renovate
47+
uses: renovatebot/github-action@b11417b9eaac3145fe9a8544cee66503724e32b6 # v43.0.8
48+
with:
49+
configurationFile: .github/renovate.json5
50+
token: ${{ secrets.GITHUB_TOKEN }}
51+
env:
52+
RENOVATE_REPOSITORIES: '["${{ github.repository }}"]'
53+
RENOVATE_ONBOARDING: "false"
54+
RENOVATE_PLATFORM: "github"
55+
LOG_LEVEL: "debug"
56+
RENOVATE_ALLOWED_COMMANDS: '["make generate"]'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public/feed.*
5050

5151
# IntelliJ
5252
.idea
53+
*.iml
5354

5455
# Our release-process.md tells us to run 'sed' commands that create .bak files.
5556
*.bak

klone.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,30 @@ targets:
1010
- folder_name: boilerplate
1111
repo_url: https://github.com/cert-manager/makefile-modules.git
1212
repo_ref: main
13-
repo_hash: 8837533393f5309a1f6ce4cc09641c26d50cef5d
13+
repo_hash: 63051131d09a2665195d8a045b1a07034468fe20
1414
repo_path: modules/boilerplate
1515
- folder_name: generate-verify
1616
repo_url: https://github.com/cert-manager/makefile-modules.git
1717
repo_ref: main
18-
repo_hash: 8837533393f5309a1f6ce4cc09641c26d50cef5d
18+
repo_hash: 63051131d09a2665195d8a045b1a07034468fe20
1919
repo_path: modules/generate-verify
2020
- folder_name: help
2121
repo_url: https://github.com/cert-manager/makefile-modules.git
2222
repo_ref: main
23-
repo_hash: 8837533393f5309a1f6ce4cc09641c26d50cef5d
23+
repo_hash: 63051131d09a2665195d8a045b1a07034468fe20
2424
repo_path: modules/help
2525
- folder_name: klone
2626
repo_url: https://github.com/cert-manager/makefile-modules.git
2727
repo_ref: main
28-
repo_hash: 8837533393f5309a1f6ce4cc09641c26d50cef5d
28+
repo_hash: 63051131d09a2665195d8a045b1a07034468fe20
2929
repo_path: modules/klone
3030
- folder_name: repository-base
3131
repo_url: https://github.com/cert-manager/makefile-modules.git
3232
repo_ref: main
33-
repo_hash: 8837533393f5309a1f6ce4cc09641c26d50cef5d
33+
repo_hash: 63051131d09a2665195d8a045b1a07034468fe20
3434
repo_path: modules/repository-base
3535
- folder_name: tools
3636
repo_url: https://github.com/cert-manager/makefile-modules.git
3737
repo_ref: main
38-
repo_hash: 8837533393f5309a1f6ce4cc09641c26d50cef5d
38+
repo_hash: 63051131d09a2665195d8a045b1a07034468fe20
3939
repo_path: modules/tools

make/_shared/repository-base/01_mod.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ generate-base:
4040
sed "s|{{REPLACE:GH-REPOSITORY}}|$(repo_name:github.com/%=%)|g" "$$file" > "$(CURDIR)/$$file"; \
4141
done
4242
cp -r $(repository_base_dependabot_dir)/. ./
43+
cd $(repository_base_dependabot_dir) && \
44+
find . -type f | while read file; do \
45+
sed "s|{{REPLACE:GH-REPOSITORY}}|$(repo_name:github.com/%=%)|g" "$$file" > "$(CURDIR)/$$file"; \
46+
done
4347
endif
4448

4549
shared_generate_targets += generate-base

make/_shared/repository-base/base-dependabot/.github/dependabot.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44
# Update Go dependencies and GitHub Actions dependencies daily.
55
version: 2
66
updates:
7-
- package-ecosystem: gomod
8-
directory: /
9-
schedule:
10-
interval: daily
11-
groups:
12-
all-go-deps:
13-
patterns: ["*"]
147
- package-ecosystem: github-actions
158
directory: /
169
schedule:
1710
interval: daily
11+
exclude-paths: # Exclude files that are mastered from makefile-modules and shouldn't be upgraded in projects using makefile-modules.
12+
- .github/workflows/govulncheck.yaml
13+
- .github/workflows/make-self-upgrade.yaml
14+
- .github/workflows/renovate.yaml
1815
groups:
1916
all-gh-actions:
2017
patterns: ["*"]
18+
labels:
19+
- dependencies
20+
- kind/cleanup
21+
- release-note-none
22+
- ok-to-test
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
2+
// Edit https://github.com/cert-manager/makefile-modules/blob/main/modules/repository-base/base-dependabot/.github/renovate.json5 instead.
3+
4+
{
5+
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
6+
enabled: true,
7+
enabledManagers: [
8+
'gomod',
9+
],
10+
separateMajorMinor: false,
11+
extends: [
12+
'config:best-practices',
13+
':gitSignOff',
14+
':semanticCommits',
15+
':disableVulnerabilityAlerts',
16+
':prConcurrentLimit10', // Set a limit to avoid too many PRs, at least on the first run
17+
':prHourlyLimitNone',
18+
],
19+
timezone: 'Europe/London',
20+
labels: [
21+
'dependencies',
22+
'kind/cleanup',
23+
'release-note-none',
24+
],
25+
postUpgradeTasks: {
26+
commands: [
27+
'make generate',
28+
],
29+
executionMode: 'branch',
30+
},
31+
packageRules: [
32+
{
33+
groupName: 'Misc Go deps',
34+
matchManagers: [
35+
'gomod',
36+
],
37+
matchPackageNames: [
38+
'*',
39+
],
40+
},
41+
{
42+
groupName: 'Kubernetes Go deps',
43+
matchManagers: [
44+
'gomod',
45+
],
46+
matchPackageNames: [
47+
'sigs.k8s.io**/**',
48+
'k8s.io**/**',
49+
],
50+
},
51+
{
52+
groupName: 'Cloud Go deps',
53+
matchManagers: [
54+
'gomod',
55+
],
56+
matchPackageNames: [
57+
'github.com/akamai**/**',
58+
'github.com/aws**/**',
59+
'github.com/Azure**/**',
60+
'github.com/AzureAD**/**',
61+
'github.com/cloudflare**/**',
62+
'github.com/digitalocean**/**',
63+
'google.golang.org/api',
64+
],
65+
},
66+
{
67+
groupName: 'golang.org/x deps',
68+
matchManagers: [
69+
'gomod',
70+
],
71+
matchPackageNames: [
72+
'golang.org/x**/*',
73+
],
74+
addLabels: [
75+
'skip-review', // Adding label to allow PRs to automerge
76+
],
77+
},
78+
{
79+
description: 'Disable Go pseudo-version updates',
80+
matchManagers: [
81+
'gomod',
82+
],
83+
matchPackageNames: [
84+
'*',
85+
],
86+
matchCurrentValue: 'v0.0.0*',
87+
enabled: false,
88+
},
89+
],
90+
ignorePaths: [
91+
'**/vendor/**',
92+
],
93+
}

0 commit comments

Comments
 (0)