Skip to content

Commit

Permalink
Merge pull request #221 from puppetlabs/CAT-1172-add_puppet8_support
Browse files Browse the repository at this point in the history
(CAT-1172) - Add Puppet 8 Support/Drop Puppet 6 Support
  • Loading branch information
GSPatton authored Aug 16, 2023
2 parents ccf3fe7 + 8836dc1 commit d52a649
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 319 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- ruby_version: '2.7'
puppet_version: '~> 7.0'
- ruby_version: '3.2'
puppet_version: 'https://github.com/puppetlabs/puppet'
puppet_version: '~> 8.0'
name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }})"
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
secrets: "inherit"
Expand All @@ -37,7 +37,7 @@ jobs:
- ruby-version: '2.7'
puppet_version: '~> 7.0'
- ruby_version: '3.2'
puppet_version: 'https://github.com/puppetlabs/puppet' # puppet8'
puppet_version: '~> 8.0'
runs_on:
- "windows-latest"
name: "acceptance (${{ matrix.runs_on}} ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }})"
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/custom_acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
puppet_version:
description: "The target Puppet version."
required: false
default: "puppet7-nightly"
default: "puppet8"
type: "string"
rake_task:
description: "The name of the rake task that executes acceptance tests"
Expand All @@ -36,17 +36,14 @@ jobs:
name: "acceptance"
runs-on: ${{ inputs.runs_on }}

env:
PUPPET_GEM_VERSION: ${{ inputs.puppet_version }}

steps:

- name: "checkout"
uses: "actions/checkout@v3"

- name: "export environment"
run: |
echo "PUPPET_GEM_VERSION=${{ inputs.puppet_gem_version }} >> $GITHUB_ENV"
echo "PUPPET_GEM_VERSION=${{ inputs.puppet_version }} >> $GITHUB_ENV"
- name: "setup ruby"
uses: "ruby/setup-ruby@v1"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- ruby_version: '2.7'
puppet_version: '~> 7.0'
- ruby_version: '3.2'
puppet_version: 'https://github.com/puppetlabs/puppet'
puppet_version: '~> 8.0'
name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }})"
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
secrets: "inherit"
Expand All @@ -36,7 +36,7 @@ jobs:
- ruby-version: '2.7'
puppet_version: '~> 7.0'
- ruby_version: '3.2'
puppet_version: 'https://github.com/puppetlabs/puppet' # puppet8'
puppet_version: '~> 8.0'
runs_on:
- "windows-latest"
name: "acceptance (${{ matrix.runs_on}} ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }})"
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,26 @@ jobs:
with:
target: "${{ github.event.inputs.target }}"
secrets: "inherit"

module_release:
needs: gem_release
runs-on: "ubuntu-latest"

steps:

- name: "Checkout"
uses: "actions/checkout@v3"
with:
ref: "${{ github.ref }}"
clean: true
fetch-depth: 0

- name: "PDK build"
uses: "docker://puppet/pdk:3.0.0.0"
with:
args: "build"

- name: "Publish module"
uses: "docker://puppet/pdk:3.0.0.0"
with:
args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'
46 changes: 46 additions & 0 deletions .github/workflows/release_prep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,49 @@ jobs:
target: "${{ github.event.inputs.target }}"
version: "${{ github.event.inputs.version }}"
secrets: "inherit"

module_release_prep:
needs: gem_release_prep
runs-on: "ubuntu-latest"

steps:

- name: "Checkout"
uses: "actions/checkout@v3"
with:
fetch-depth: 0

- name: "Update metadata.json"
run: |
current_version=$(jq --raw-output .version metadata.json)
# Update version in metadata.json, only matching first occurrence
sed -i "0,/$current_version/s//${{ github.event.inputs.version }}/" $(find . -name 'metadata.json')
- name: "Get version"
id: "get_version"
run: |
echo "version=$(jq --raw-output .version metadata.json)" >> $GITHUB_OUTPUT
- name: "Commit changes"
run: |
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
git config --local user.name "GitHub Actions"
git add .
git commit -m "Module Release prep v${{ steps.get_version.outputs.version }}"
- name: "Create pull Request"
uses: "peter-evans/create-pull-request@v5"
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Module Release prep v${{ steps.get_version.outputs.version }}"
branch: "release-prep"
delete-branch: true
title: "Release prep v${{ steps.get_version.outputs.version }}"
base: "main"
body: |
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 }}.
Please verify before merging:
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
- [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
- [ ] 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
labels: "maintenance"
Loading

0 comments on commit d52a649

Please sign in to comment.