Skip to content
Merged
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
40 changes: 40 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes

changelog:
exclude:
labels:
- duplicate
- invalid
- modulesync
- question
- skip-changelog
- wont-fix
- wontfix
- github_actions

categories:
- title: Breaking Changes 🛠
labels:
- backwards-incompatible

- title: New Features 🎉
labels:
- enhancement

- title: Bug Fixes 🐛
labels:
- bug

- title: Documentation Updates 📚
labels:
- documentation
- docs

- title: Dependency Updates ⬆️
labels:
- dependencies

- title: Other Changes
labels:
- "*"
65 changes: 65 additions & 0 deletions .github/workflows/gem_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: Gem Release

on:
push:
tags:
- '*'

permissions: {}

jobs:
build-release:
# Prevent releases from forked repositories
if: github.repository_owner == 'OpenVoxProject'
name: Build the gem
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 'ruby'
- name: Build gem
shell: bash
run: gem build --verbose *.gemspec
- name: Upload gem to GitHub cache
uses: actions/upload-artifact@v4
with:
name: gem-artifact
path: '*.gem'
retention-days: 1
compression-level: 0

create-github-release:
needs: build-release
name: Create GitHub release
runs-on: ubuntu-24.04
permissions:
contents: write # clone repo and create release
steps:
- name: Download gem from GitHub cache
uses: actions/download-artifact@v4
with:
name: gem-artifact
- name: Create Release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: gh release create --repo ${{ github.repository }} ${{ github.ref_name }} --generate-notes *.gem

release-to-github:
needs: build-release
name: Release to GitHub
runs-on: ubuntu-24.04
permissions:
packages: write # publish to rubygems.pkg.github.com
steps:
- name: Download gem from GitHub cache
uses: actions/download-artifact@v4
with:
name: gem-artifact
- name: Publish gem to GitHub packages
run: gem push --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem
env:
GEM_HOST_API_KEY: ${{ secrets.GITHUB_TOKEN }}
24 changes: 0 additions & 24 deletions .github/workflows/release.yml

This file was deleted.

40 changes: 32 additions & 8 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Ruby

on:
Expand All @@ -6,17 +7,33 @@ on:
branches:
- main

permissions:
contents: read

jobs:
build:
rubocop_and_matrix:
runs-on: ubuntu-24.04
outputs:
ruby: ${{ steps.ruby.outputs.versions }}
steps:
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Run linter
run: bundle exec rake rubocop
- id: ruby
uses: voxpupuli/ruby-version@v1

runs-on: ubuntu-latest
test:
runs-on: ubuntu-24.04
needs: rubocop_and_matrix
strategy:
fail-fast: false
matrix:
ruby:
- 3.4
- 3.3
- 3.2
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
Expand All @@ -25,5 +42,12 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec rspec spec --color --format documentation --order random
- name: Rubocop
run: bundle exec rake rubocop

tests:
needs:
- rubocop_and_matrix
- test
runs-on: ubuntu-24.04
name: Test suite
steps:
- run: echo Test suite completed
3 changes: 0 additions & 3 deletions CODEOWNERS

This file was deleted.

5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

gemspec

group :release, optional: true do
gem 'faraday-retry', '~> 2.1', require: false
gem 'github_changelog_generator', '~> 1.16', require: false
end
26 changes: 26 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,29 @@ begin
rescue LoadError
# the voxpupuli-rubocop gem is optional
end

begin
require 'github_changelog_generator/task'
rescue LoadError
# gem is missing
else
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file."
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix modulesync skip-changelog github_actions]
config.user = 'OpenVoxProject'
config.project = 'packaging'
config.future_release = Gem::Specification.load("#{config.project}.gemspec").version
end

# Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
require 'rbconfig'
if RbConfig::CONFIG['host_os'].include?('linux')
task :changelog do
puts 'Fixing line endings...'
changelog_file = File.join(__dir__, 'CHANGELOG.md')
changelog_txt = File.read(changelog_file)
new_contents = changelog_txt.gsub("\r\n", "\n")
File.open(changelog_file, 'w') { |file| file.puts new_contents }
end
end
end