66 workflow_dispatch :
77
88env :
9- HONEYCOMB_WRITEKEY : 7f3c63a70eecc61d635917de46bea4e6
9+ HONEYCOMB_WRITEKEY : 7f3c63a70eecc61d635917de46bea4e6
1010 HONEYCOMB_DATASET : litmus tests
1111 SERVICE_URL : https://facade-main-6f3kfepqcq-ew.a.run.app/v1/provision
1212 CHANGELOG_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1818
1919 steps :
2020 - name : " Honeycomb: Start recording"
21- uses : kvrhdn/ gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2
21+ uses : puppetlabs/kvrhdn- gha-buildevents@pdk-templates-v1
2222 with :
2323 apikey : ${{ env.HONEYCOMB_WRITEKEY }}
2424 dataset : ${{ env.HONEYCOMB_DATASET }}
@@ -30,83 +30,53 @@ jobs:
3030 echo STEP_START=$(date +%s) >> $GITHUB_ENV
3131
3232 - name : " Checkout Source"
33+ if : ${{ github.repository_owner == 'puppetlabs' }}
3334 uses : actions/checkout@v2
3435 with :
3536 fetch-depth : 0
3637 persist-credentials : false
3738
38- - name : Activate Ruby 2.6
39- uses : actions/setup-ruby@v1
40- with :
41- ruby-version : " 2.6"
42-
43- - name : Cache gems
44- uses : actions/cache@v2
39+ - name : " PDK Release prep"
40+ uses : docker://puppet/pdk:nightly
4541 with :
46- path : vendor/gems
47- key : ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
48- restore-keys : |
49- ${{ runner.os }}-${{ github.event_name }}-
50- ${{ runner.os }}-
51-
52- - name : " Honeycomb: Record cache setup time"
53- if : ${{ always() }}
54- run : |
55- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval'
56- echo STEP_ID="auto_release" >> $GITHUB_ENV
57- echo STEP_START=$(date +%s) >> $GITHUB_ENV
42+ args : ' release prep --force'
43+ env :
44+ CHANGELOG_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5845
59- - name : Append PDK to Gemfile
60- run : |
61- echo "gem 'pdk'" >> Gemfile
62-
63- - name : Bundler Setup
64- run : |
65- buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
66- buildevents cmd $TRACE_ID $STEP_ID 'bundle config bin vendor/bins' -- bundle config bin vendor/bins
67- buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
68- buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
69- buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
70- buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
71- echo ::group::bundler environment
72- buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
73- echo ::endgroup::
74-
75- - name : " Honeycomb: Record Bundler Setup time"
76- if : ${{ always() }}
77- run : |
78- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
79- echo STEP_ID="auto_release" >> $GITHUB_ENV
80- echo STEP_START=$(date +%s) >> $GITHUB_ENV
81-
82- - name : " PDK Release prep"
46+ - name : " Get Version"
47+ if : ${{ github.repository_owner == 'puppetlabs' }}
48+ id : gv
8349 run : |
84- buildevents cmd $TRACE_ID $STEP_ID 'pdk release prep' -- ./vendor/bins/pdk release prep --force
50+ echo "::set-output name=ver::$(cat metadata.json | jq .version | tr -d \")"
8551
8652 - name : " Commit changes"
53+ if : ${{ github.repository_owner == 'puppetlabs' }}
8754 run : |
8855 git config --local user.email "action@github.com"
8956 git config --local user.name "GitHub Action"
9057 git add .
91- git commit -m "Auto-Release prep"
92-
93- - name : " Get Version"
94- id : gv
95- run : |
96- echo "::set-output name=ver::$(cat metadata.json | jq .version)"
58+ git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
9759
9860 - name : Create Pull Request
9961 id : cpr
10062 uses : puppetlabs/peter-evans-create-pull-request@v3
63+ if : ${{ github.repository_owner == 'puppetlabs' }}
10164 with :
10265 token : ${{ secrets.GITHUB_TOKEN }}
103- commit-message : " Auto-release prep"
66+ commit-message : " Release prep v${{ steps.gv.outputs.ver }} "
10467 branch : " release-prep"
10568 delete-branch : true
106- title : " Auto-release prep ${{ steps.gv.outputs.ver }}"
69+ title : " Release prep v${{ steps.gv.outputs.ver }}"
70+ body : " Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb)"
10771 labels : " maintenance"
10872
10973 - name : PR outputs
74+ if : ${{ github.repository_owner == 'puppetlabs' }}
11075 run : |
11176 echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
11277 echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
78+
79+ - name : " Honeycomb: Record finish step"
80+ if : ${{ always() }}
81+ run : |
82+ buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow'
0 commit comments