Skip to content

Commit b9c2339

Browse files
committed
Prepare for rubygems releases
* Added CHANGELOG * Add rubygems step to release workflow. Still needs some work - would like to build the release text from the changelog. Next commit ;)
1 parent ac47bd5 commit b9c2339

File tree

6 files changed

+127
-88
lines changed

6 files changed

+127
-88
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
ruby-version: 2.5
1616
bundler-cache: true
1717
- run: bundle exec bin/release-check
18+
- run: bundle exec bin/extract-changelog > release.md
1819
- run: gem build lirc.gemspec
1920
- uses: actions/create-release@v1
2021
env:
@@ -24,3 +25,12 @@ jobs:
2425
release_name: Release ${{ github.ref }}
2526
draft: false
2627
prerelease: false
28+
body_path: release.md
29+
- name: Publish to RubyGems
30+
run: |
31+
mkdir -p "$HOME/.gem"
32+
printf -- "---\n:rubygems_api_key: $RUBYGEMS_API_KEY\n" > "$HOME/.gem/credentials"
33+
chmod 0600 "$HOME/.gem/credentials"
34+
gem push *.gem
35+
env:
36+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [0.3.0] - 2021-01-17
8+
9+
### Added
10+
- Finally got round to writing a changelog.
11+
- Released to rubygems.org
12+
- First version released to Github releases
13+
- 100% mutation coverage
14+
- Note: Versions prior to 0.3.0 were never tagged, built, nor released.
15+
16+
### Changed
17+
- Correctly specified rubies supported for the first time.
18+
- Dropped support for Ruby 2.4
19+
20+
### Fixed
21+
- Fixed issue where `LIRC::Messages::ResponseParser#parse_line` could return
22+
`ArgumentError` instead of `ParseError` in rare circumstances.
23+
24+
25+
## [0.2.0] - 2020-ish [YANKED]
26+
27+
### Added
28+
29+
- `irsend` executable in `bin` dir, as an example for usage
30+
- `LIRC::Protocol`, including response parsing and command-sending.
31+
`#send_command` returns an `EM::Deferrable` that succeeds/fails after the LIRC
32+
server responds.
33+
34+
35+
## [0.1.0] - 2020-ish [YANKED]
36+
37+
### Added
38+
39+
- Sketch of project structure
40+
- Note: A 0.1.0 release was never made (nor a tag) - so it has been marked as
41+
[YANKED] above.
42+
43+
44+
[0.3.0]: https://github.com/telyn/ruby-lirc/releases/v0.3.0

Gemfile

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,8 @@
22

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

98
# Specify your gem's dependencies in lirc.gemspec
109
gemspec
11-
12-
gem "rake", "~> 12.0"
13-
gem "rspec", "~> 3.0"
14-
15-
gem "guard-rspec", "~> 4.7"
16-
17-
gem "rubocop", "~> 1.2"
18-
19-
gem "fuubar", "~> 2.5"
20-
21-
gem "faker", "~> 2.14"
22-
23-
gem "eventmachine", "~> 1.2"
24-
25-
gem "mutant-rspec", "~> 0.10.21"

Gemfile.lock

Lines changed: 29 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,22 @@ PATH
22
remote: .
33
specs:
44
lirc (0.3.0)
5+
eventmachine (~> 1.2)
56

