-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from puppetlabs/CONT-723-Implement_reusable_w…
…orkflows (CONT-723) - Implement reusable workflows
- Loading branch information
Showing
5 changed files
with
111 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: "nightly" | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
spec: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby_version: | ||
- '2.5' | ||
- '2.7' | ||
name: "spec (ruby ${{ matrix.ruby_version }})" | ||
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main" | ||
secrets: "inherit" | ||
with: | ||
ruby_version: ${{ matrix.ruby_version }} | ||
|
||
acceptance: | ||
needs: "spec" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- "windows-latest" | ||
- "windows-2019" | ||
puppet: | ||
- 6 | ||
- 7 | ||
include: | ||
- puppet: 6 | ||
ruby: 2.5 | ||
- puppet: 7 | ||
ruby: 2.7 | ||
env: | ||
PUPPET_GEM_VERSION: ${{ matrix.puppet }} | ||
|
||
steps: | ||
- name: "checkout" | ||
uses: "actions/checkout@v3" | ||
|
||
- name: "setup ruby" | ||
uses: "ruby/setup-ruby@v1" | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
bundler-cache: true | ||
|
||
- name: "bundle environment" | ||
run: | | ||
echo ::group::bundler environment | ||
bundle env | ||
echo ::endgroup:: | ||
- name: "setup winrm" | ||
shell: "powershell" | ||
run: | | ||
Get-ChildItem WSMan:\localhost\Listener\ -OutVariable Listeners | Format-List * -Force | ||
$HTTPListener = $Listeners | Where-Object -FilterScript { $_.Keys.Contains('Transport=HTTP') } | ||
If ($HTTPListener.Count -eq 0) { | ||
winrm create winrm/config/Listener?Address=*+Transport=HTTP | ||
winrm e winrm/config/listener | ||
} | ||
- name: "acceptance" | ||
shell: "powershell" | ||
run: | | ||
bundle exec rake dsc:acceptance:spec_prep | ||
bundle exec rake dsc:acceptance:spec | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,20 @@ | ||
name: "release" | ||
name: "Release" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
target: | ||
description: "The target for the release. This can be a commit sha or a branch." | ||
required: false | ||
default: "main" | ||
|
||
jobs: | ||
release: | ||
name: "release" | ||
runs-on: "ubuntu-latest" | ||
if: github.repository_owner == 'puppetlabs' | ||
|
||
steps: | ||
|
||
- name: "checkout" | ||
uses: "actions/checkout@v3" | ||
with: | ||
ref: ${{ github.ref }} | ||
clean: true | ||
fetch-depth: 0 | ||
|
||
- name: "setup ruby" | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler-cache: true | ||
|
||
- name: "get version" | ||
id: "get_version" | ||
run: | | ||
echo "::set-output name=version::$(jq --raw-output .version metadata.json)" | ||
- name: "build gem" | ||
run: | | ||
bundle exec rake build | ||
- name: "publish gem" | ||
run: | | ||
gem push ./pkg/*.gem | ||
env: | ||
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} | ||
|
||
- name: "update module readme" | ||
run: | | ||
mv pwshlib.md README.md | ||
- name: "build module" | ||
uses: "docker://puppet/pdk:latest" | ||
with: | ||
args: 'build' | ||
|
||
- name: "publish module" | ||
uses: "docker://puppet/pdk:latest" | ||
with: | ||
args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force' | ||
|
||
- name: "create release" | ||
run: | | ||
gh release create v${{ steps.get_version.outputs.version }} ./pkg/*.gem ./pkg/*.tar.gz --title v${{ steps.get_version.outputs.version }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
gem_release: | ||
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_release.yml@main" | ||
with: | ||
target: "${{ github.event.inputs.target }}" | ||
secrets: "inherit" | ||
|
||
module_release: | ||
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main" | ||
secrets: "inherit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters