Skip to content

Commit 7b4d318

Browse files
authored
Merge pull request #174 from sue445/feature/go_gem
Add GoGem skeleton in gem/
2 parents 951b3f0 + 53b6b76 commit 7b4d318

File tree

20 files changed

+232
-12
lines changed

20 files changed

+232
-12
lines changed

.github/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ go-module:
22
- changed-files:
33
- any-glob-to-any-file: "ruby/**/*"
44

5-
ruby-gem:
5+
go_gem:
66
- changed-files:
77
- any-glob-to-any-file: "gem/**/*"
88

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,44 @@ jobs:
158158
status: ${{ job.status }}
159159
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
160160

161+
go_gem:
162+
name: "go_gem (Ruby ${{ matrix.ruby }})"
163+
164+
runs-on: ubuntu-latest
165+
166+
strategy:
167+
fail-fast: false
168+
169+
matrix:
170+
ruby:
171+
- "3.3"
172+
173+
steps:
174+
- uses: actions/checkout@v4
175+
176+
- uses: ruby/setup-ruby@v1
177+
with:
178+
ruby-version: ${{ matrix.ruby }}
179+
bundler-cache: true
180+
181+
- run: bundle exec rake go_gem:test
182+
183+
- name: Slack Notification (not success)
184+
uses: act10ns/slack@v2
185+
if: "! success()"
186+
continue-on-error: true
187+
with:
188+
status: ${{ job.status }}
189+
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
190+
matrix: ${{ toJson(matrix) }}
191+
161192
notify:
162193
needs:
163194
- test
164195
- go-lint
165196
- ruby-lint
166197
- ruby-rbs
198+
- go_gem
167199

168200
runs-on: ubuntu-latest
169201

.rubocop.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ AllCops:
1414
- '.git/**/*'
1515

1616
Gemspec/RequireMFA:
17-
Enabled: false
17+
Exclude:
18+
- ruby/testdata/example/example.gemspec
1819

1920
Layout/DotPosition:
2021
EnforcedStyle: trailing

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@ group :test do
2121
gem "steep"
2222
gem "test-unit"
2323
end
24+
25+
gemspec path: "./gem/"

Gemfile.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
PATH
2+
remote: gem
3+
specs:
4+
go_gem (0.1.0.alpha1)
5+
16
GEM
27
remote: https://rubygems.org/
38
specs:
@@ -151,6 +156,7 @@ PLATFORMS
151156
ruby
152157

153158
DEPENDENCIES
159+
go_gem!
154160
rake
155161
rake-compiler
156162
rspec

Rakefile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,21 +112,25 @@ namespace :ruby_h_to_go do
112112
end
113113
end
114114

115+
namespace :go_gem do
116+
desc "Run go_gem test"
117+
task :test do
118+
Dir.chdir(File.join(__dir__, "gem")) do
119+
sh "rspec"
120+
end
121+
end
122+
end
123+
115124
desc "Run _tools/ruby_h_to_go"
116125
task :ruby_h_to_go do
117126
sh "./_tools/ruby_h_to_go/exe/ruby_h_to_go"
118127
end
119128

120-
desc "Create and push tag"
121-
task :tag do
122-
version = File.read("VERSION").strip
123-
sh "git tag -a #{version} -m 'Release #{version}'"
124-
sh "git push --tags"
125-
end
126-
127129
desc "Release package"
128-
task release: :tag do
129-
sh "git push origin main"
130+
task :release do
131+
Dir.chdir(File.join(__dir__, "gem")) do
132+
sh "rake release"
133+
end
130134
end
131135

132136
task build_all: %w[ruby:build_all go:build_all ruby_h_to_go:test patch_for_go_gem:test]

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

gem/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/.bundle/
2+
/.yardoc
3+
/_yardoc/
4+
/coverage/
5+
/doc/
6+
/pkg/
7+
/spec/reports/
8+
/tmp/
9+
10+
# rspec failure tracking
11+
.rspec_status

gem/.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--format documentation
2+
--color
3+
--require spec_helper

gem/LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2024 sue445
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)