Skip to content

Commit bf95c1d

Browse files
authored
fix(ci): Update workflows to use release pipeline (#120)
Signed-off-by: Dan Webb <dan.webb@damacus.io>
1 parent ba5273b commit bf95c1d

File tree

10 files changed

+169
-87
lines changed

10 files changed

+169
-87
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/conventional-commits.yml@5.0.3
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/prevent-file-change.yml@5.0.3
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/release-cookbook.yml@5.0.3
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +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
8+
ignores:
9+
- .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+
".": "4.2.8"
3+
}

CHANGELOG.md

Lines changed: 68 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,151 @@
11
# pyenv Changelog
22

3-
## Unreleased
4-
5-
## 4.2.8 - *2025-09-04*
6-
7-
## 4.2.7 - *2024-05-03*
8-
9-
## 4.2.6 - *2024-05-03*
10-
11-
## 4.2.5 - *2023-10-03*
12-
13-
## 4.2.4 - *2023-09-29*
14-
15-
## 4.2.3 - *2023-06-08*
16-
173
## 4.2.2 - *2023-06-08*
184

195
Standardise files with files in sous-chefs/repo-management
206

217
## 4.2.1 - *2023-02-02*
228

23-
- Update `templates/pyenv.sh` script to properly evaluate when to add a user install to `$PATH`
9+
* Update `templates/pyenv.sh` script to properly evaluate when to add a user install to `$PATH`
2410

2511
## 4.2.0 - *2022-09-26*
2612

27-
- Add support for ubuntu >= 22.04 and debian >= 11
13+
* Add support for ubuntu >= 22.04 and debian >= 11
2814

2915
## 4.1.0 - *2022-07-20*
3016

31-
- Remove duplicate pyenv init from profile script, fixes "pyenv: cannot rehash: <...>/shims isn't writable" for system install
17+
* Remove duplicate pyenv init from profile script, fixes "pyenv: cannot rehash: <...>/shims isn't writable" for system install
3218

3319
## 4.0.1 - *2022-02-08*
3420

35-
- Remove delivery folder
21+
* Remove delivery folder
3622

3723
## 4.0.0 - *2021-12-20*
3824

39-
- Set unified_mode for Chef 17 support
40-
- Require Chef 15.3 for unified_mode
41-
- Fix pyenv not being on the path properly
42-
- resolved cookstyle error: resources/global.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
43-
- resolved cookstyle error: resources/pip.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
44-
- resolved cookstyle error: resources/plugin.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
45-
- resolved cookstyle error: resources/python.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
46-
- resolved cookstyle error: resources/rehash.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
47-
- resolved cookstyle error: resources/script.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
48-
- resolved cookstyle error: resources/system_install.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
49-
- resolved cookstyle error: resources/user_install.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
50-
- Removed the pyenv_system_install and pyenv_user_install resources for a singular pyenv_install.
51-
52-
- This resource acts like all other resources where it can install both as a user and system wide.
25+
* Set unified_mode for Chef 17 support
26+
* Require Chef 15.3 for unified_mode
27+
* Fix pyenv not being on the path properly
28+
* resolved cookstyle error: resources/global.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
29+
* resolved cookstyle error: resources/pip.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
30+
* resolved cookstyle error: resources/plugin.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
31+
* resolved cookstyle error: resources/python.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
32+
* resolved cookstyle error: resources/rehash.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
33+
* resolved cookstyle error: resources/script.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
34+
* resolved cookstyle error: resources/system_install.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
35+
* resolved cookstyle error: resources/user_install.rb:1:1 refactor: `Chef/Deprecations/ResourceWithoutUnifiedTrue`
36+
* Removed the pyenv_system_install and pyenv_user_install resources for a singular pyenv_install.
37+
38+
* This resource acts like all other resources where it can install both as a user and system wide.
5339
Please see the documentation for further information.
5440

5541
## 3.5.1 - *2021-08-30*
5642

57-
- Standardise files with files in sous-chefs/repo-management
43+
* Standardise files with files in sous-chefs/repo-management
5844

5945
## 3.5.0 - *2021-07-22*
6046

61-
- Add support for setting umask for pip resource.
47+
* Add support for setting umask for pip resource.
6248

6349
## 3.4.2 - *2021-06-01*
6450

