xot 0.1.31 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/release-gem.yml +59 -0
- data/.github/workflows/test.yml +0 -6
- data/.github/workflows/utils.rb +13 -5
- data/ChangeLog.md +5 -0
- data/Rakefile +1 -2
- data/VERSION +1 -1
- data/lib/xot/rake/util.rb +25 -4
- data/lib/xot/rake.rb +22 -3
- metadata +3 -3
- data/.github/workflows/release.yml +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a7e1bc3f6614364c9e0351687c284d86fb2acdd6e90ed831b176f2f523227d1
|
4
|
+
data.tar.gz: 3be0124301e324255f2ab787140524231c42731af1662b5d4e279abec29efc47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ea1f3a95375e0de9722cce59ba6ce229948c42c4bac5de353e737a52d8407985eace63de4559843d8bb9ed2cc0f65838cdcd70c0a8abc39e1f955b045d600c0
|
7
|
+
data.tar.gz: 3eec5192e6db769cb4b89bd4f7029f4489adaa74ce905802e4d338decd5e38cc7a3e6901f551303fc2f4a603049f80a78cfaf04b92f64851d422604661037ce8
|
@@ -0,0 +1,59 @@
|
|
1
|
+
name: Release Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags: ['v[0-9]*']
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
release:
|
9
|
+
runs-on: macos-latest
|
10
|
+
|
11
|
+
steps:
|
12
|
+
- name: ruby 3.2
|
13
|
+
uses: ruby/setup-ruby@v1
|
14
|
+
with:
|
15
|
+
ruby-version: 3.2
|
16
|
+
|
17
|
+
- name: checkout
|
18
|
+
uses: actions/checkout@v2
|
19
|
+
|
20
|
+
- name: setup dependencies
|
21
|
+
run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
|
22
|
+
|
23
|
+
- name: test
|
24
|
+
run: rake test
|
25
|
+
|
26
|
+
- name: create gem
|
27
|
+
id: gem
|
28
|
+
run: |
|
29
|
+
rake gem
|
30
|
+
echo path=$(ruby -e 'print Dir.glob("*.gem").first') >> $GITHUB_OUTPUT
|
31
|
+
|
32
|
+
- name: create github release
|
33
|
+
id: release
|
34
|
+
uses: actions/create-release@v1
|
35
|
+
env:
|
36
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
37
|
+
with:
|
38
|
+
tag_name: ${{ github.ref }}
|
39
|
+
release_name: ${{ github.ref }}
|
40
|
+
|
41
|
+
- name: upload to github release
|
42
|
+
uses: actions/upload-release-asset@v1
|
43
|
+
env:
|
44
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
45
|
+
with:
|
46
|
+
upload_url: ${{ steps.release.outputs.upload_url }}
|
47
|
+
asset_path: ./${{ steps.gem.outputs.path }}
|
48
|
+
asset_name: ${{ steps.gem.outputs.path }}
|
49
|
+
asset_content_type: application/zip
|
50
|
+
|
51
|
+
- name: upload to rubygems
|
52
|
+
env:
|
53
|
+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
|
54
|
+
run: |
|
55
|
+
mkdir -p $HOME/.gem
|
56
|
+
touch $HOME/.gem/credentials
|
57
|
+
chmod 0600 $HOME/.gem/credentials
|
58
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
59
|
+
rake upload
|
data/.github/workflows/test.yml
CHANGED
data/.github/workflows/utils.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
RENAMES = {reflex: 'reflexion'}
|
2
|
+
|
1
3
|
def sh(cmd)
|
2
4
|
puts cmd
|
3
5
|
system cmd
|
@@ -5,8 +7,10 @@ end
|
|
5
7
|
|
6
8
|
def setup_dependencies(build: true, only: nil)
|
7
9
|
gemspec_path = `git ls-files`.lines(chomp: true).find {|l| l =~ /\.gemspec$/}
|
8
|
-
|
9
|
-
|
10
|
+
return unless gemspec_path
|
11
|
+
|
12
|
+
gemspec = File.read gemspec_path
|
13
|
+
name = File.basename gemspec_path, '.gemspec'
|
10
14
|
|
11
15
|
exts = File.readlines('Rakefile')
|
12
16
|
.map {|l| l[%r|^\s*require\W+(\w+)/extension\W+$|, 1]}
|
@@ -15,9 +19,13 @@ def setup_dependencies(build: true, only: nil)
|
|
15
19
|
exts = exts & [only].flatten.map(&:to_s) if only
|
16
20
|
|
17
21
|
exts.each do |ext|
|
18
|
-
|
19
|
-
|
20
|
-
|
22
|
+
gem = RENAMES[ext.to_sym].then {|s| s || ext}
|
23
|
+
clone = "git clone --depth 1 https://github.com/xord/#{ext}.git ../#{ext}"
|
24
|
+
ver = gemspec[/add_runtime_dependency.*['"]#{gem}['"].*['"]\s*~>\s*([\d\.]+)\s*['"]/, 1]
|
25
|
+
|
26
|
+
# 'rake subtree:push' pushes all subrepos, so cloning by new tag
|
27
|
+
# often fails before tagging each new tag
|
28
|
+
sh %( #{clone} --branch v#{ver} || #{clone} )
|
21
29
|
sh %( cd ../#{ext} && rake ext )
|
22
30
|
end
|
23
31
|
end
|
data/ChangeLog.md
CHANGED
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.32
|
data/lib/xot/rake/util.rb
CHANGED
@@ -84,13 +84,25 @@ module Xot
|
|
84
84
|
paths
|
85
85
|
end
|
86
86
|
|
87
|
+
def rake_puts(*args)
|
88
|
+
$stderr.puts(*args)
|
89
|
+
end
|
90
|
+
|
91
|
+
def verbose_puts(*args)
|
92
|
+
rake_puts(*args) if ::Rake.verbose
|
93
|
+
end
|
94
|
+
|
95
|
+
def noverbose_puts(*args)
|
96
|
+
rake_puts(*args) unless ::Rake.verbose
|
97
|
+
end
|
98
|
+
|
87
99
|
def filter_file(path, &block)
|
88
100
|
File.write path, block.call(File.read path)
|
89
101
|
end
|
90
102
|
|
91
103
|
def cd_sh(dir, cmd)
|
92
104
|
Dir.chdir dir do
|
93
|
-
|
105
|
+
rake_puts "(in #{Dir.pwd})"
|
94
106
|
sh cmd
|
95
107
|
end
|
96
108
|
end
|
@@ -242,14 +254,23 @@ module Xot
|
|
242
254
|
s
|
243
255
|
end
|
244
256
|
|
245
|
-
def
|
246
|
-
|
257
|
+
def verbose?(state = nil)
|
258
|
+
if state != nil
|
259
|
+
::Rake.verbose state
|
260
|
+
ENV['VERBOSE'] = (!!state).to_s
|
261
|
+
end
|
262
|
+
::Rake.verbose
|
247
263
|
end
|
248
264
|
|
249
|
-
def debug?()
|
265
|
+
def debug?(state = nil)
|
266
|
+
ENV['DEBUG'] = (!!state).to_s if state != nil
|
250
267
|
env :DEBUG, false
|
251
268
|
end
|
252
269
|
|
270
|
+
def actions?()
|
271
|
+
env :GITHUB_ACTIONS, false
|
272
|
+
end
|
273
|
+
|
253
274
|
def win32?()
|
254
275
|
RUBY_PLATFORM =~ /mswin|ming|cygwin/
|
255
276
|
end
|
data/lib/xot/rake.rb
CHANGED
@@ -55,6 +55,24 @@ module Xot
|
|
55
55
|
env :TESTS_EXCLUDE, []
|
56
56
|
end
|
57
57
|
|
58
|
+
def default_tasks(default = nil)
|
59
|
+
verbose? env(:VERBOSE, false)
|
60
|
+
|
61
|
+
if default
|
62
|
+
task :default => default
|
63
|
+
else
|
64
|
+
task :default
|
65
|
+
end
|
66
|
+
|
67
|
+
task :verbose do
|
68
|
+
verbose? true
|
69
|
+
end
|
70
|
+
|
71
|
+
task :debug do
|
72
|
+
debug? true
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
58
76
|
def build_native_library()
|
59
77
|
outname = "lib#{target_name}.a"
|
60
78
|
out = File.join lib_dir, outname
|
@@ -77,6 +95,7 @@ module Xot
|
|
77
95
|
file out => srcs.values do
|
78
96
|
next if srcs.values.empty?
|
79
97
|
objs = srcs.values + vendor_srcs_map.values
|
98
|
+
noverbose_puts "linking #{out}"
|
80
99
|
sh %( rm -f #{out} )
|
81
100
|
sh %( #{ar} #{arflags} #{out} #{objs.join " "} )
|
82
101
|
end
|
@@ -95,6 +114,7 @@ module Xot
|
|
95
114
|
srcs.each do |src, obj|
|
96
115
|
desc "compile #{src}"
|
97
116
|
file obj => [:vendor, depend, src] + erbs.values do
|
117
|
+
noverbose_puts "compiling #{src}"
|
98
118
|
sh %( #{cxx} -c #{cppflags} #{cxxflags} -o #{obj} #{src} )
|
99
119
|
end
|
100
120
|
end
|
@@ -102,9 +122,8 @@ module Xot
|
|
102
122
|
erbs.each do |erb, to|
|
103
123
|
desc "compile #{erb}"
|
104
124
|
file to => erb do
|
105
|
-
|
125
|
+
rake_puts "compiling #{erb} to #{to}"
|
106
126
|
compile_erb erb, to
|
107
|
-
puts "ok"
|
108
127
|
end
|
109
128
|
end
|
110
129
|
|
@@ -177,7 +196,7 @@ module Xot
|
|
177
196
|
::Rake::TestTask.new :full do |t|
|
178
197
|
t.libs << lib_dir
|
179
198
|
t.test_files = FileList["#{test_dir}/**/test_*.rb"] - test_alones - test_excludes
|
180
|
-
t.verbose =
|
199
|
+
t.verbose = ::Rake.verbose
|
181
200
|
end
|
182
201
|
|
183
202
|
task :alones do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xordog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -46,7 +46,7 @@ extensions:
|
|
46
46
|
- Rakefile
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
-
- ".github/workflows/release.yml"
|
49
|
+
- ".github/workflows/release-gem.yml"
|
50
50
|
- ".github/workflows/tag.yml"
|
51
51
|
- ".github/workflows/test.yml"
|
52
52
|
- ".github/workflows/utils.rb"
|
@@ -1,34 +0,0 @@
|
|
1
|
-
name: Release
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags: ['v[0-9]*']
|
6
|
-
|
7
|
-
jobs:
|
8
|
-
release:
|
9
|
-
runs-on: macos-latest
|
10
|
-
|
11
|
-
steps:
|
12
|
-
- name: ruby 3.2
|
13
|
-
uses: ruby/setup-ruby@v1
|
14
|
-
with:
|
15
|
-
ruby-version: 3.2
|
16
|
-
|
17
|
-
- name: checkout
|
18
|
-
uses: actions/checkout@v2
|
19
|
-
|
20
|
-
- name: setup dependencies
|
21
|
-
run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
|
22
|
-
|
23
|
-
- name: test
|
24
|
-
run: rake test
|
25
|
-
|
26
|
-
- name: upload to rubygems
|
27
|
-
env:
|
28
|
-
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
|
29
|
-
run: |
|
30
|
-
mkdir -p $HOME/.gem
|
31
|
-
touch $HOME/.gem/credentials
|
32
|
-
chmod 0600 $HOME/.gem/credentials
|
33
|
-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
34
|
-
rake upload
|