Skip to content

Commit ff5a3dc

Browse files
authored
Merge pull request #51 from voxpupuli/modulesync
modulesync 1.0.1-29-g03c75a9
2 parents 6e045b3 + c5bd3bb commit ff5a3dc

File tree

7 files changed

+173
-43
lines changed

7 files changed

+173
-43
lines changed

.github/labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
# Managed by modulesync - DO NOT EDIT
3+
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
4+
5+
skip-changelog:
6+
- head-branch: ['^rel*']

.github/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
3+
4+
changelog:
5+
exclude:
6+
labels:
7+
- duplicate
8+
- invalid
9+
- modulesync
10+
- question
11+
- skip-changelog
12+
- wont-fix
13+
- wontfix
14+
- github_actions
15+
16+
categories:
17+
- title: Breaking Changes 🛠
18+
labels:
19+
- backwards-incompatible
20+
21+
- title: New Features 🎉
22+
labels:
23+
- enhancement
24+
25+
- title: Bug Fixes 🐛
26+
labels:
27+
- bug
28+
- bugfix
29+
30+
- title: Documentation Updates 📚
31+
labels:
32+
- documentation
33+
- docs
34+
35+
- title: Dependency Updates ⬆️
36+
labels:
37+
- dependencies
38+
39+
- title: Other Changes
40+
labels:
41+
- "*"

.github/workflows/release.yml

Lines changed: 91 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,106 @@
1-
name: Release
1+
---
2+
name: Gem Release
23

34
on:
45
push:
56
tags:
67
- '*'
78

9+
permissions: {}
10+
811
jobs:
9-
release:
10-
runs-on: ubuntu-latest
12+
build-release:
13+
# Prevent releases from forked repositories
1114
if: github.repository_owner == 'voxpupuli'
15+
name: Build the gem
16+
runs-on: ubuntu-24.04
1217
steps:
13-
- uses: actions/checkout@v4
14-
- name: Install Ruby 3.0
18+
- uses: actions/checkout@v5
19+
- name: Install Ruby
1520
uses: ruby/setup-ruby@v1
1621
with:
17-
ruby-version: '3.0'
18-
bundler: 'none'
19-
env:
20-
BUNDLE_WITHOUT: release:development:rubocop
22+
ruby-version: 'ruby'
2123
- name: Build gem
22-
run: gem build --strict --verbose *.gemspec
24+
shell: bash
25+
run: gem build --verbose *.gemspec
26+
- name: Upload gem to GitHub cache
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: gem-artifact
30+
path: '*.gem'
31+
retention-days: 1
32+
compression-level: 0
33+
34+
create-github-release:
35+
needs: build-release
36+
name: Create GitHub release
37+
runs-on: ubuntu-24.04
38+
permissions:
39+
contents: write # clone repo and create release
40+
steps:
41+
- name: Download gem from GitHub cache
42+
uses: actions/download-artifact@v5
43+
with:
44+
name: gem-artifact
45+
- name: Create Release
46+
shell: bash
47+
env:
48+
GH_TOKEN: ${{ github.token }}
49+
run: gh release create --repo ${{ github.repository }} ${{ github.ref_name }} --generate-notes *.gem
50+
51+
release-to-github:
52+
needs: build-release
53+
name: Release to GitHub
54+
runs-on: ubuntu-24.04
55+
permissions:
56+
packages: write # publish to rubygems.pkg.github.com
57+
steps:
58+
- name: Download gem from GitHub cache
59+
uses: actions/download-artifact@v5
60+
with:
61+
name: gem-artifact
62+
- name: Publish gem to GitHub packages
63+
run: gem push --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
64+
env:
65+
GEM_HOST_API_KEY: ${{ secrets.GITHUB_TOKEN }}
66+
67+
release-to-rubygems:
68+
needs: build-release
69+
name: Release gem to rubygems.org
70+
runs-on: ubuntu-24.04
71+
environment: release # recommended by rubygems.org
72+
permissions:
73+
id-token: write # rubygems.org authentication
74+
steps:
75+
- name: Download gem from GitHub cache
76+
uses: actions/download-artifact@v5
77+
with:
78+
name: gem-artifact
79+
- uses: rubygems/[email protected]
2380
- name: Publish gem to rubygems.org
81+
shell: bash
2482
run: gem push *.gem
25-
env:
26-
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
27-
- name: Setup GitHub packages access
83+
84+
release-verification:
85+
name: Check that all releases are done
86+
runs-on: ubuntu-24.04
87+
permissions:
88+
contents: read # minimal permissions that we have to grant
89+
needs:
90+
- create-github-release
91+
- release-to-github
92+
- release-to-rubygems
93+
steps:
94+
- name: Download gem from GitHub cache
95+
uses: actions/download-artifact@v5
96+
with:
97+
name: gem-artifact
98+
- name: Install Ruby
99+
uses: ruby/setup-ruby@v1
100+
with:
101+
ruby-version: 'ruby'
102+
- name: Wait for release to propagate
103+
shell: bash
28104
run: |
29-
mkdir -p ~/.gem
30-
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
31-
chmod 0600 ~/.gem/credentials
32-
- name: Publish gem to GitHub packages
33-
run: gem push --key github --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
105+
gem install rubygems-await
106+
gem await *.gem

