ruby-gem-release 0.2.3 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3159b6a34e7a7ee3eb36a7441bccda73603c8a52cfc1ff3947d1f1537541384f
4
- data.tar.gz: cc91123bbeb89c0c204ec9cb9d497612b96e46157e55eff91910c671fb7f751a
3
+ metadata.gz: 3b3f5a468e45bd12e4299965c4e9417c9b49b0ac11e49339e5dd448c03ee10de
4
+ data.tar.gz: afb1782d46c31b3a2a93f582315f88d0c24947518a5fe9d3d5731acf01b7b46e
5
5
  SHA512:
6
- metadata.gz: d87ee0f1c275ba6bdeffffa4bf5d9ec1026cda40f397f21bf17e08596c61ab3f78d4d6e195a72240a00b284f886e139d80f7f0d37302c1dd5f502b750ab4cdc7
7
- data.tar.gz: 0a90bfb6f3279c0264b93ba0d6618f5030ea3e396840122e20bd7a9196e68427d410e14a2adc014983d716f44201cfeca3581aa9c316bc52c293edf276eb12e7
6
+ metadata.gz: e25947ecf903be0158b6958a77fbccf5e50cdd74b0984f7c3f7ab3cf22c72b26fa0aaf90b0006bbbcc478d8e3b232152cbb8fc52ea07c973323d5150bbca2255
7
+ data.tar.gz: 8c97476f80580b55cff61957917135539962a63fb664948895a8e7b301cdeb6f5bfe3f44d87286fcaeec5ffb25f82d34df7457e10d28cd197676bac952154809
data/CHANGELOG.md CHANGED
@@ -1,10 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.3 (2026/11/08)
3
+ ## 0.3.0 (2026/11/07)
4
+
5
+ - [#22](https://github.com/dblock/ruby-gem-release/pull/22): Make the release timezone configurable with a UTC default, use Eastern Time for this project's releases, and prepare version 0.3.0 - [@dblock](https://github.com/dblock).
6
+
7
+ ## 0.2.3 (2026/11/07)
4
8
 
5
9
  - [#21](https://github.com/dblock/ruby-gem-release/pull/21): Remove dry-run inputs and release context, always publish when dispatched, and test installed release callbacks with isolated publication boundaries (breaking change) - [@dblock](https://github.com/dblock).
6
10
 
7
- ## 0.2.2 (2026/11/08)
11
+ ## 0.2.2 (2026/11/07)
8
12
 
9
13
  - [#18](https://github.com/dblock/ruby-gem-release/pull/18): Update README release tags as part of the next development iteration - [@dblock](https://github.com/dblock).
10
14
  - [#19](https://github.com/dblock/ruby-gem-release/pull/19): Use the incremented version in next development iteration commit messages and update terminology throughout workflows and documentation - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -53,7 +53,7 @@ permissions:
53
53
 
54
54
  jobs:
55
55
  release:
56
- uses: dblock/ruby-gem-release/.github/workflows/release.yml@v0.2.2
56
+ uses: dblock/ruby-gem-release/.github/workflows/release.yml@v0.2.3
57
57
  with:
58
58
  ruby-version: '3.3'
59
59
  rubygems-owner: ${{ inputs.rubygems-owner }}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyGemRelease
4
- VERSION = '0.2.3'
4
+ VERSION = '0.3.0'
5
5
  end
@@ -10,16 +10,19 @@ module RubyGemRelease
10
10
  class Context
11
11
  def configure!
12
12
  names = %w[INPUT_VERSION INPUT_GEMSPEC DEFAULT_BRANCH GIT_USER_NAME GIT_USER_EMAIL RUBYGEMS_OWNER]
13
- export(names.to_h { |name| [name, ENV.fetch(name)] })
13
+ timezone = ENV.fetch('TZ', 'UTC')
14
+ validate_timezone(timezone)
15
+ export(names.to_h { |name| [name, ENV.fetch(name)] }.merge('TZ' => timezone))
14
16
  end
15
17
 
16
18
  def capture!
17
19
  check_branch
20
+ validate_timezone(ENV.fetch('TZ', 'UTC'))
18
21
  package = Package::RubyGem.new(gemspec: ENV.fetch('INPUT_GEMSPEC', nil))
19
22
  release = initial_release(package)
20
23
  git = configured_git
21
24
  git.check_current!(release)
22
- export('GEMSPEC' => package.gemspec, 'RELEASE_PREVIOUS_VERSION' => release.version,
25
+ export('TZ' => ENV.fetch('TZ', 'UTC'), 'GEMSPEC' => package.gemspec, 'RELEASE_PREVIOUS_VERSION' => release.version,
23
26
  'RELEASE_DATE' => release.date.iso8601, 'RELEASE_INITIAL_COMMIT' => git.head)
24
27
  end
25
28
 
@@ -39,7 +42,17 @@ module RubyGemRelease
39
42
  version = package.version
40
43
  validate_version(version)
41
44
  validate_version(ENV.fetch('INPUT_VERSION')) unless ENV.fetch('INPUT_VERSION', '').empty?
42
- Release.new(version: version, previous_version: version, date: Time.now.utc.to_date)
45
+ Release.new(version: version, previous_version: version, date: release_date)
46
+ end
47
+
48
+ def release_date
49
+ (ENV.key?('TZ') ? Time.now.getlocal : Time.now.utc).to_date
50
+ end
51
+
52
+ def validate_timezone(timezone)
53
+ valid = %r{\A[A-Za-z0-9_+-]+(?:/[A-Za-z0-9_+-]+)*\z}.match?(timezone) &&
54
+ File.file?(File.join('/usr/share/zoneinfo', timezone))
55
+ raise ArgumentError, 'timezone must identify an installed timezone, such as UTC or America/New_York' unless valid
43
56
  end
44
57
 
45
58
  def configured_git
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-gem-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine