Skip to content

Commit f7c30a7

Browse files
authored
chore: update ci for v2 (#793)
* Reference the correct matrix variable * Update release drafter template * Update update-version workflow to handle multiple target branches * Update dependabot to handle both branches * Create pr branch from target branch
1 parent a17881d commit f7c30a7

File tree

5 files changed

+125
-34
lines changed

5 files changed

+125
-34
lines changed

.github/dependabot.yml

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,49 @@
11
version: 2
22
updates:
3+
# GitHub Actions - main branch
34
- package-ecosystem: "github-actions"
45
directory: "/"
6+
target-branch: "main"
57
schedule:
68
interval: "monthly"
79
labels:
8-
- 'skip-changelog'
9-
- 'dependencies'
10-
rebase-strategy: disabled
10+
- "skip-changelog"
11+
- "dependencies"
12+
rebase-strategy: "disabled"
1113

12-
- package-ecosystem: composer
14+
# GitHub Actions - v1.x branch
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
target-branch: "v1.x"
18+
schedule:
19+
interval: "monthly"
20+
labels:
21+
- "skip-changelog"
22+
- "dependencies"
23+
rebase-strategy: "disabled"
24+
25+
# Composer - main branch
26+
- package-ecosystem: "composer"
27+
directory: "/"
28+
target-branch: "main"
29+
schedule:
30+
interval: "monthly"
31+
time: "04:00"
32+
open-pull-requests-limit: 10
33+
labels:
34+
- "skip-changelog"
35+
- "dependencies"
36+
rebase-strategy: "disabled"
37+
38+
# Composer - v1.x branch
39+
- package-ecosystem: "composer"
1340
directory: "/"
41+
target-branch: "v1.x"
1442
schedule:
1543
interval: "monthly"
1644
time: "04:00"
1745
open-pull-requests-limit: 10
1846
labels:
19-
- skip-changelog
20-
- dependencies
21-
rebase-strategy: disabled
47+
- "skip-changelog"
48+
- "dependencies"
49+
rebase-strategy: "disabled"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name-template: "v$RESOLVED_VERSION 🔒"
2+
tag-template: "v$RESOLVED_VERSION"
3+
exclude-labels:
4+
- "skip-changelog"
5+
version-resolver:
6+
major:
7+
labels:
8+
- "breaking-change"
9+
minor:
10+
labels:
11+
- "enhancement"
12+
default: patch
13+
categories:
14+
- title: "⚠️ Breaking changes"
15+
label: "breaking-change"
16+
- title: "🚀 Enhancements"
17+
label: "enhancement"
18+
- title: "🐛 Bug Fixes"
19+
label: "bug"
20+
- title: "🔒 Security"
21+
label: "security"
22+
- title: "⚙️ Maintenance/misc"
23+
label:
24+
- "maintenance"
25+
- "documentation"
26+
template: |
27+
## What's Changed in v1.x
28+
29+
This is a maintenance release for the v1.x series. For the latest features and improvements, please consider upgrading to v2.x.
30+
31+
$CHANGES
32+
33+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
34+
35+
Thanks to all contributors! 🎉
36+
$CONTRIBUTORS
37+
no-changes-template: "Changes are coming soon 😎"
38+
sort-direction: "ascending"
39+
replacers:
40+
- search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
41+
replace: ""
42+
- search: '/(?:and )?@meili-bors(?:\[bot\])?,?/g'
43+
replace: ""
44+
- search: "/(?:and )?@meili-bot,?/g"
45+
replace: ""
46+
- search: '/(?:and )?@dependabot(?:\[bot\])?,?/g'
47+
replace: ""

.github/release-draft-template.yml

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
1-
name-template: 'v$RESOLVED_VERSION 🐘'
2-
tag-template: 'v$RESOLVED_VERSION'
1+
name-template: "v$RESOLVED_VERSION 🚀"
2+
tag-template: "v$RESOLVED_VERSION"
33
exclude-labels:
4-
- 'skip-changelog'
4+
- "skip-changelog"
55
version-resolver:
66
major:
77
labels:
8-
- 'breaking-change'
8+
- "breaking-change"
99
minor:
1010
labels:
11-
- 'enhancement'
11+
- "enhancement"
1212
default: patch
13+
# Set initial version for v2.x releases
14+
version-template: "2.0.0"
1315
categories:
14-
- title: '⚠️ Breaking changes'
15-
label: 'breaking-change'
16-
- title: '🚀 Enhancements'
17-
label: 'enhancement'
18-
- title: '🐛 Bug Fixes'
19-
label: 'bug'
20-
- title: '🔒 Security'
21-
label: 'security'
22-
- title: '⚙️ Maintenance/misc'
16+
- title: "⚠️ Breaking changes"
17+
label: "breaking-change"
18+
- title: "🚀 Enhancements"
19+
label: "enhancement"
20+
- title: "🐛 Bug Fixes"
21+
label: "bug"
22+
- title: "🔒 Security"
23+
label: "security"
24+
- title: "⚙️ Maintenance/misc"
2325
label:
24-
- 'maintenance'
25-
- 'documentation'
26+
- "maintenance"
27+
- "documentation"
2628
template: |
29+
## What's Changed
2730
$CHANGES
2831
29-
Thanks again to $CONTRIBUTORS! 🎉
30-
no-changes-template: 'Changes are coming soon 😎'
31-
sort-direction: 'ascending'
32+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
33+
34+
Thanks to all contributors! 🎉
35+
$CONTRIBUTORS
36+
no-changes-template: "Changes are coming soon 😎"
37+
sort-direction: "ascending"
3238
replacers:
3339
- search: '/(?:and )?@dependabot-preview(?:\[bot\])?,?/g'
34-
replace: ''
40+
replace: ""
3541
- search: '/(?:and )?@meili-bors(?:\[bot\])?,?/g'
36-
replace: ''
37-
- search: '/(?:and )?@meili-bot,?/g'
38-
replace: ''
42+
replace: ""
43+
- search: "/(?:and )?@meili-bot,?/g"
44+
replace: ""
3945
- search: '/(?:and )?@dependabot(?:\[bot\])?,?/g'
40-
replace: ''
46+
replace: ""

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ jobs:
1212
steps:
1313
- uses: release-drafter/release-drafter@v6
1414
with:
15-
config-name: release-draft-template.yml
15+
config-name: ${{ github.ref_name == 'v1.x' && 'release-draft-template-v1.yml' || 'release-draft-template.yml' }}
1616
env:
1717
GITHUB_TOKEN: ${{ secrets.RELEASE_DRAFTER_TOKEN }}

.github/workflows/update-version.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
new_version:
77
description: 'The new version (vX.Y.Z)'
88
required: true
9+
target_branch:
10+
description: 'Target branch for the version update'
11+
required: true
12+
type: choice
13+
options:
14+
- main
15+
- v1.x
916

1017
env:
1118
NEW_VERSION: ${{ github.event.inputs.new_version }}
@@ -18,6 +25,8 @@ jobs:
1825
runs-on: ubuntu-latest
1926
steps:
2027
- uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.inputs.target_branch }}
2130
- name: Update Meilisearch.php file
2231
run: |
2332
raw_new_version=$(echo $NEW_VERSION | cut -d 'v' -f 2)
@@ -28,10 +37,11 @@ jobs:
2837
with:
2938
message: "Update version for the next release (${{ env.NEW_VERSION }}) in Meilisearch.php"
3039
new_branch: ${{ env.NEW_BRANCH }}
31-
- name: Create the PR pointing to ${{ github.ref_name }}
40+
- name: Create the PR pointing to ${{ github.event.inputs.target_branch }}
3241
run: |
3342
gh pr create \
3443
--title "Update version for the next release ($NEW_VERSION)" \
3544
--body '⚠️ This PR is automatically generated. Check the new version is the expected one.' \
3645
--label 'skip-changelog' \
37-
--base $GITHUB_REF_NAME
46+
--base ${{ github.event.inputs.target_branch }} \
47+
--head ${{ env.NEW_BRANCH }}

0 commit comments

Comments
 (0)