File tree Expand file tree Collapse file tree 7 files changed +133
-0
lines changed Expand file tree Collapse file tree 7 files changed +133
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release Please
2+ on :
3+ push :
4+ branches : [ "main" ]
5+ workflow_dispatch :
6+
7+ jobs :
8+ release-please :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : googleapis/release-please-action@v4
12+ with :
13+ manifest-file : .release-please-manifest.json
14+ config-file : .release-please-config.json
Original file line number Diff line number Diff line change 1+ name : Publish gem on GitHub Release
2+ on :
3+ release :
4+ types : [published]
5+
6+ jobs :
7+ publish :
8+ runs-on : ubuntu-latest
9+ permissions :
10+ contents : write
11+ id-token : write
12+
13+ steps :
14+ - uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0
17+
18+ - uses : ruby/setup-ruby@v1
19+ with :
20+ ruby-version : ' 3.3'
21+
22+ - name : Build gem (sanity check)
23+ run : |
24+ gem build simplecov-lcov.gemspec
25+ ls -1 *.gem
26+
27+ - name : Push to RubyGems.org
28+ uses : rubygems/release-gem@v1
Original file line number Diff line number Diff line change 1+ {
2+ "$schema" : " https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" ,
3+ "release-type" : " ruby" ,
4+ "packages" : {
5+ "." : {
6+ "package-name" : " simplecov-lcov" ,
7+ "version-file" : " lib/simplecov/lcov/version.rb" ,
8+ "changelog-path" : " CHANGELOG.md"
9+ }
10+ },
11+ "plugins" : [
12+ " sentence-case"
13+ ]
14+ }
Original file line number Diff line number Diff line change 1+ { "." : " 0.8.0" }
Original file line number Diff line number Diff line change 1+ # Changelog
2+
3+ > ℹ️ This file is managed by ** release-please** .
4+ > It will be automatically updated in future release PRs. Manual editing is generally not needed.
5+
6+ ## Unreleased
7+
8+ - Set up release-please and RubyGems Trusted Publishing.
Original file line number Diff line number Diff line change 1+ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
2+ new file mode 100644
3+ index 0000000..1111111
4+ --- /dev/null
5+ +++ b/.github/workflows/release.yml
6+ @@ -0,0 +1,49 @@
7+ + name: Publish gem on GitHub Release
8+ + on:
9+ + release:
10+ + types: [published]
11+ +
12+ + jobs:
13+ + publish:
14+ + # RubyGems 側の Trusted Publisher で登録した Environment 名と一致させる
15+ + environment: GitHubActions
16+ + runs-on: ubuntu-latest
17+ + permissions:
18+ + contents: write
19+ + id-token: write # ← Trusted Publishing(OIDC)に必須
20+ +
21+ + steps:
22+ + - uses: actions/checkout@v4
23+ + with:
24+ + # 念のため完全取得(CHANGELOG等で過去ログを参照するツールの保険)
25+ + fetch-depth: 0
26+ +
27+ + - uses: ruby/setup-ruby@v1
28+ + with:
29+ + ruby-version: '3.3'
30+ +
31+ + # (任意)ビルドが壊れていないことだけ軽く確認
32+ + - name: Build gem (sanity check)
33+ + run: |
34+ + gem build simplecov-lcov.gemspec
35+ + ls -1 *.gem
36+ +
37+ + # RubyGems 公式 Action(APIキー不要/Trusted Publishing)
38+ + - name: Push to RubyGems.org
39+ + uses: rubygems/release-gem@v1
40+ + # この Action は直前に生成された *.gem を自動検出して push します
Original file line number Diff line number Diff line change 1+ # Releasing & Publishing
2+
3+ This repository uses:
4+
5+ - ** Conventional Commits** (` feat: ` , ` fix: ` , ` chore: ` ...)
6+ - ** release-please** to open automated Release PRs
7+ - ** RubyGems Trusted Publishing** via ` rubygems/release-gem@v1 `
8+
9+ ## Normal flow
10+
11+ 1 . Merge changes to ` main ` using Conventional Commits.
12+ 2 . ` release-please ` creates a ** Release PR** (bumps ` lib/simplecov/lcov/version.rb ` and updates ` CHANGELOG.md ` ).
13+ 3 . Merge the Release PR → a GitHub Release and tag ` vX.Y.Z ` are created.
14+ 4 . The ** Publish** workflow runs on ` release: published ` and pushes the gem to RubyGems.
15+
16+ ## One-time setup on RubyGems.org
17+
18+ 1 . As the gem owner, add a ** Trusted Publisher** on RubyGems.org:
19+ - Select this GitHub repository
20+ - Specify the workflow name: ` Publish gem on GitHub Release `
21+ 2 . No ` RUBYGEMS_API_KEY ` is required (OIDC-based).
22+
23+ ## Notes
24+
25+ - ** Single source of truth (SSOT)** for version is ` SimpleCov::Lcov::VERSION ` in ` lib/simplecov/lcov/version.rb ` .
26+ - Do ** not** manually edit ` CHANGELOG.md ` ; it's auto-generated.
27+ - Protect ` main ` branch and require CI checks to pass before merge.
28+ - If you ever need a manual release, you can trigger ` release-please ` via ` workflow_dispatch ` .
You can’t perform that action at this time.
0 commit comments