Skip to content

Commit 4a83f93

Browse files
author
jordanbreen28
committed
(CONT-930) - Roll out gh-changelog
1 parent 6895a6e commit 4a83f93

File tree

3 files changed

+35
-7
lines changed

3 files changed

+35
-7
lines changed

.github/workflows/gem_release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,17 @@ jobs:
4848
run: |
4949
bundle exec rake build
5050
51+
- name: "Generate release notes"
52+
run: |
53+
export GH_HOST=github.com
54+
gh extension install chelnak/gh-changelog
55+
gh changelog get --latest > OUTPUT.md
56+
env:
57+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
5159
- name: "Create release"
5260
run: |
53-
gh release create v${{ steps.get_version.outputs.version }} ./pkg/*.gem --title v${{ steps.get_version.outputs.version }}
61+
gh release create v${{ steps.get_version.outputs.version }} ./pkg/*.gem --title v${{ steps.get_version.outputs.version }} -F OUTPUT.md
5462
env:
5563
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5664

.github/workflows/module_release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,17 @@ jobs:
3131
with:
3232
args: "build"
3333

34+
- name: "Generate release notes"
35+
run: |
36+
export GH_HOST=github.com
37+
gh extension install chelnak/gh-changelog
38+
gh changelog get --latest > OUTPUT.md
39+
env:
40+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
3442
- name: "Create release"
3543
run: |
36-
gh release create v${{ steps.get_version.outputs.version }} --title v${{ steps.get_version.outputs.version }}
44+
gh release create v${{ steps.get_version.outputs.version }} --title v${{ steps.get_version.outputs.version }} -F OUTPUT.md
3745
env:
3846
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3947

.github/workflows/module_release_prep.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ name: "Module Release Prep"
66

77
on:
88
workflow_call:
9+
inputs:
10+
version:
11+
description: "Module version to be released."
12+
required: true
13+
type: "string"
914

1015
jobs:
1116
release_prep:
@@ -19,12 +24,19 @@ jobs:
1924
with:
2025
fetch-depth: 0
2126

22-
- name: "PDK release prep"
23-
uses: "docker://puppet/pdk:nightly"
24-
with:
25-
args: 'release prep --force'
27+
- name: "Generate changelog"
28+
run: |
29+
export GH_HOST=github.com
30+
gh extension install chelnak/gh-changelog
31+
gh changelog new --next-version v${{ github.event.inputs.version }}
2632
env:
27-
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
- name: "Update metadata.json"
36+
run: |
37+
current_version=$(jq --raw-output .version metadata.json)
38+
# Update version in metadata.json, only matching first occurrence
39+
sed -i "0,/$current_version/s//${{ github.event.inputs.version }}/" $(find . -name 'metadata.json')
2840
2941
- name: "Get version"
3042
id: "get_version"

0 commit comments

Comments
 (0)