unit-ruby 1.1.0 → 1.1.1
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/.github/workflows/release.yml +86 -0
- data/CHANGELOG.md +20 -2
- data/README.md +5 -7
- data/lib/unit-ruby/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25b9811586fc39305b1c82248f0ad8f509b160f68cd1af3f4e5b8e9b39a93197
|
|
4
|
+
data.tar.gz: 160a4495282bf05385e221ae4d6a816c67669093d40de86cd8cdea6006fa1673
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5b007e90dc256b5b099c2d4a665bf64335130471b6a642cf4cf276ced33d8ecec8eec2d9e9560736b53acbd847bd4320ac0a278b1d4dc867b0056664fe536513
|
|
7
|
+
data.tar.gz: 78240e4d1fa34353ea59eb2ff7f1febce20fea424a1bb4fc209f0915185f2851e357de6ae4013b42c91f325fe7daa28d1987ca740b24289bd3052e00dc5ca333
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Publishes the gem to RubyGems.org via OIDC trusted publishing whenever
|
|
2
|
+
# lib/unit-ruby/version.rb changes on main. No long-lived API key is stored:
|
|
3
|
+
# configure-rubygems-credentials exchanges a short-lived GitHub OIDC token for
|
|
4
|
+
# RubyGems credentials by assuming the OIDC API key role configured on
|
|
5
|
+
# rubygems.org. `bundle exec rake release` then builds the gem, creates and
|
|
6
|
+
# pushes the vX.Y.Z tag, and publishes to RubyGems.org.
|
|
7
|
+
name: Release
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
push:
|
|
11
|
+
branches: [main]
|
|
12
|
+
paths:
|
|
13
|
+
- lib/unit-ruby/version.rb
|
|
14
|
+
|
|
15
|
+
# Never run two releases at once.
|
|
16
|
+
concurrency:
|
|
17
|
+
group: release
|
|
18
|
+
cancel-in-progress: false
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
push:
|
|
22
|
+
name: Push gem to RubyGems.org
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
permissions:
|
|
25
|
+
contents: write # push the version tag
|
|
26
|
+
id-token: write # mint the OIDC token for trusted publishing
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
fetch-tags: true
|
|
32
|
+
persist-credentials: false
|
|
33
|
+
- name: Set up Ruby
|
|
34
|
+
uses: ruby/setup-ruby@12fd324f1d0b43274fdc8130f6980590a667c455 # v1.312.0
|
|
35
|
+
with:
|
|
36
|
+
ruby-version: "3.4"
|
|
37
|
+
bundler-cache: true
|
|
38
|
+
- name: Read and validate gem version
|
|
39
|
+
id: version
|
|
40
|
+
run: |
|
|
41
|
+
version="$(ruby -e 'require "./lib/unit-ruby/version"; print Unit::VERSION')"
|
|
42
|
+
# Enforce semver before the value is used anywhere else, so a crafted
|
|
43
|
+
# version string can't smuggle shell metacharacters into later steps.
|
|
44
|
+
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
|
|
45
|
+
echo "Invalid version format: $version" >&2
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
49
|
+
- name: Check whether this version is already tagged
|
|
50
|
+
id: tag
|
|
51
|
+
env:
|
|
52
|
+
VERSION: ${{ steps.version.outputs.version }}
|
|
53
|
+
run: |
|
|
54
|
+
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
|
|
55
|
+
echo "Version v$VERSION already released; skipping."
|
|
56
|
+
echo "exists=true" >> "$GITHUB_OUTPUT"
|
|
57
|
+
else
|
|
58
|
+
echo "exists=false" >> "$GITHUB_OUTPUT"
|
|
59
|
+
fi
|
|
60
|
+
- name: Configure RubyGems credentials
|
|
61
|
+
if: steps.tag.outputs.exists == 'false'
|
|
62
|
+
uses: rubygems/configure-rubygems-credentials@762a4b77c3300434bb57c7ce80b20e36231927aa # v2.0.0
|
|
63
|
+
with:
|
|
64
|
+
role-to-assume: rg_oidc_akr_54hgswsa4knajxk89skj
|
|
65
|
+
- name: Set git identity and push URL
|
|
66
|
+
if: steps.tag.outputs.exists == 'false'
|
|
67
|
+
run: |
|
|
68
|
+
# Attribute the release tag to the last committer on HEAD.
|
|
69
|
+
git config --global user.email "$(git log -1 --pretty=format:'%ae')"
|
|
70
|
+
git config --global user.name "$(git log -1 --pretty=format:'%an')"
|
|
71
|
+
# Restore push credentials (checkout ran with persist-credentials: false)
|
|
72
|
+
# so `rake release` can push the tag.
|
|
73
|
+
git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY"
|
|
74
|
+
- name: Release
|
|
75
|
+
if: steps.tag.outputs.exists == 'false'
|
|
76
|
+
run: bundle exec rake release
|
|
77
|
+
- name: Wait for release to propagate
|
|
78
|
+
if: steps.tag.outputs.exists == 'false'
|
|
79
|
+
run: |
|
|
80
|
+
gem install rubygems-await
|
|
81
|
+
gem_tuple="$(ruby -rbundler/setup -rbundler -e '
|
|
82
|
+
spec = Bundler.definition.specs.find {|s| s.name == ARGV[0] }
|
|
83
|
+
raise "No spec for #{ARGV[0]}" unless spec
|
|
84
|
+
print [spec.name, spec.version, spec.platform].join(":")
|
|
85
|
+
' "unit-ruby")"
|
|
86
|
+
gem await "${gem_tuple}"
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 1.1.1
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Publish releases automatically to RubyGems.org via OIDC trusted publishing when `version.rb` changes on `main`.
|
|
6
|
+
|
|
7
|
+
## 1.1.0
|
|
8
|
+
|
|
9
|
+
- Support Rails 8 / Active Support 8 (widen the `activesupport` dependency to `>= 7.0, < 9`).
|
|
10
|
+
- Stop committing `Gemfile.lock` so applications resolve dependencies against the gemspec
|
|
11
|
+
|
|
12
|
+
## 1.0.1
|
|
13
|
+
|
|
14
|
+
- Resolve dependency vulnerabilities by bumping vulnerable transitive dependencies.
|
|
15
|
+
|
|
16
|
+
## 1.0.0
|
|
17
|
+
|
|
18
|
+
- First stable release, promoting the 0.12.x API to 1.0 with no breaking changes.
|
|
19
|
+
- Expanded README documentation and cleaned up the gemspec and CI configuration.
|
|
20
|
+
|
|
21
|
+
## 0.1.0
|
|
22
|
+
|
|
23
|
+
Initial release
|
data/README.md
CHANGED
|
@@ -129,15 +129,13 @@ $ bundle exec rake install
|
|
|
129
129
|
|
|
130
130
|
## Releasing
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
Releases are minted automatically. When a change to `lib/unit-ruby/version.rb` lands on `main`, the [Release workflow](.github/workflows/release.yml) builds the gem, tags the commit `vX.Y.Z`, and publishes to [RubyGems.org](https://rubygems.org/gems/unit-ruby/). No manual `gem push` is required, and no RubyGems API key is stored — the workflow authenticates via [OIDC trusted publishing](https://guides.rubygems.org/trusted-publishing/).
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
To cut a release:
|
|
135
135
|
|
|
136
|
-
1.
|
|
137
|
-
2.
|
|
138
|
-
3.
|
|
139
|
-
4. Push this latest version of the gem to RubyGems.org by calling `gem push unit-ruby-[gem version number].gem`
|
|
140
|
-
5. Merge PR into `main` branch
|
|
136
|
+
1. Make your changes, then bump the version in `lib/unit-ruby/version.rb` following [semantic versioning](https://semver.org/) and add an entry to `CHANGELOG.md`.
|
|
137
|
+
2. Open a PR and get it approved by the appropriate member(s) of the engineering team.
|
|
138
|
+
3. Merge to `main`. The Release workflow publishes the new version automatically. If the version is unchanged, no release is cut.
|
|
141
139
|
|
|
142
140
|
## Contributing
|
|
143
141
|
|
data/lib/unit-ruby/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: unit-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chloe Isacke
|
|
@@ -153,6 +153,7 @@ extra_rdoc_files: []
|
|
|
153
153
|
files:
|
|
154
154
|
- ".env.example"
|
|
155
155
|
- ".github/workflows/ci.yml"
|
|
156
|
+
- ".github/workflows/release.yml"
|
|
156
157
|
- ".gitignore"
|
|
157
158
|
- ".rspec"
|
|
158
159
|
- ".rubocop.yml"
|