@@ -2,91 +2,14 @@ name: "Auto release"
22
33on :
44 workflow_dispatch :
5-
6- env :
7- HONEYCOMB_WRITEKEY : 7f3c63a70eecc61d635917de46bea4e6
8- HONEYCOMB_DATASET : litmus tests
9- CHANGELOG_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5+ inputs :
6+ version :
7+ description : " Module version to be released. Must be a valid semver string. (1.2.3)"
8+ required : true
109
1110jobs :
12- auto_release :
13- name : " Automatic release prep"
14- runs-on : ubuntu-20.04
15-
16- steps :
17-
18- - name : " Honeycomb: Start recording"
19- uses : puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
20- with :
21- apikey : ${{ env.HONEYCOMB_WRITEKEY }}
22- dataset : ${{ env.HONEYCOMB_DATASET }}
23- job-status : ${{ job.status }}
24-
25- - name : " Honeycomb: start first step"
26- run : |
27- echo STEP_ID="auto-release" >> $GITHUB_ENV
28- echo STEP_START=$(date +%s) >> $GITHUB_ENV
29- - name : " Checkout Source"
30- if : ${{ github.repository_owner == 'puppetlabs' }}
31- uses : actions/checkout@v3
32- with :
33- fetch-depth : 0
34- persist-credentials : false
35-
36- # We use the dev tools image here because the PDK image does not have the
37- # build tools necessary to compile native extensions.
38- - name : " PDK Release prep"
39- uses : docker://puppet/puppet-dev-tools:4.x
40- with :
41- args : ' pdk release prep --force --debug'
42- env :
43- CHANGELOG_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
44-
45- - name : " Get Version"
46- if : ${{ github.repository_owner == 'puppetlabs' }}
47- id : gv
48- run : |
49- echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
50-
51- - name : " Check if a release is necessary"
52- if : ${{ github.repository_owner == 'puppetlabs' }}
53- id : check
54- run : |
55- git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true"
56-
57- - name : " Commit changes"
58- if : ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
59- run : |
60- git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
61- git config --local user.name "GitHub Action"
62- git add .
63- git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
64-
65- - name : Create Pull Request
66- id : cpr
67- uses : puppetlabs/peter-evans-create-pull-request@v3
68- if : ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
69- with :
70- token : ${{ secrets.GITHUB_TOKEN }}
71- commit-message : " Release prep v${{ steps.gv.outputs.ver }}"
72- branch : " release-prep"
73- delete-branch : true
74- title : " Release prep v${{ steps.gv.outputs.ver }}"
75- body : |
76- 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 }}.
77- Please verify before merging:
78- - [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
79- - [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
80- - [ ] 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
81- labels : " maintenance"
82-
83- - name : PR outputs
84- if : ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }}
85- run : |
86- echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
87- echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
88-
89- - name : " Honeycomb: Record finish step"
90- if : ${{ always() }}
91- run : |
92- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow'
11+ release_prep :
12+ uses : " puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main"
13+ with :
14+ version : " ${{ github.event.inputs.version }}"
15+ secrets : " inherit"
0 commit comments