.github/workflows/test.yml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Test
23

34
on:
@@ -7,37 +8,36 @@ on:
78
- master
89
- main
910

10-
env:
11-
BUNDLE_WITHOUT: release
11+
permissions:
12+
contents: read
1213

1314
jobs:
14-
rubocop:
15-
runs-on: ubuntu-latest
15+
rubocop_and_matrix:
16+
runs-on: ubuntu-24.04
17+
outputs:
18+
ruby: ${{ steps.ruby.outputs.versions }}
1619
steps:
17-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v5
1821
- name: Setup ruby
1922
uses: ruby/setup-ruby@v1
2023
with:
21-
ruby-version: '3.0'
24+
ruby-version: '3.3'
2225
bundler-cache: true
2326
- name: Run rake rubocop
2427
run: bundle exec rake rubocop
28+
- id: ruby
29+
uses: voxpupuli/ruby-version@v1
30+
2531
test:
26-
runs-on: ubuntu-latest
32+
runs-on: ubuntu-24.04
33+
needs: rubocop_and_matrix
2734
strategy:
2835
fail-fast: false
2936
matrix:
30-
include:
31-
- ruby: "2.7"
32-
- ruby: "3.0"
33-
- ruby: "3.1"
34-
coverage: "yes"
35-
- ruby: "3.2"
36-
env:
37-
COVERAGE: ${{ matrix.coverage }}
37+
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
3838
name: Ruby ${{ matrix.ruby }}
3939
steps:
40-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v5
4141
- name: Install Ruby ${{ matrix.ruby }}
4242
uses: ruby/setup-ruby@v1
4343
with:
@@ -47,11 +47,16 @@ jobs:
4747
run: bundle exec rake spec
4848
- name: Verify gem builds
4949
run: gem build --strict --verbose *.gemspec
50+
5051
tests:
52+
if: always()
5153
needs:
52-
- rubocop
54+
- rubocop_and_matrix
5355
- test
54-
runs-on: ubuntu-latest
56+
runs-on: ubuntu-24.04
5557
name: Test suite
5658
steps:
57-
- run: echo Test suite completed
59+
- name: Decide whether the needed jobs succeeded or failed
60+
uses: re-actors/alls-green@release/v1
61+
with:
62+
jobs: ${{ toJSON(needs) }}

.msync.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
# Managed by modulesync - DO NOT EDIT
3+
# https://github.com/voxpupuli/puppet-lint_modulesync_configs
4+
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
5+
6+
modulesync_config_version: '2.0.0'

Gemfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1+
# frozen_string_literal: true
2+
13
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
24

35
gemspec
46

5-
group :release do
7+
group :release, optional: true do
68
gem 'faraday-retry', '~> 2.1', require: false
79
gem 'github_changelog_generator', '~> 1.16.4', require: false
810
end
911

10-
group :coverage, optional: ENV['COVERAGE'] != 'yes' do
11-
gem 'codecov', require: false
12-
gem 'simplecov-console', require: false
13-
end
14-
1512
group :development do
1613
gem 'rake', '~> 13.0', '>= 13.0.6'
1714
gem 'rspec', '~> 3.12'

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'rspec/core/rake_task'
24

35
RSpec::Core::RakeTask.new(:spec)

0 commit comments

Comments
 (0)