67
GEM
78
remote: https://rubygems.org/
89
remote: https://oss:N16UPtnejBEApoTDzs7SZsJyjsXSINhZ@gem.mutant.dev/
910
specs:
10-
abstract_type (0.0.7)
11-
adamantium (0.2.0)
12-
ice_nine (~> 0.11.0)
13-
memoizable (~> 0.4.0)
14-
anima (0.3.2)
15-
abstract_type (~> 0.0.7)
16-
adamantium (~> 0.2)
17-
equalizer (~> 0.0.11)
1811
ast (2.4.1)
1912
coderay (1.1.3)
20-
concord (0.1.6)
21-
adamantium (~> 0.2.0)
22-
equalizer (~> 0.0.9)
2313
concurrent-ruby (1.1.7)
2414
diff-lcs (1.4.4)
25-
equalizer (0.0.11)
2615
eventmachine (1.2.7)
27-
faker (2.14.0)
16+
faker (2.15.1)
2817
i18n (>= 1.6, < 2)
29-
ffi (1.13.1)
18+
ffi (1.14.2)
3019
formatador (0.2.5)
31-
fuubar (2.5.0)
20+
fuubar (2.5.1)
3221
rspec-core (~> 3.0)
3322
ruby-progressbar (~> 1.4)
3423
guard (2.16.2)
@@ -45,50 +34,29 @@ GEM
4534
guard (~> 2.1)
4635
guard-compat (~> 1.1)
4736
rspec (>= 2.99.0, < 4.0)
48-
i18n (1.8.5)
37+
i18n (1.8.7)
4938
concurrent-ruby (~> 1.0)
50-
ice_nine (0.11.2)
51-
listen (3.2.1)
39+
listen (3.4.1)
5240
rb-fsevent (~> 0.10, >= 0.10.3)
5341
rb-inotify (~> 0.9, >= 0.9.10)
5442
lumberjack (1.2.8)
55-
memoizable (0.4.2)
56-
thread_safe (~> 0.3, >= 0.3.1)
5743
method_source (1.0.0)
58-
mprelude (0.1.0)
59-
abstract_type (~> 0.0.7)
60-
adamantium (~> 0.2.0)
61-
concord (~> 0.1.5)
62-
equalizer (~> 0.0.9)
63-
ice_nine (~> 0.11.1)
64-
procto (~> 0.0.2)
65-
mutant (0.10.21)
66-
abstract_type (~> 0.0.7)
67-
adamantium (~> 0.2.0)
68-
anima (~> 0.3.1)
69-
ast (~> 2.2)
70-
concord (~> 0.1.5)
44+
mutant (0.10.26)
7145
diff-lcs (~> 1.3)
72-
equalizer (~> 0.0.9)
73-
ice_nine (~> 0.11.1)
74-
memoizable (~> 0.4.2)
75-
mprelude (~> 0.1.0)
76-
parser (~> 2.7.1)
77-
procto (~> 0.0.2)
78-
unparser (~> 0.5.4)
79-
variable (~> 0.0.1)
46+
parser (~> 3.0.0)
47+
regexp_parser (~> 2.0, >= 2.0.3)
48+
unparser (~> 0.6.0)
8049
mutant-license (0.1.1.2.2047963385231461769331476801441011296942.1)
81-
mutant-rspec (0.10.21)
82-
mutant (= 0.10.21)
50+
mutant-rspec (0.10.26)
51+
mutant (= 0.10.26)
8352
rspec-core (>= 3.8.0, < 4.0.0)
8453
nenv (0.3.0)
8554
notiffany (0.1.3)
8655
nenv (~> 0.1)
8756
shellany (~> 0.0)
88-
parallel (1.20.0)
89-
parser (2.7.2.0)
57+
parallel (1.20.1)
58+
parser (3.0.0.0)
9059
ast (~> 2.4.1)
91-
procto (0.0.3)
9260
pry (0.13.1)
9361
coderay (~> 1.1)
9462
method_source (~> 1.0)
@@ -97,55 +65,44 @@ GEM
9765
rb-fsevent (0.10.4)
9866
rb-inotify (0.10.1)
9967
ffi (~> 1.0)
100-
regexp_parser (1.8.2)
68+
regexp_parser (2.0.3)
10169
rexml (3.2.4)
10270
rspec (3.10.0)
10371
rspec-core (~> 3.10.0)
10472
rspec-expectations (~> 3.10.0)
10573
rspec-mocks (~> 3.10.0)
106-
rspec-core (3.10.0)
74+
rspec-core (3.10.1)
10775
rspec-support (~> 3.10.0)
108-
rspec-expectations (3.10.0)
76+
rspec-expectations (3.10.1)
10977
diff-lcs (>= 1.2.0, < 2.0)
11078
rspec-support (~> 3.10.0)
111-
rspec-mocks (3.10.0)
79+
rspec-mocks (3.10.1)
11280
diff-lcs (>= 1.2.0, < 2.0)
11381
rspec-support (~> 3.10.0)
114-
rspec-support (3.10.0)
115-
rubocop (1.2.0)
82+
rspec-support (3.10.1)
83+
rubocop (1.8.1)
11684
parallel (~> 1.10)
117-
parser (>= 2.7.1.5)
85+
parser (>= 3.0.0.0)
11886
rainbow (>= 2.2.2, < 4.0)
119-
regexp_parser (>= 1.8)
87+
regexp_parser (>= 1.8, < 3.0)
12088
rexml
121-
rubocop-ast (>= 1.0.1)
89+
rubocop-ast (>= 1.2.0, < 2.0)
12290
ruby-progressbar (~> 1.7)
123-
unicode-display_width (>= 1.4.0, < 2.0)
124-
rubocop-ast (1.1.1)
91+
unicode-display_width (>= 1.4.0, < 3.0)
92+
rubocop-ast (1.4.0)
12593
parser (>= 2.7.1.5)
126-
ruby-progressbar (1.10.1)
94+
ruby-progressbar (1.11.0)
12795
shellany (0.0.1)
12896
thor (1.0.1)
129-
thread_safe (0.3.6)
130-
unicode-display_width (1.7.0)
131-
unparser (0.5.5)
132-
abstract_type (~> 0.0.7)
133-
adamantium (~> 0.2.0)
134-
anima (~> 0.3.1)
135-
concord (~> 0.1.5)
97+
unicode-display_width (2.0.0)
98+
unparser (0.6.0)
13699
diff-lcs (~> 1.3)
137-
equalizer (~> 0.0.9)
138-
mprelude (~> 0.1.0)
139-
parser (>= 2.6.5)
140-
procto (~> 0.0.2)
141-
variable (0.0.1)
142-
equalizer (~> 0.0.11)
100+
parser (>= 3.0.0)
143101

