Skip to content

Commit 8836dc1

Browse files
jordanbreen28jordanbreen28
authored andcommitted
(maint) - Update release workflows to include module
1 parent 677e7f1 commit 8836dc1

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

.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)