Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GHA workflows #54

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
bundler-cache: false

- name: Bundler environment
- name: Prepare environment
run: |
bundle config set --local without 'release'
bundle env
bundle install

- name: Bundler environment
run: bundle env

- name: Get matrix
id: get-matrix
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
name: test

on: workflow_dispatch

jobs:
Prepare:

runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3

- name: setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7

- name: Prepare environment
run: |
bundle install
git config --global user.name "${{ github.workflow }} #${{ github.run_number }}"
git config --global user.email "${{ github.repository_owner }}@users.noreply.github.com"

- name: Update Reference.md
run: |
bundle exec rake strings:gh_pages:update
bundle exec rake strings:generate:reference

- name: "Generate changelog"
run: |
export GH_HOST=github.com
gh extension install chelnak/gh-changelog
gh changelog new --next-version v${{ github.event.inputs.version }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check for changes
id: changes
uses: UnicornGlobal/[email protected]

- name: Commit changes and release
if: steps.changes.outputs.changed == 1
run: |
git add .
git commit -m "[GH-Action] update reference and changelog"
git push
bundle exec rake module:tag
git push --tags

# Deploy:
# needs: Prepare
# name: Deploy to Forge
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# ref: ${{ github.ref }}
# clean: true
# - name: "PDK Build"
# uses: docker://puppet/pdk:nightly
# with:
# args: 'build'
# - name: "Push to Forge"
# uses: docker://puppet/pdk:nightly
# with:
# args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'
4 changes: 1 addition & 3 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,5 @@ appveyor.yml:
delete: true
Gemfile:
optional:
':release':
':development':
- gem: 'puppet-blacksmith'
- gem: 'github_changelog_generator'
version: '>= 1.16.1'
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ group :development do
gem "rubocop-performance", '= 1.9.1', require: false
gem "rubocop-rspec", '= 2.0.1', require: false
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-blacksmith", require: false
end
group :system_tests do
gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby, :x64_mingw]
gem "serverspec", '~> 2.41', require: false
end
group :release do
gem "puppet-blacksmith", require: false
gem "github_changelog_generator", '>= 1.16.1', require: false
end

puppet_version = ENV['PUPPET_GEM_VERSION']
facter_version = ENV['FACTER_GEM_VERSION']
Expand Down