Skip to content

Commit

Permalink
Test pdk-templates PR:puppetlabs/pdk-templates#394
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Carabas committed Feb 4, 2021
1 parent 341b306 commit 108cdeb
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 15 deletions.
48 changes: 36 additions & 12 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: "Auto release"

on:
schedule:
- cron: '0 3 * * 6'
workflow_dispatch:

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests
SERVICE_URL: https://facade-main-6f3kfepqcq-ew.a.run.app/v1/provision
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -16,7 +18,7 @@ jobs:

steps:
- name: "Honeycomb: Start recording"
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
with:
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
dataset: ${{ env.HONEYCOMB_DATASET }}
Expand All @@ -28,49 +30,71 @@ jobs:
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: "Checkout Source"
if: ${{ github.repository_owner == 'puppetlabs' }}
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: Activate Ruby 2.6
uses: actions/setup-ruby@v1
- name: Append PDK to Gemfile
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
echo "gem 'pdk'" >> Gemfile
- name: Activate Ruby 2.7
uses: ruby/setup-ruby@v1
if: ${{ github.repository_owner == 'puppetlabs' }}
with:
ruby-version: "2.6"
ruby-version: "2.7"
bundler-cache: true

- name: "Bundle install"
- name: Print bundle environment
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
echo "gem 'pdk'" >> Gemfile
bundle install
echo ::group::bundler environment
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
echo ::endgroup::
- name: "Honeycomb: Record Bundler Setup time"
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
echo STEP_ID="auto_release_setup" >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: "PDK Release prep"
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
pdk release prep --force
buildevents cmd $TRACE_ID $STEP_ID 'pdk release prep' -- bundle exec pdk release prep --force
- name: "Commit changes"
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Auto-Release prep"
- name: "Get Version"
if: ${{ github.repository_owner == 'puppetlabs' }}
id: gv
run: |
echo "::set-output name=ver::$(cat metadata.json | jq .version)"
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
uses: puppetlabs/peter-evans-create-pull-request@v3
if: ${{ github.repository_owner == 'puppetlabs' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Auto-release prep"
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
branch: "release-prep"
delete-branch: true
title: "Auto-release prep ${{ steps.gv.outputs.ver }}"
title: "Release prep v${{ steps.gv.outputs.ver }}"
labels: "maintenance"

- name: PR outputs
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
}
],
"description": "This module is a testing only module derived from puppetlabs-motd",
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
"template-ref": "heads/main-0-g1862b96",
"pdk-version": "1.19.0.pre (47)"
"template-url": "https://github.com/carabasdaniel/pdk-templates.git#auto_releasewf",
"template-ref": "remotes/origin/auto_releasewf-0-g88bf6fb",
"pdk-version": "1.18.1"
}

0 comments on commit 108cdeb

Please sign in to comment.