Release Prep #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Release Prep" | |
on: | |
workflow_dispatch: | |
inputs: | |
target: | |
description: "The target for the release. This can be a commit sha or a branch." | |
required: false | |
default: "main" | |
version: | |
description: "Version of gem to be released." | |
required: true | |
jobs: | |
gem_release_prep: | |
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_release_prep.yml@main" | |
with: | |
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" |