Skip to content

Commit 46cb7a1

Browse files
authored
fix(ci): Update workflows to use release pipeline (#734)
Signed-off-by: Dan Webb <[email protected]>
1 parent c26d477 commit 46cb7a1

File tree

12 files changed

+468
-395
lines changed

12 files changed

+468
-395
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: conventional-commits
3+
4+
"on":
5+
pull_request:
6+
types:
7+
- opened
8+
- reopened
9+
- edited
10+
- synchronize
11+
12+
jobs:
13+
conventional-commits:
14+
uses: sous-chefs/.github/.github/workflows/[email protected]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: 'Copilot Setup Steps'
3+
4+
"on":
5+
workflow_dispatch:
6+
push:
7+
paths:
8+
- .github/workflows/copilot-setup-steps.yml
9+
pull_request:
10+
paths:
11+
- .github/workflows/copilot-setup-steps.yml
12+
13+
jobs:
14+
copilot-setup-steps:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v5
21+
- name: Install Chef
22+
uses: actionshub/chef-install@main
23+
- name: Install cookbooks
24+
run: berks install
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: prevent-file-change
3+
4+
"on":
5+
pull_request:
6+
types:
7+
- opened
8+
- reopened
9+
- edited
10+
- synchronize
11+
12+
jobs:
13+
prevent-file-change:
14+
uses: sous-chefs/.github/.github/workflows/[email protected]
15+
secrets:
16+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: release
3+
4+
"on":
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
pull-requests: write
13+
packages: write
14+
attestations: write
15+
id-token: write
16+
17+
jobs:
18+
release:
19+
uses: sous-chefs/.github/.github/workflows/[email protected]
20+
secrets:
21+
token: ${{ secrets.PORTER_GITHUB_TOKEN }}
22+
supermarket_user: ${{ secrets.CHEF_SUPERMARKET_USER }}
23+
supermarket_key: ${{ secrets.CHEF_SUPERMARKET_KEY }}

.markdownlint-cli2.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ config:
33
line-length: false # MD013
44
no-duplicate-heading: false # MD024
55
reference-links-images: false # MD052
6+
no-multiple-blanks:
7+
maximum: 2
68
ignores:
79
- .github/copilot-instructions.md

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "11.1.10"
3+
}

CHANGELOG.md

Lines changed: 365 additions & 386 deletions
Large diffs are not rendered by default.

libraries/helpers.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def defaults_file
5959
def default_data_dir
6060
return "/var/lib/#{mysql_name}" if node['os'] == 'linux'
6161
return "/opt/local/lib/#{mysql_name}" if platform_family?('solaris2')
62-
return "/var/db/#{mysql_name}" if platform_family?('freebsd')
62+
"/var/db/#{mysql_name}" if platform_family?('freebsd')
6363
end
6464

6565
def default_error_log
@@ -89,7 +89,7 @@ def default_major_version
8989
# misc
9090
return '5.6' if platform?('freebsd')
9191
return '5.7' if fedora?
92-
return '5.6' if suse?
92+
'5.6' if suse?
9393
end
9494

9595
def major_from_full(v)
@@ -143,11 +143,11 @@ def run_dir
143143
def prefix_dir
144144
return "/opt/mysql#{pkg_ver_string}" if platform_family?('omnios')
145145
return '/opt/local' if platform_family?('smartos')
146-
return "/opt/rh/#{scl_name}/root" if scl_package?
146+
"/opt/rh/#{scl_name}/root" if scl_package?
147147
end
148148

149149
def scl_name
150-
return unless platform_family?('rhel')
150+
nil unless platform_family?('rhel')
151151
end
152152

153153
def scl_package?

release-please-config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"packages": {
3+
".": {
4+
"package-name": "mysql",
5+
"changelog-path": "CHANGELOG.md",
6+
"release-type": "ruby",
7+
"include-component-in-tag": false,
8+
"version-file": "metadata.rb"
9+
}
10+
},
11+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
12+
}

resources/mysql_database.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@
6666
}.merge!(lsocket.nil? ? { host: host, port: port } : { socket: lsocket })
6767
query = "SHOW DATABASES LIKE '#{database_name}'"
6868
results = execute_sql(query, nil, ctrl).split("\n")
69-
current_value_does_not_exist! if results.count == 0
69+
current_value_does_not_exist! if results.none?
7070

7171
results = execute_sql("SELECT DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = '#{database_name}'", nil, ctrl)
7272
results.split("\n").each do |row|
7373
columns = row.split("\t")
74-
if columns[0] != 'DEFAULT_CHARACTER_SET_NAME'
75-
encoding columns[0]
74+
if columns.first != 'DEFAULT_CHARACTER_SET_NAME'
75+
encoding columns.first
7676
collation columns[1]
7777
end
7878
end

0 commit comments

Comments
 (0)