65-
- Standardise files with files in sous-chefs/repo-management
51+
* Standardise files with files in sous-chefs/repo-management
6652

6753
## 3.4.1 - *2020-12-31*
6854

69-
- resolved cookstyle error: resources/pip.rb:153:1 convention: `Layout/TrailingEmptyLines`
55+
* resolved cookstyle error: resources/pip.rb:153:1 convention: `Layout/TrailingEmptyLines`
7056

7157
## 3.4.0 (2020-11-05)
7258

73-
- Add `:upgrade` action to the pyenv_pip resource
59+
* Add `:upgrade` action to the pyenv_pip resource
7460

7561
## 3.3.2 (2020-08-05)
7662

77-
- Do not attempt to rehash in a system-wide install
78-
- Removed testing support for centos-6. Python 3.7.1 requires a newer version of openssl than centos-6 supplies.
79-
- Removed testing support for debian-8. Debian-8 is no longer supported. Also has issues with the level of openssl that is available.
63+
* Do not attempt to rehash in a system-wide install
64+
* Removed testing support for centos-6. Python 3.7.1 requires a newer version of openssl than centos-6 supplies.
65+
* Removed testing support for debian-8. Debian-8 is no longer supported. Also has issues with the level of openssl that is available.
8066

8167
## 3.3.1
8268

83-
- Namespace the run_state variables used in the resources
69+
* Namespace the run_state variables used in the resources
8470

8571
## 3.3.0
8672

87-
- Chef 16 removed defaults for checkout_branch from the git resource, restore them to the previous default 'deploy'
73+
* Chef 16 removed defaults for checkout_branch from the git resource, restore them to the previous default 'deploy'
8874

8975
## 3.2.0
9076

91-
- resolved cookstyle error: resources/pip.rb:107:7 convention: `Style/RedundantReturn`
92-
- resolved cookstyle error: resources/pip.rb:110:7 convention: `Style/RedundantReturn`
93-
- Migrate to actions for builds
94-
- Fix broken link in README
95-
- Follow up tweaks after ownership migration
77+
* resolved cookstyle error: resources/pip.rb:107:7 convention: `Style/RedundantReturn`
78+
* resolved cookstyle error: resources/pip.rb:110:7 convention: `Style/RedundantReturn`
79+
* Migrate to actions for builds
80+
* Fix broken link in README
81+
* Follow up tweaks after ownership migration
9682

9783
## 3.1.1
9884

99-
- Migrated ownership to Sous-Chefs
100-
- Latest cookstyle fixes (5.9.3)
85+
* Migrated ownership to Sous-Chefs
86+
* Latest cookstyle fixes (5.9.3)
10187

10288
## 3.1.0
10389

104-
- invoke `pip install` only necessary #34
90+
* invoke `pip install` only necessary #34
10591

10692
## 3.0.0
10793

108-
- deprecate support for Chef 13 due to [EOL][supported-versions]
109-
- update cookbook to use `apt_update` and `build_essential` resources from Chef 14 make sure builds don't failed because of lack of packages
94+
* deprecate support for Chef 13 due to [EOL][supported-versions]
95+
* update cookbook to use `apt_update` and `build_essential` resources from Chef 14 make sure builds don't failed because of lack of packages
11096

11197
## 2.1.0
11298

113-
- add support for virtualenv installation and uninstallation.
114-
- add support for passing environment variable during pyenv, python and plugin installation.
115-
- delete "reinstall" property from pip resource and replace it with general "options" property
116-
- make pyenv_script fail on any subcommand failure
99+
* add support for virtualenv installation and uninstallation.
100+
* add support for passing environment variable during pyenv, python and plugin installation.
101+
* delete "reinstall" property from pip resource and replace it with general "options" property
102+
* make pyenv_script fail on any subcommand failure
117103

