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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fbdc6040e9635fef05c0681a1a3513871ea4d4eab781541c802f66dabddf57d
4
- data.tar.gz: 97b35d3393324cc1ada05ca9c43095c16c989d4b00f360ec9af940ff6cfdaefa
3
+ metadata.gz: 7cd80abac13ba08bd5859e66f619ebdff4d6d455410fb44bad753b79ab2ec5df
4
+ data.tar.gz: 1387bcea969820978bcd9799778f4d005bbd11004439f33f55a8091535e7abc4
5
5
  SHA512:
6
- metadata.gz: 954874dbeab6830e58ab484958bbc3679725fdefffce73df7d94a6451a3c31bfa5ab28e2a4a989c51a4194f0572b4b55247ac53dbed98d65e233e50d3be88ad7
7
- data.tar.gz: 2cbc0745b9885ec8cfcb42e6ef5eb11edc06ed9e4b6574388fbb5e34ca128f800f4f0edcd650cab1d474ce998f4e27812ce7b9e283400c7406e9b9f59add0e89
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"`)
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GoGem
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
@@ -38,6 +38,8 @@ module GoGem
38
38
 
39
39
  def define_go_fmt_task: () -> void
40
40
 
41
+ def define_go_build_envs_task: () -> void
42
+
41
43
  def within_target_dir: () { () -> void } -> void
42
44
 
43
45
  def ext_dir: () -> String
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.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-24 00:00:00.000000000 Z
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: