go_gem 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/lib/go_gem/rake_task.rb +15 -0
- data/lib/go_gem/version.rb +1 -1
- data/sig/go_gem/rake_task.rbs +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cd80abac13ba08bd5859e66f619ebdff4d6d455410fb44bad753b79ab2ec5df
|
4
|
+
data.tar.gz: 1387bcea969820978bcd9799778f4d005bbd11004439f33f55a8091535e7abc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cad8fc2dcf881633eb9d72893f8a8715d5dd1fdc5049467be52191d2fdec6f906fc1dcbb6574398bd264c9cde4c288976daf71af63fadb98ba49754f1a6dadd8
|
7
|
+
data.tar.gz: 9c5600c52ee041801fbdb421ca0ac60e4f589c31e9c49b194cbcf270707540c423e2439bc97c610377467f683ff2a324c6350c889a8f93120dc484cb6e658708
|
data/README.md
CHANGED
@@ -49,6 +49,7 @@ Following tasks are generated
|
|
49
49
|
* `rake go:test`
|
50
50
|
* `rake go:testrace`
|
51
51
|
* `rake go:fmt`
|
52
|
+
* `rake go:build_envs`
|
52
53
|
|
53
54
|
#### Example (With config)
|
54
55
|
```ruby
|
@@ -68,6 +69,7 @@ Following tasks are generated
|
|
68
69
|
* `rake go5:test`
|
69
70
|
* `rake go5:testrace`
|
70
71
|
* `rake go5:fmt`
|
72
|
+
* `rake go5:build_envs`
|
71
73
|
|
72
74
|
#### Example (Add additional tasks)
|
73
75
|
```ruby
|
@@ -89,6 +91,24 @@ namespace :go do
|
|
89
91
|
end
|
90
92
|
```
|
91
93
|
|
94
|
+
#### Example (Use [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action))
|
95
|
+
```yml
|
96
|
+
jobs:
|
97
|
+
go-lint:
|
98
|
+
runs-on: ubuntu-latest
|
99
|
+
|
100
|
+
steps:
|
101
|
+
- uses: actions/checkout@v4
|
102
|
+
- uses: actions/setup-go@v5
|
103
|
+
- uses: ruby/setup-ruby@v1
|
104
|
+
|
105
|
+
- name: export CGO_CFLAGS for golangci-lint
|
106
|
+
run: bundle exec rake go:build_envs[CGO_CFLAGS] >> $GITHUB_ENV
|
107
|
+
|
108
|
+
- name: Run golangci-lint
|
109
|
+
uses: golangci/golangci-lint-action@v6
|
110
|
+
```
|
111
|
+
|
92
112
|
#### Available configurations
|
93
113
|
* `task_namespace` : task namespace (default: `:go`)
|
94
114
|
* `go_bin_path` : path to go binary (default: `"go"`)
|
data/lib/go_gem/rake_task.rb
CHANGED
@@ -86,6 +86,7 @@ module GoGem
|
|
86
86
|
define_go_test_task
|
87
87
|
define_go_testrace_task
|
88
88
|
define_go_fmt_task
|
89
|
+
define_go_build_envs_task
|
89
90
|
end
|
90
91
|
end
|
91
92
|
|
@@ -168,5 +169,19 @@ module GoGem
|
|
168
169
|
end
|
169
170
|
end
|
170
171
|
end
|
172
|
+
|
173
|
+
def define_go_build_envs_task
|
174
|
+
desc "Print build envs for `go build`"
|
175
|
+
task(:build_envs, [:env_name]) do |_, args|
|
176
|
+
if args[:env_name]
|
177
|
+
value = RakeTask.build_env_vars[args[:env_name]]
|
178
|
+
puts "#{args[:env_name]}=#{value}"
|
179
|
+
else
|
180
|
+
RakeTask.build_env_vars.each do |name, value|
|
181
|
+
puts "#{name}=#{value}"
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
171
186
|
end
|
172
187
|
end
|
data/lib/go_gem/version.rb
CHANGED
data/sig/go_gem/rake_task.rbs
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: go_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Helpers for compiling Go extensions for ruby
|
14
14
|
email:
|