Skip to content

Commit d52a649

Browse files
authored
Merge pull request #221 from puppetlabs/CAT-1172-add_puppet8_support
(CAT-1172) - Add Puppet 8 Support/Drop Puppet 6 Support
2 parents ccf3fe7 + 8836dc1 commit d52a649

File tree

7 files changed

+76
-319
lines changed

7 files changed

+76
-319
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- ruby_version: '2.7'
1919
puppet_version: '~> 7.0'
2020
- ruby_version: '3.2'
21-
puppet_version: 'https://github.com/puppetlabs/puppet'
21+
puppet_version: '~> 8.0'
2222
name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }})"
2323
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
2424
secrets: "inherit"
@@ -37,7 +37,7 @@ jobs:
3737
- ruby-version: '2.7'
3838
puppet_version: '~> 7.0'
3939
- ruby_version: '3.2'
40-
puppet_version: 'https://github.com/puppetlabs/puppet' # puppet8'
40+
puppet_version: '~> 8.0'
4141
runs_on:
4242
- "windows-latest"
4343
name: "acceptance (${{ matrix.runs_on}} ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }})"

.github/workflows/custom_acceptance.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
puppet_version:
1919
description: "The target Puppet version."
2020
required: false
21-
default: "puppet7-nightly"
21+
default: "puppet8"
2222
type: "string"
2323
rake_task:
2424
description: "The name of the rake task that executes acceptance tests"
@@ -36,17 +36,14 @@ jobs:
3636
name: "acceptance"
3737
runs-on: ${{ inputs.runs_on }}
3838

39-
env:
40-
PUPPET_GEM_VERSION: ${{ inputs.puppet_version }}
41-
4239
steps:
4340

4441
- name: "checkout"
4542
uses: "actions/checkout@v3"
4643

4744
- name: "export environment"
4845
run: |
49-
echo "PUPPET_GEM_VERSION=${{ inputs.puppet_gem_version }} >> $GITHUB_ENV"
46+
echo "PUPPET_GEM_VERSION=${{ inputs.puppet_version }} >> $GITHUB_ENV"
5047
5148
- name: "setup ruby"
5249
uses: "ruby/setup-ruby@v1"

.github/workflows/nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- ruby_version: '2.7'
1818
puppet_version: '~> 7.0'
1919
- ruby_version: '3.2'
20-
puppet_version: 'https://github.com/puppetlabs/puppet'
20+
puppet_version: '~> 8.0'
2121
name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }})"
2222
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
2323
secrets: "inherit"
@@ -36,7 +36,7 @@ jobs:
3636
- ruby-version: '2.7'
3737
puppet_version: '~> 7.0'
3838
- ruby_version: '3.2'
39-
puppet_version: 'https://github.com/puppetlabs/puppet' # puppet8'
39+
puppet_version: '~> 8.0'
4040
runs_on:
4141
- "windows-latest"
4242
name: "acceptance (${{ matrix.runs_on}} ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }})"

.github/workflows/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,26 @@ jobs:
1414
with:
1515
target: "${{ github.event.inputs.target }}"
1616
secrets: "inherit"
17+
18+
module_release:
19+
needs: gem_release
20+
runs-on: "ubuntu-latest"
21+
22+
steps:
23+
24+
- name: "Checkout"
25+
uses: "actions/checkout@v3"
26+
with:
27+
ref: "${{ github.ref }}"
28+
clean: true
29+
fetch-depth: 0
30+
31+
- name: "PDK build"
32+
uses: "docker://puppet/pdk:3.0.0.0"
33+
with:
34+
args: "build"
35+
36+
- name: "Publish module"
37+
uses: "docker://puppet/pdk:3.0.0.0"
38+
with:
39+
args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'

.github/workflows/release_prep.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,49 @@ jobs:
1818
target: "${{ github.event.inputs.target }}"
1919
version: "${{ github.event.inputs.version }}"
2020
secrets: "inherit"
21+
22+
module_release_prep:
23+
needs: gem_release_prep
24+
runs-on: "ubuntu-latest"
25+
26+
steps:
27+
28+
- name: "Checkout"
29+
uses: "actions/checkout@v3"
30+
with:
31+
fetch-depth: 0
32+
33+
- name: "Update metadata.json"
34+
run: |
35+
current_version=$(jq --raw-output .version metadata.json)
36+
# Update version in metadata.json, only matching first occurrence
37+
sed -i "0,/$current_version/s//${{ github.event.inputs.version }}/" $(find . -name 'metadata.json')
38+
39+
- name: "Get version"
40+
id: "get_version"
41+
run: |
42+
echo "version=$(jq --raw-output .version metadata.json)" >> $GITHUB_OUTPUT
43+
44+
- name: "Commit changes"
45+
run: |
46+
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
47+
git config --local user.name "GitHub Actions"
48+
git add .
49+
git commit -m "Module Release prep v${{ steps.get_version.outputs.version }}"
50+
51+
- name: "Create pull Request"
52+
uses: "peter-evans/create-pull-request@v5"
53+
with:
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
commit-message: "Module Release prep v${{ steps.get_version.outputs.version }}"
56+
branch: "release-prep"
57+
delete-branch: true
58+
title: "Release prep v${{ steps.get_version.outputs.version }}"
59+
base: "main"
60+
body: |
61+
Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}.
62+
Please verify before merging:
63+
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
64+
- [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
65+
- [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match
66+
labels: "maintenance"

0 commit comments

Comments
 (0)