Skip to content

Commit

Permalink
Better gem management cycle task
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Feb 18, 2024
1 parent fb09d28 commit ff8a1e4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 44 deletions.
18 changes: 0 additions & 18 deletions script/release.sh

This file was deleted.

26 changes: 0 additions & 26 deletions tasks/gem_management.rake

This file was deleted.

33 changes: 33 additions & 0 deletions tasks/safe_release.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

# Gem release cycle

require 'bundler/gem_tasks'
require 'rake/manifest'

Rake::Manifest::Task.new do |t|
t.patterns = FileList.new.include('lib/**/*', 'LICENSE.txt').exclude('**/*.md')
t.manifest_file = 'pagy.manifest'
end

module Bundler # :nodoc: all
class GemHelper
def version_tag
"#{@tag_prefix}#{version}" # remove that stupid 'v' prepended to the version number
end
end
end

desc 'Checks-build-release-tag-cleanup cycle'
task :safe_release do
output = `git status --porcelain`
abort 'Working tree dirty!' unless output.empty?

branch = `git rev-parse --abbrev-ref HEAD`
abort 'Wrong branch to release!' unless /^master/.match?(branch)

Rake::Task['manifest:check'].invoke
Rake::Task['build'].invoke
Rake::Task['release'].invoke
FileUtils.rm_rf('pkg', secure: true)
end

0 comments on commit ff8a1e4

Please sign in to comment.