semantic_release 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +22 -7
- data/lib/semantic_release/configuration.rb +11 -0
- data/lib/semantic_release/rake_task.rb +7 -5
- data/lib/semantic_release/updaters/base_updater.rb +5 -1
- data/lib/semantic_release/updaters/gemfile_lock.rb +14 -0
- data/lib/semantic_release/updaters/git_tag.rb +1 -0
- data/lib/semantic_release/version.rb +1 -1
- data/lib/semantic_release.rb +10 -4
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a204e59fe728f22a01acf960d9d5d7098499df2bccad1bc49a6c92ea4029d2d
|
4
|
+
data.tar.gz: 471caaac5e1f4017ce564917554333d2da54aa7860522a700ffe3049e4be3e0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ac502eeddea51f3947de0cba72763db2d51d44a00eb1edec413d79f4501c67696453220aa1914da165bfc78381c390d2dcc40e1578e2d1219f80b2924a74c52
|
7
|
+
data.tar.gz: 6cfbffd0d594fdc00377f8010f957d292b57866f53117288be79ea63616c7dc660e9d37afad881a90e735e3abc13569776f40e7a4599709268adbdef95abf506
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 1.2.0 (06 February 2025)
|
2
|
+
|
3
|
+
- feat: Mention 'rake release' in git tag updater output if a gemspec file is present
|
4
|
+
- feat: Stage Gemfile.lock after bumping version.rb if a gemspec file is present
|
5
|
+
|
6
|
+
## 1.1.0 (03 February 2025)
|
7
|
+
|
8
|
+
- Add check to prevent re-initialising if semver file already exists
|
9
|
+
- Add configuration options for semver file
|
10
|
+
- Change rake task namespace from `semantic_release` to `release` and make configurable
|
11
|
+
|
1
12
|
## 1.0.1 (02 February 2025)
|
2
13
|
|
3
14
|
- Add blank line after version number in changelog
|
data/README.md
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
# SemanticRelease
|
2
2
|
|
3
|
+
[](https://github.com/ukdave/semantic_release/actions/workflows/main.yml)
|
4
|
+
[](https://github.com/ukdave/semantic_release/releases)
|
5
|
+
[](https://github.com/ukdave/semantic_release/blob/main/LICENSE.txt)
|
6
|
+
|
3
7
|
This gem helps you to manage the version number of your application or library.
|
4
8
|
|
5
9
|
Use the provided Rake tasks to:
|
6
10
|
|
7
11
|
- bump the major, minor, or patch number of your version
|
8
|
-
- automatically update
|
12
|
+
- automatically update your version file (e.g. `lib/version.rb`)
|
9
13
|
- automatically update your changelog (`CHANGELOG.md` or `history.rdoc`)
|
10
14
|
- automatically create a git commit and tag for the release
|
11
15
|
|
@@ -38,14 +42,23 @@ require "semantic_release/rake_task"
|
|
38
42
|
SemanticRelease::RakeTask.new
|
39
43
|
```
|
40
44
|
|
45
|
+
The name of the rake task and other options are configurable like so:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
require "semantic_release/rake_task"
|
49
|
+
SemanticRelease::RakeTask.new(:semver) do |config|
|
50
|
+
config.semver_file = "semver.json"
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
41
54
|
The following tasks are available:
|
42
55
|
|
43
56
|
```
|
44
|
-
rake
|
45
|
-
rake
|
46
|
-
rake
|
47
|
-
rake
|
48
|
-
rake
|
57
|
+
rake release:init
|
58
|
+
rake release:current
|
59
|
+
rake release:major
|
60
|
+
rake release:minor
|
61
|
+
rake release:patch
|
49
62
|
```
|
50
63
|
|
51
64
|
To get the current version inside your application:
|
@@ -58,7 +71,9 @@ SemanticRelease.current_version
|
|
58
71
|
|
59
72
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
60
73
|
|
61
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
74
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
75
|
+
|
76
|
+
To release a new version, run `bundle exec rake semver:XXX` (replacing `XXX` with `major` or `minor` or `patch`), which will bump the version number and create a git tag for the version. Then run `bundle exec rake release`, which will push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
62
77
|
|
63
78
|
## Contributing
|
64
79
|
|
@@ -5,11 +5,13 @@ require "semantic_release"
|
|
5
5
|
|
6
6
|
module SemanticRelease
|
7
7
|
class RakeTask < Rake::TaskLib
|
8
|
-
# rubocop:disable Metrics/MethodLength
|
9
|
-
def initialize
|
10
|
-
super
|
8
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
9
|
+
def initialize(name = :release)
|
10
|
+
super()
|
11
11
|
|
12
|
-
|
12
|
+
yield(SemanticRelease.configuration) if block_given?
|
13
|
+
|
14
|
+
namespace name do
|
13
15
|
desc "Initialise version file"
|
14
16
|
task :init do
|
15
17
|
SemanticRelease.init
|
@@ -36,6 +38,6 @@ module SemanticRelease
|
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
39
|
-
# rubocop:enable Metrics/MethodLength
|
41
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
40
42
|
end
|
41
43
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SemanticRelease
|
4
|
+
module Updaters
|
5
|
+
class GemfileLock < BaseUpdater
|
6
|
+
def self.update
|
7
|
+
return unless gemspec_present?
|
8
|
+
return if system("git check-ignore -q Gemfile.lock")
|
9
|
+
|
10
|
+
`bundle check && git add Gemfile.lock`
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -11,6 +11,7 @@ module SemanticRelease
|
|
11
11
|
|
12
12
|
branch = `git rev-parse --abbrev-ref HEAD`.chomp
|
13
13
|
puts "To push the new tag, use 'git push origin #{branch} --tags'"
|
14
|
+
puts "OR to push the tag and .gem file to rubygems.org use, 'bundle exec rake release'" if gemspec_present?
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
data/lib/semantic_release.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "semantic_release/configuration"
|
3
4
|
require_relative "semantic_release/semver"
|
4
5
|
require_relative "semantic_release/version"
|
5
6
|
Dir[File.join(__dir__, "semantic_release", "updaters", "*.rb")].each { |file| require file }
|
@@ -7,15 +8,19 @@ Dir[File.join(__dir__, "semantic_release", "updaters", "*.rb")].each { |file| re
|
|
7
8
|
module SemanticRelease
|
8
9
|
class Error < StandardError; end
|
9
10
|
|
10
|
-
|
11
|
+
def self.configuration
|
12
|
+
@configuration ||= Configuration.new
|
13
|
+
end
|
11
14
|
|
12
15
|
def self.init
|
16
|
+
raise Error, "#{configuration.semver_file} already exists" if File.exist?(configuration.semver_file)
|
17
|
+
|
13
18
|
version = Semver.new
|
14
|
-
version.save(
|
19
|
+
version.save(configuration.semver_file)
|
15
20
|
end
|
16
21
|
|
17
22
|
def self.current_version
|
18
|
-
Semver.load(
|
23
|
+
Semver.load(configuration.semver_file).to_s
|
19
24
|
end
|
20
25
|
|
21
26
|
def self.inc_major
|
@@ -34,7 +39,7 @@ module SemanticRelease
|
|
34
39
|
end
|
35
40
|
|
36
41
|
def self.increment(term)
|
37
|
-
version = Semver.load(
|
42
|
+
version = Semver.load(configuration.semver_file)
|
38
43
|
version.increment(term)
|
39
44
|
version.save
|
40
45
|
end
|
@@ -42,6 +47,7 @@ module SemanticRelease
|
|
42
47
|
def self.release
|
43
48
|
Updaters::Changelog.update
|
44
49
|
Updaters::VersionRb.update
|
50
|
+
Updaters::GemfileLock.update
|
45
51
|
Updaters::GitTag.update
|
46
52
|
end
|
47
53
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_release
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Bull
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-06 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
12
|
description: |
|
13
13
|
This gem helps you to manage the version number of your application or library. It provides Rake tasks to
|
@@ -22,10 +22,12 @@ files:
|
|
22
22
|
- LICENSE.txt
|
23
23
|
- README.md
|
24
24
|
- lib/semantic_release.rb
|
25
|
+
- lib/semantic_release/configuration.rb
|
25
26
|
- lib/semantic_release/rake_task.rb
|
26
27
|
- lib/semantic_release/semver.rb
|
27
28
|
- lib/semantic_release/updaters/base_updater.rb
|
28
29
|
- lib/semantic_release/updaters/changelog.rb
|
30
|
+
- lib/semantic_release/updaters/gemfile_lock.rb
|
29
31
|
- lib/semantic_release/updaters/git_tag.rb
|
30
32
|
- lib/semantic_release/updaters/version_rb.rb
|
31
33
|
- lib/semantic_release/version.rb
|