144102
PLATFORMS
145103
ruby
146104

147105
DEPENDENCIES
148-
eventmachine (~> 1.2)
149106
faker (~> 2.14)
150107
fuubar (~> 2.5)
151108
guard-rspec (~> 4.7)

bin/extract-changelog

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env ruby
2+
3+
require "bundler/setup"
4+
require "lirc"
5+
6+
version_number = LIRC::VERSION.gsub('.', '\\.')
7+
8+
state = :waiting_for_version
9+
File.open('CHANGELOG.md', 'r').each_line do |line|
10+
case state
11+
when :waiting_for_version
12+
if line =~ /\A## \[(.+?)\]/
13+
latest_version = Regexp.last_match[1]
14+
if latest_version == LIRC::VERSION
15+
puts line
16+
state = :reading_changelog
17+
else
18+
raise "Expected latest version in changelog to be '#{LIRC::VERSION}', was '#{latest_version}'"
19+
end
20+
end
21+
when :reading_changelog
22+
if line =~ /\A## /
23+
state = :done
24+
else
25+
puts line
26+
end
27+
end
28+
break if state == :done
29+
end
30+
if state != :done
31+
raise "Got to end of file in #{state} state?"
32+
end

lirc.gemspec

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Gem::Specification.new do |spec|
1414
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
1515

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

1921
# Specify which files should be added to the gem when it is released.
@@ -24,4 +26,14 @@ Gem::Specification.new do |spec|
2426
spec.bindir = "exe"
2527
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
2628
spec.require_paths = ["lib"]
29+
30+
spec.add_dependency "eventmachine", "~> 1.2"
31+
32+
spec.add_development_dependency "faker", "~> 2.14"
33+
spec.add_development_dependency "fuubar", "~> 2.5"
34+
spec.add_development_dependency "guard-rspec", "~> 4.7"
35+
spec.add_development_dependency "mutant-rspec", "~> 0.10.21"
36+
spec.add_development_dependency "rake", "~> 12.0"
37+
spec.add_development_dependency "rspec", "~> 3.0"
38+
spec.add_development_dependency "rubocop", "~> 1.2"
2739
end

0 commit comments

Comments
 (0)