Skip to content

Commit

Permalink
Version bump to kickstart release workflow
Browse files Browse the repository at this point in the history
I gave up on manually doing it… oh well
  • Loading branch information
jltml committed Oct 9, 2022
1 parent c4c3c1b commit b40d444
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 7 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
tag:
description: 'Which Git tag to release (e.g. vO.1.O)'

jobs:
homebrew:
Expand All @@ -24,8 +20,19 @@ jobs:
# Formula name, required
formula: manymessage
# Optional, will be determined automatically
tag: ${{github.ref || github.event.inputs.tags}}
tag: ${{github.ref}}
# Optional, will be determined automatically
revision: ${{github.sha}}
# Optional, if don't want to check for already open PRs
force: false
rubygems:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Release Gem
if: contains(github.ref, 'refs/tags/v')
uses: cadwallion/publish-rubygems-action@master
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
RELEASE_COMMAND: "rake workflow:release:gem"
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
manymessage (0.1.1)
manymessage (0.1.2)
imessage (~> 0.4.0)
json (~> 2.6)
os (~> 1.1)
Expand Down
35 changes: 35 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,38 @@ RSpec::Core::RakeTask.new(:spec)
require "standard/rake"

task default: %i[spec standard]

# Adds renaming of Rake tasks, from https://blog.ladslezak.cz/2009/06/03/renaming-rake-task/
module Rake
class Application
def rename_task(task, oldname, newname)
@tasks = {} if @tasks.nil?
@tasks[newname.to_s] = task

@tasks.delete(oldname) if @tasks.has_key?(oldname)
end
end
end

# add new rename method to Rake::Task class
# to rename a task
class Rake::Task
def rename(new_name)
if !new_name.nil?
old_name = @name

return if old_name == new_name

@name = new_name.to_s
application.rename_task(self, old_name, new_name)
end
end
end

Rake::Task[:release].rename(:"release:gem")

desc "Release to RubyGems, but don't create a version tag (for use in release GitHub Action workflow)"
task :"workflow:release:gem" do
`gem install gem-release`
`gem release`
end
2 changes: 1 addition & 1 deletion lib/manymessage/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Manymessage
VERSION = "0.1.1"
VERSION = "0.1.2"
end

0 comments on commit b40d444

Please sign in to comment.