118104
Thanks to [@ssps](https://github.com/ssps)!
119105

120106
## 2.0.0
121107

122-
- Dropping support for Chef 12
108+
* Dropping support for Chef 12
123109

124110
## 1.0.0 (BREAKING CHANGES!!)
125111

126-
- Refactor and update the legacy code base. Recipes are no longer provided, and custom resources are used to manage pyenv installations instead.
127-
- update `system_install` to be a resource
128-
- update `user_install` to be a resource
129-
- update `script` resource
130-
- update `python` resource
131-
- update `global` resource
132-
- update `rehash` resource
133-
- create `plugin` resource
134-
- create `pip` resource
135-
- update integration tests
136-
- add linting to CI
137-
- delete all recipes
138-
- delete matchers
139-
- delete `chef_pyenv_recipe_helpers` library
140-
- delete `chef_pyenv_mixin` library
141-
- add support for Fedora, RedHat distros and OpenSUSE
112+
* Refactor and update the legacy code base. Recipes are no longer provided, and custom resources are used to manage pyenv installations instead.
113+
* update `system_install` to be a resource
114+
* update `user_install` to be a resource
115+
* update `script` resource
116+
* update `python` resource
117+
* update `global` resource
118+
* update `rehash` resource
119+
* create `plugin` resource
120+
* create `pip` resource
121+
* update integration tests
122+
* add linting to CI
123+
* delete all recipes
124+
* delete matchers
125+
* delete `chef_pyenv_recipe_helpers` library
126+
* delete `chef_pyenv_mixin` library
127+
* add support for Fedora, RedHat distros and OpenSUSE
142128

143129
## 0.2.0
144130

145-
- Add oracle linux support
146-
- Update syntax for chef-client v13
147-
- Update gems and dependencies
148-
- Add integration tests on travis
131+
* Add oracle linux support
132+
* Update syntax for chef-client v13
133+
* Update gems and dependencies
134+
* Add integration tests on travis
149135

150136
## 0.1.4
151137

152-
- Updated deprecated methods used in attributes.rb
138+
* Updated deprecated methods used in attributes.rb
153139

154140
## 0.1.0
155141

156-
- Update default pyenv version to v0.4.0-20140516
157-
- Add support for CentOS 6.5
158-
- Install `make`, `build-essential`, `libssl-dev`, `zlib1g-dev`, `wget`,
142+
* Update default pyenv version to v0.4.0-20140516
143+
* Add support for CentOS 6.5
144+
* Install `make`, `build-essential`, `libssl-dev`, `zlib1g-dev`, `wget`,
159145
`curl`, and `llvm` on Debian machines
160146

161147
## 0.0.1
162148

163-
- Initial port of [chef-rbenv](https://github.com/fnichol/chef-rbenv)
149+
* Initial port of [chef-rbenv](https://github.com/fnichol/chef-rbenv)
164150

165151
[supported-versions]: https://docs.chef.io/platforms.html#supported-versions

libraries/helpers.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ def pip_command(command)
5252

5353
def pyenv_prerequisites
5454
value_for_platform_family(
55-
'debian' => %w(make libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git) \
55+
'debian' => %w(make libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev git) \
5656
<< value_for_platform(
5757
'debian' => { '>= 11' => 'python3-openssl', 'default' => 'python-openssl' },
5858
'ubuntu' => { '>= 22.04' => 'python3-openssl', 'default' => 'python-openssl' },
5959
'default' => 'python-openssl'
6060
),
61-
%w(rhel fedora amazon) => %w(git zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel xz xz-devel libffi-devel findutils),
61+
%w(rhel fedora amazon) => %w(git zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel xz xz-devel libffi-devel findutils),
6262
'suse' => %w(git git-core zlib-devel bzip2 libbz2-devel libopenssl-devel readline-devel sqlite3 sqlite3-devel xz xz-devel),
6363
'mac_os_x' => %w(git readline xz)
6464
)

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": "pyenv",
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/python.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
command = %(pyenv install #{verbose} #{new_resource.version})
2626

27-
pyenv_script "#{command}" do
27+
pyenv_script command.to_s do
2828
code command
2929
user new_resource.user
3030
environment new_resource.environment
@@ -39,7 +39,7 @@
3939
action :uninstall do
4040
command = %(pyenv uninstall -f #{new_resource.version})
4141

42-
pyenv_script "#{command}" do
42+
pyenv_script command.to_s do
4343
code command
4444
user new_resource.user
4545
environment new_resource.environment
@@ -57,6 +57,6 @@ def python_installed?
5757
end
5858

5959
def verbose
60-
return '-v' if new_resource.verbose
60+
'-v' if new_resource.verbose
6161
end
6262
end

0 commit comments

Comments
 (0)