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
30 changes: 30 additions & 0 deletions .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: 'Prepare Release'

on:
workflow_dispatch:
inputs:
version:
description: 'Version to be released (e.g., 7.0.5)'
required: true
type: string
branch:
description: 'The branch to release from. 5.x is for OpenVox 8. 6.x is JRuby 10.0 and currently not used'
type: choice
options:
- main
- '5.x'
- '6.x'
default: 'main'

permissions: {}

jobs:
prepare_release:
uses: 'openvoxproject/shared-actions/.github/workflows/prepare_release.yml@main'
with:
version: ${{ inputs.version }}
base-branch: ${{ inputs.branch }}
secrets:
github_pat: ${{ secrets.OPENVOXBOT_COMMIT_AND_PRS }}
ssh_private_key: ${{ secrets.OPENVOXBOT_SSH_PRIVATE_KEY }}
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

gem 'rake'

group :release, optional: true do
gem 'faraday-retry', '~> 2.1', require: false
gem 'github_changelog_generator', '~> 1.18', require: false
end
46 changes: 46 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# frozen_string_literal: true

begin
require 'github_changelog_generator/task'
rescue LoadError
task :changelog do
abort('Run `bundle install --with release` to install the `github_changelog_generator` gem.')
end
else
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.header = <<~HEADER.chomp
# Changelog

All notable changes to this project will be documented in this file.
HEADER
config.user = 'OpenVoxProject'
config.project = 'jruby-utils'
config.exclude_labels = %w[dependencies duplicate question invalid wontfix wont-fix modulesync skip-changelog]
config.future_release = File.readlines('project.clj')
.grep(/^\(defproject /).first[/"([^"]+)"/, 1]
.sub(/-SNAPSHOT\z/, '')
# The generated changelog starts with 5.2.1, the first release after the move to OpenVoxProject.
# Only tags on main count, so releases from the 5.x and 6.x branches stay out.
config.since_tag = '4.2.0'
config.include_tags_regex = /\A4\.2\.0\z|\A5\.[2-4]\.|\A5\.5\.0\z|\A6\.0\.0\z|\A7\./
config.release_branch = 'main'
end
end

namespace :vox do
desc 'Set the version in project.clj for the release'
task 'version:bump:full', [:version] do |_, args|
version = args[:version]
abort 'You must provide a version.' if version.nil? || version.empty?

project = File.read('project.clj')
defproject = /^(\(defproject\s+\S+\s+)"[^"]+"/
abort 'Could not find the defproject version in project.clj' unless project.match?(defproject)

File.write('project.clj', project.sub(defproject) { "#{Regexp.last_match(1)}\"#{version}\"" })
puts "Set the version in project.clj to #{version}"
end
end

desc 'Prepare for a release'
task 'release:prepare' => [:changelog]