go_gem 0.3.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: 0b0aa853597fa94b01abc00c98cd1e743dda0d48c3909a56e24912608e38f659
4
- data.tar.gz: 587c9a7cd18f75e599bf73488e8a84f65dfe851a35361e5f1f029a158bbf056e
3
+ metadata.gz: 7cd80abac13ba08bd5859e66f619ebdff4d6d455410fb44bad753b79ab2ec5df
4
+ data.tar.gz: 1387bcea969820978bcd9799778f4d005bbd11004439f33f55a8091535e7abc4
5
5
  SHA512:
6
- metadata.gz: 2164714d694ef237e8f41aa32121cef42a597ef86d251d5b47dcdae13741dd3fc1eab6c0278b8735c08e82b6bb49667145eb48785723bbc4dcb9cd219fb3d41b
7
- data.tar.gz: c51924855aabdf873fcf78ba052014e89fb16e9792b9633a8699234d09dddd379e519f5f38a5efd524f9677e21f708fbdc7ec329a7de3dba66c4307af216639c
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.3.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.3.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-21 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: