Skip to content

Commit

Permalink
Prepare for rubygems releases
Browse files Browse the repository at this point in the history
* Added CHANGELOG
* Add rubygems step to release workflow. Still needs some work - would
  like to build the release text from the changelog. Next commit ;)
  • Loading branch information
telyn committed Jan 17, 2021
1 parent ac47bd5 commit b9c2339
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 88 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
ruby-version: 2.5
bundler-cache: true
- run: bundle exec bin/release-check
- run: bundle exec bin/extract-changelog > release.md
- run: gem build lirc.gemspec
- uses: actions/create-release@v1
env:
Expand All @@ -24,3 +25,12 @@ jobs:
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body_path: release.md
- name: Publish to RubyGems
run: |
mkdir -p "$HOME/.gem"
printf -- "---\n:rubygems_api_key: $RUBYGEMS_API_KEY\n" > "$HOME/.gem/credentials"
chmod 0600 "$HOME/.gem/credentials"
gem push *.gem
env:
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
44 changes: 44 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.0] - 2021-01-17

### Added
- Finally got round to writing a changelog.
- Released to rubygems.org
- First version released to Github releases
- 100% mutation coverage
- Note: Versions prior to 0.3.0 were never tagged, built, nor released.

### Changed
- Correctly specified rubies supported for the first time.
- Dropped support for Ruby 2.4

### Fixed
- Fixed issue where `LIRC::Messages::ResponseParser#parse_line` could return
`ArgumentError` instead of `ParseError` in rare circumstances.


## [0.2.0] - 2020-ish [YANKED]

### Added

- `irsend` executable in `bin` dir, as an example for usage
- `LIRC::Protocol`, including response parsing and command-sending.
`#send_command` returns an `EM::Deferrable` that succeeds/fails after the LIRC
server responds.


## [0.1.0] - 2020-ish [YANKED]

### Added

- Sketch of project structure
- Note: A 0.1.0 release was never made (nor a tag) - so it has been marked as
[YANKED] above.


[0.3.0]: https://github.com/telyn/ruby-lirc/releases/v0.3.0
16 changes: 0 additions & 16 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,8 @@

source "https://rubygems.org"
source 'https://oss:N16UPtnejBEApoTDzs7SZsJyjsXSINhZ@gem.mutant.dev' do
# Do not lock the mutant license to any version.
gem 'mutant-license', require: false
end

# Specify your gem's dependencies in lirc.gemspec
gemspec

gem "rake", "~> 12.0"
gem "rspec", "~> 3.0"

gem "guard-rspec", "~> 4.7"

gem "rubocop", "~> 1.2"

gem "fuubar", "~> 2.5"

gem "faker", "~> 2.14"

gem "eventmachine", "~> 1.2"

gem "mutant-rspec", "~> 0.10.21"
101 changes: 29 additions & 72 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,22 @@ PATH
remote: .
specs:
lirc (0.3.0)
eventmachine (~> 1.2)

GEM
remote: https://rubygems.org/
remote: https://oss:N16UPtnejBEApoTDzs7SZsJyjsXSINhZ@gem.mutant.dev/
specs:
abstract_type (0.0.7)
adamantium (0.2.0)
ice_nine (~> 0.11.0)
memoizable (~> 0.4.0)
anima (0.3.2)
abstract_type (~> 0.0.7)
adamantium (~> 0.2)
equalizer (~> 0.0.11)
ast (2.4.1)
coderay (1.1.3)
concord (0.1.6)
adamantium (~> 0.2.0)
equalizer (~> 0.0.9)
concurrent-ruby (1.1.7)
diff-lcs (1.4.4)
equalizer (0.0.11)
eventmachine (1.2.7)
faker (2.14.0)
faker (2.15.1)
i18n (>= 1.6, < 2)
ffi (1.13.1)
ffi (1.14.2)
formatador (0.2.5)
fuubar (2.5.0)
fuubar (2.5.1)
rspec-core (~> 3.0)
ruby-progressbar (~> 1.4)
guard (2.16.2)
Expand All @@ -45,50 +34,29 @@ GEM
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
i18n (1.8.5)
i18n (1.8.7)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
listen (3.2.1)
listen (3.4.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.8)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
method_source (1.0.0)
mprelude (0.1.0)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
concord (~> 0.1.5)
equalizer (~> 0.0.9)
ice_nine (~> 0.11.1)
procto (~> 0.0.2)
mutant (0.10.21)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
anima (~> 0.3.1)
ast (~> 2.2)
concord (~> 0.1.5)
mutant (0.10.26)
diff-lcs (~> 1.3)
equalizer (~> 0.0.9)
ice_nine (~> 0.11.1)
memoizable (~> 0.4.2)
mprelude (~> 0.1.0)
parser (~> 2.7.1)
procto (~> 0.0.2)
unparser (~> 0.5.4)
variable (~> 0.0.1)
parser (~> 3.0.0)
regexp_parser (~> 2.0, >= 2.0.3)
unparser (~> 0.6.0)
mutant-license (0.1.1.2.2047963385231461769331476801441011296942.1)
mutant-rspec (0.10.21)
mutant (= 0.10.21)
mutant-rspec (0.10.26)
mutant (= 0.10.26)
rspec-core (>= 3.8.0, < 4.0.0)
nenv (0.3.0)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
parallel (1.20.0)
parser (2.7.2.0)
parallel (1.20.1)
parser (3.0.0.0)
ast (~> 2.4.1)
procto (0.0.3)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -97,55 +65,44 @@ GEM
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (1.8.2)
regexp_parser (2.0.3)
rexml (3.2.4)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.0)
rspec-mocks (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.0)
rubocop (1.2.0)
rspec-support (3.10.1)
rubocop (1.8.1)
parallel (~> 1.10)
parser (>= 2.7.1.5)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.0.1)
rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.1.1)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.0)
parser (>= 2.7.1.5)
ruby-progressbar (1.10.1)
ruby-progressbar (1.11.0)
shellany (0.0.1)
thor (1.0.1)
thread_safe (0.3.6)
unicode-display_width (1.7.0)
unparser (0.5.5)
abstract_type (~> 0.0.7)
adamantium (~> 0.2.0)
anima (~> 0.3.1)
concord (~> 0.1.5)
unicode-display_width (2.0.0)
unparser (0.6.0)
diff-lcs (~> 1.3)
equalizer (~> 0.0.9)
mprelude (~> 0.1.0)
parser (>= 2.6.5)
procto (~> 0.0.2)
variable (0.0.1)
equalizer (~> 0.0.11)
parser (>= 3.0.0)

PLATFORMS
ruby

DEPENDENCIES
eventmachine (~> 1.2)
faker (~> 2.14)
fuubar (~> 2.5)
guard-rspec (~> 4.7)
Expand Down
32 changes: 32 additions & 0 deletions bin/extract-changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "lirc"

version_number = LIRC::VERSION.gsub('.', '\\.')

state = :waiting_for_version
File.open('CHANGELOG.md', 'r').each_line do |line|
case state
when :waiting_for_version
if line =~ /\A## \[(.+?)\]/
latest_version = Regexp.last_match[1]
if latest_version == LIRC::VERSION
puts line
state = :reading_changelog
else
raise "Expected latest version in changelog to be '#{LIRC::VERSION}', was '#{latest_version}'"
end
end
when :reading_changelog
if line =~ /\A## /
state = :done
else
puts line
end
end
break if state == :done
end
if state != :done
raise "Got to end of file in #{state} state?"
end
12 changes: 12 additions & 0 deletions lirc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CONTRIBUTING.md"
spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues"
spec.metadata["source_code_uri"] = "https://github.com/telyn/ruby-lirc"

# Specify which files should be added to the gem when it is released.
Expand All @@ -24,4 +26,14 @@ Gem::Specification.new do |spec|
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "eventmachine", "~> 1.2"

spec.add_development_dependency "faker", "~> 2.14"
spec.add_development_dependency "fuubar", "~> 2.5"
spec.add_development_dependency "guard-rspec", "~> 4.7"
spec.add_development_dependency "mutant-rspec", "~> 0.10.21"
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rubocop", "~> 1.2"
end

0 comments on commit b9c2339

Please sign in to comment.