milestoner 10.0.2 → 11.0.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
- checksums.yaml.gz.sig +2 -1
- data.tar.gz.sig +0 -0
- data/{LICENSE.md → LICENSE.adoc} +29 -30
- data/README.adoc +225 -0
- data/bin/milestoner +1 -1
- data/lib/milestoner.rb +2 -2
- data/lib/milestoner/cli.rb +5 -5
- data/lib/milestoner/commit.rb +24 -0
- data/lib/milestoner/identity.rb +4 -15
- data/lib/milestoner/pusher.rb +12 -6
- data/lib/milestoner/tagger.rb +35 -62
- metadata +43 -225
- metadata.gz.sig +0 -0
- data/README.md +0 -204
- data/lib/milestoner/git/config.rb +0 -30
- data/lib/milestoner/git/kit.rb +0 -48
metadata.gz.sig
CHANGED
Binary file
|
data/README.md
DELETED
@@ -1,204 +0,0 @@
|
|
1
|
-
<p align="center">
|
2
|
-
<img src="milestoner.png" alt="Milestoner Icon"/>
|
3
|
-
</p>
|
4
|
-
|
5
|
-
# Milestoner
|
6
|
-
|
7
|
-
[](http://badge.fury.io/rb/milestoner)
|
8
|
-
[](https://codeclimate.com/github/bkuhlmann/milestoner/maintainability)
|
9
|
-
[](https://codeclimate.com/github/bkuhlmann/milestoner/test_coverage)
|
10
|
-
[](https://circleci.com/gh/bkuhlmann/milestoner)
|
11
|
-
|
12
|
-
A command line interface for crafting Git repository milestones (also known as *tags*).
|
13
|
-
|
14
|
-
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
15
|
-
|
16
|
-
## Table of Contents
|
17
|
-
|
18
|
-
- [Features](#features)
|
19
|
-
- [Screencasts](#screencasts)
|
20
|
-
- [Requirements](#requirements)
|
21
|
-
- [Setup](#setup)
|
22
|
-
- [Usage](#usage)
|
23
|
-
- [Command Line Interface (CLI)](#command-line-interface-cli)
|
24
|
-
- [Customization](#customization)
|
25
|
-
- [Security](#security)
|
26
|
-
- [Tests](#tests)
|
27
|
-
- [Versioning](#versioning)
|
28
|
-
- [Code of Conduct](#code-of-conduct)
|
29
|
-
- [Contributions](#contributions)
|
30
|
-
- [License](#license)
|
31
|
-
- [History](#history)
|
32
|
-
- [Credits](#credits)
|
33
|
-
|
34
|
-
<!-- Tocer[finish]: Auto-generated, don't remove. -->
|
35
|
-
|
36
|
-
## Features
|
37
|
-
|
38
|
-
- Uses [Versionaire](https://github.com/bkuhlmann/versionaire) for
|
39
|
-
[Semantic Versioning](https://semver.org).
|
40
|
-
- Format: `<major>.<minor>.<patch>`.
|
41
|
-
- Example: `0.1.0`.
|
42
|
-
- Ensures Git commits since last tag (or initialization of repository) are included.
|
43
|
-
- Ensures Git commit messages are grouped by prefix, in order defined. For more details, see [Git
|
44
|
-
Cop Subject Prefix](https://github.com/bkuhlmann/git-cop#commit-subject-prefix) for details.
|
45
|
-
Defaults (can be customized):
|
46
|
-
- Fixed
|
47
|
-
- Added
|
48
|
-
- Updated
|
49
|
-
- Removed
|
50
|
-
- Refactored
|
51
|
-
- Ensures Git commit merge messages are excluded.
|
52
|
-
- Ensures Git commit messages are alphabetically sorted.
|
53
|
-
- Ensures duplicate Git commit messages are removed (if any).
|
54
|
-
- Ensures Git commit messages are sanitized by removing extra spaces and `[ci skip]` text within
|
55
|
-
each Git tag message.
|
56
|
-
- Provides optional security for signing Git tags with [GnuPG](https://www.gnupg.org) signing key.
|
57
|
-
|
58
|
-
## Screencasts
|
59
|
-
|
60
|
-
[](https://asciinema.org/a/293098)
|
61
|
-
|
62
|
-
## Requirements
|
63
|
-
|
64
|
-
1. A UNIX-based system.
|
65
|
-
1. [Ruby 2.7.x](https://www.ruby-lang.org).
|
66
|
-
1. [GnuPG](https://www.gnupg.org).
|
67
|
-
|
68
|
-
## Setup
|
69
|
-
|
70
|
-
Type the following to install:
|
71
|
-
|
72
|
-
gem install milestoner
|
73
|
-
|
74
|
-
## Usage
|
75
|
-
|
76
|
-
### Command Line Interface (CLI)
|
77
|
-
|
78
|
-
From the command line, type: `milestoner help`
|
79
|
-
|
80
|
-
milestoner -C, [--commits] # Show commits for next milestone.
|
81
|
-
milestoner -P, [--publish=VERSION] # Tag and push milestone to remote repository.
|
82
|
-
milestoner -c, [--config] # Manage gem configuration.
|
83
|
-
milestoner -h, [--help=COMMAND] # Show this message or get help for a command.
|
84
|
-
milestoner -p, [--push=VERSION] # Push local tag to remote repository.
|
85
|
-
milestoner -t, [--tag=VERSION] # Tag local repository with new version.
|
86
|
-
milestoner -v, [--version] # Show gem version.
|
87
|
-
|
88
|
-
For config options, type: `milestoner help --config`
|
89
|
-
|
90
|
-
-e, [--edit], [--no-edit] # Edit gem configuration.
|
91
|
-
-i, [--info], [--no-info] # Print gem configuration info.
|
92
|
-
|
93
|
-
For tag options, type: `milestoner help --tag`
|
94
|
-
|
95
|
-
-s, [--sign], [--no-sign] # Sign tag with GPG key.
|
96
|
-
|
97
|
-
For publish options, type: `milestoner help --publish`
|
98
|
-
|
99
|
-
-s, [--sign], [--no-sign] # Sign tag with GPG key.
|
100
|
-
|
101
|
-
When using Milestoner, the `--publish` command is intended to be the only command necessary for
|
102
|
-
publishing a new release as it handles all of the steps necessary for tagging and pushing a new
|
103
|
-
milestone. Should individual steps be needed, then the `--tag` and `--push` options are available.
|
104
|
-
|
105
|
-
### Customization
|
106
|
-
|
107
|
-
This gem can be configured via a global configuration:
|
108
|
-
|
109
|
-
~/.config/milestoner/configuration.yml
|
110
|
-
|
111
|
-
|
112
|
-
It can also be configured via [XDG](https://github.com/bkuhlmann/xdg) environment variables.
|
113
|
-
|
114
|
-
The default configuration is as follows:
|
115
|
-
|
116
|
-
:git_commit_prefixes:
|
117
|
-
- Fixed
|
118
|
-
- Added
|
119
|
-
- Updated
|
120
|
-
- Removed
|
121
|
-
- Refactored
|
122
|
-
:git_tag_sign: false
|
123
|
-
|
124
|
-
Feel free to take this default configuration, modify, and save as your own custom
|
125
|
-
`configuration.yml`.
|
126
|
-
|
127
|
-
The `configuration.yml` file can be configured as follows:
|
128
|
-
|
129
|
-
- `git_commit_prefixes`: Should the default prefixes not be desired, you can define Git commit
|
130
|
-
prefixes that match your style. *NOTE: Prefix order is important with the first prefix defined
|
131
|
-
taking precedence over the second and so forth.* Special characters are allowed for prefixes but
|
132
|
-
should be enclosed in quotes. To disable prefix usage completely, use an empty array. Example:
|
133
|
-
`:git_commit_prefixes: []`.
|
134
|
-
- `git_tag_sign`: Defaults to `false` but can be enabled by setting to `true`. When enabled, a Git
|
135
|
-
tag will require GPG signing for enhanced security and include a signed signature as part of the
|
136
|
-
Git tag. This is useful for public milestones where the author of a milestone can be verified to
|
137
|
-
ensure milestone integrity/security.
|
138
|
-
|
139
|
-
## Security
|
140
|
-
|
141
|
-
To securely sign your Git tags, install and configure [GPG](https://www.gnupg.org):
|
142
|
-
|
143
|
-
brew install gpg
|
144
|
-
gpg --gen-key
|
145
|
-
|
146
|
-
When creating your GPG key, choose these settings:
|
147
|
-
|
148
|
-
- Key kind: RSA and RSA (default)
|
149
|
-
- Key size: 4096
|
150
|
-
- Key validity: 0
|
151
|
-
- Real Name: `<your name>`
|
152
|
-
- Email: `<your email>`
|
153
|
-
- Passphrase: `<your passphrase>`
|
154
|
-
|
155
|
-
To obtain your key, run the following and take the part after the forward slash:
|
156
|
-
|
157
|
-
gpg --list-keys | grep pub
|
158
|
-
|
159
|
-
Add your key to your global Git configuration in the `[user]` section. Example:
|
160
|
-
|
161
|
-
[user]
|
162
|
-
signingkey = <your GPG key>
|
163
|
-
|
164
|
-
Now, when publishing a new milestone (i.e. `milestoner --publish <version> --sign`), signing of your
|
165
|
-
Git tag will happen automatically. You will be prompted for the GPG Passphrase each time but that is
|
166
|
-
to be expected.
|
167
|
-
|
168
|
-
## Tests
|
169
|
-
|
170
|
-
To test, run:
|
171
|
-
|
172
|
-
bundle exec spec
|
173
|
-
|
174
|
-
## Versioning
|
175
|
-
|
176
|
-
Read [Semantic Versioning](https://semver.org) for details. Briefly, it means:
|
177
|
-
|
178
|
-
- Major (X.y.z) - Incremented for any backwards incompatible public API changes.
|
179
|
-
- Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
|
180
|
-
- Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
|
181
|
-
|
182
|
-
## Code of Conduct
|
183
|
-
|
184
|
-
Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By
|
185
|
-
participating in this project you agree to abide by its terms.
|
186
|
-
|
187
|
-
## Contributions
|
188
|
-
|
189
|
-
Read [CONTRIBUTING](CONTRIBUTING.md) for details.
|
190
|
-
|
191
|
-
## License
|
192
|
-
|
193
|
-
Copyright 2015 [Alchemists](https://www.alchemists.io).
|
194
|
-
Read [LICENSE](LICENSE.md) for details.
|
195
|
-
|
196
|
-
## History
|
197
|
-
|
198
|
-
Read [CHANGES](CHANGES.md) for details.
|
199
|
-
Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
|
200
|
-
|
201
|
-
## Credits
|
202
|
-
|
203
|
-
Developed by [Brooke Kuhlmann](https://www.alchemists.io) at
|
204
|
-
[Alchemists](https://www.alchemists.io).
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "open3"
|
4
|
-
|
5
|
-
module Milestoner
|
6
|
-
module Git
|
7
|
-
# A lightweight Git Config wrapper.
|
8
|
-
class Config
|
9
|
-
def initialize shell: Open3
|
10
|
-
@shell = shell
|
11
|
-
end
|
12
|
-
|
13
|
-
def get key
|
14
|
-
shell.capture3 "git config --get #{key}"
|
15
|
-
end
|
16
|
-
|
17
|
-
def set key, value
|
18
|
-
shell.capture3 %(git config --add #{key} "#{value}")
|
19
|
-
end
|
20
|
-
|
21
|
-
def value key
|
22
|
-
get(key).first.chomp
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
attr_reader :shell
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
data/lib/milestoner/git/kit.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Milestoner
|
4
|
-
module Git
|
5
|
-
# A lightweight Git wrapper.
|
6
|
-
class Kit
|
7
|
-
def initialize
|
8
|
-
@git_dir = File.join Dir.pwd, ".git"
|
9
|
-
end
|
10
|
-
|
11
|
-
def supported?
|
12
|
-
File.exist? git_dir
|
13
|
-
end
|
14
|
-
|
15
|
-
def commits?
|
16
|
-
!shell("git log").empty?
|
17
|
-
end
|
18
|
-
|
19
|
-
def push_tags
|
20
|
-
shell "git push --tags"
|
21
|
-
end
|
22
|
-
|
23
|
-
def tagged?
|
24
|
-
!shell("git tag").empty?
|
25
|
-
end
|
26
|
-
|
27
|
-
def tag_local? tag
|
28
|
-
shell("git tag --list #{tag}").match?(/\A#{tag}\Z/)
|
29
|
-
end
|
30
|
-
|
31
|
-
def tag_remote? tag
|
32
|
-
shell("git ls-remote --tags origin #{tag}").match?(%r(.+tags\/#{tag}\Z))
|
33
|
-
end
|
34
|
-
|
35
|
-
def remote?
|
36
|
-
!shell("git config remote.origin.url").empty?
|
37
|
-
end
|
38
|
-
|
39
|
-
private
|
40
|
-
|
41
|
-
attr_reader :git_dir
|
42
|
-
|
43
|
-
def shell command
|
44
|
-
String `#{command}`
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|