excavate 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test-and-release.yml +92 -0
- data/.rubocop.yml +13 -0
- data/Gemfile +0 -7
- data/Rakefile +7 -1
- data/excavate.gemspec +12 -3
- data/lib/excavate/archive.rb +17 -9
- data/lib/excavate/extractors/cab_extractor.rb +1 -1
- data/lib/excavate/extractors/cpio_extractor.rb +22 -14
- data/lib/excavate/extractors/rpm_extractor.rb +5 -3
- data/lib/excavate/extractors/seven_zip_extractor.rb +14 -3
- data/lib/excavate/version.rb +1 -1
- metadata +61 -14
- data/.github/workflows/metanorma.yml +0 -35
- data/.github/workflows/release.yml +0 -36
- data/.github/workflows/rspec.yml +0 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa5e513f27e2996c18e3b006569540ec1c06c8b178460e2241a891e42fddcfda
|
4
|
+
data.tar.gz: 3a0c7b6f1829f2a1d2ff4645d8b40d677a54b693351a883b53b2feb47d29b9b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7176e3bb221ef27aa16bb666f278d2081030c28778380fa40b5cdd44737fef9b5a76e9f7b7475dfaceaf33583b7caea80590f39e3a2a5f614f9a957baf082af8
|
7
|
+
data.tar.gz: '0359c8ea5ac50e2ad79c8c453b81a5dea7c2a11c1c1e9accf0844aa5f6ea110a3cfe692819c8c786c45a1191cce2d26259135832238fb268a31e913696cac951'
|
@@ -0,0 +1,92 @@
|
|
1
|
+
name: test-and-release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
tags: [ 'v*' ]
|
7
|
+
pull_request:
|
8
|
+
|
9
|
+
concurrency:
|
10
|
+
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
|
11
|
+
cancel-in-progress: true
|
12
|
+
|
13
|
+
env:
|
14
|
+
BUNDLER_VER: 2.3.24
|
15
|
+
# Forcing bundler version to ensure that it is consistent everywhere and
|
16
|
+
# does not cause bundler gem reinstalls
|
17
|
+
# bundler/rubygems 2.3.22 is a minimal requirement to support gnu/musl differentiation
|
18
|
+
# https://github.com/rubygems/rubygems/pull/4488
|
19
|
+
|
20
|
+
jobs:
|
21
|
+
test:
|
22
|
+
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
|
23
|
+
runs-on: ${{ matrix.os }}
|
24
|
+
continue-on-error: false
|
25
|
+
strategy:
|
26
|
+
fail-fast: false
|
27
|
+
matrix:
|
28
|
+
ruby: [ '2.7', '3.0', '3.1' ]
|
29
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
30
|
+
|
31
|
+
steps:
|
32
|
+
- uses: actions/checkout@v3
|
33
|
+
|
34
|
+
- uses: ruby/setup-ruby@v1
|
35
|
+
with:
|
36
|
+
ruby-version: ${{ matrix.ruby }}
|
37
|
+
bundler: ${{ env.BUNDLER_VER }}
|
38
|
+
bundler-cache: true
|
39
|
+
|
40
|
+
- run: bundle exec rspec
|
41
|
+
|
42
|
+
metanorma:
|
43
|
+
name: Test with Metanorma on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
|
44
|
+
runs-on: ${{ matrix.os }}
|
45
|
+
continue-on-error: false
|
46
|
+
strategy:
|
47
|
+
fail-fast: false
|
48
|
+
matrix:
|
49
|
+
ruby: [ '2.7', '3.0', '3.1' ]
|
50
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
51
|
+
steps:
|
52
|
+
- uses: actions/checkout@v3
|
53
|
+
with:
|
54
|
+
repository: metanorma/metanorma
|
55
|
+
|
56
|
+
- uses: metanorma/metanorma-build-scripts/inkscape-setup-action@main
|
57
|
+
|
58
|
+
- uses: actions/checkout@v3
|
59
|
+
with:
|
60
|
+
path: "excavate"
|
61
|
+
|
62
|
+
- run: 'echo ''gem "excavate", path: "./excavate"'' > Gemfile.devel'
|
63
|
+
|
64
|
+
# https://github.com/rubygems/rubygems/issues/5160
|
65
|
+
- if: matrix.ruby == '3.0'
|
66
|
+
uses: ruby/setup-ruby@v1
|
67
|
+
with:
|
68
|
+
ruby-version: ${{ matrix.ruby }}
|
69
|
+
bundler-cache: true
|
70
|
+
bundler: ${{ env.BUNDLER_VER }}
|
71
|
+
rubygems: latest
|
72
|
+
|
73
|
+
- if: matrix.ruby != '3.0'
|
74
|
+
uses: ruby/setup-ruby@v1
|
75
|
+
with:
|
76
|
+
ruby-version: ${{ matrix.ruby }}
|
77
|
+
bundler: ${{ env.BUNDLER_VER }}
|
78
|
+
bundler-cache: true
|
79
|
+
|
80
|
+
- run: bundle exec rake
|
81
|
+
|
82
|
+
release:
|
83
|
+
name: Release gem
|
84
|
+
needs: [ test, metanorma ]
|
85
|
+
runs-on: ubuntu-latest
|
86
|
+
if: contains(github.ref, 'refs/tags/v')
|
87
|
+
steps:
|
88
|
+
- uses: actions/checkout@v3
|
89
|
+
|
90
|
+
- uses: cadwallion/publish-rubygems-action@master
|
91
|
+
env:
|
92
|
+
RUBYGEMS_API_KEY: ${{secrets.FONTIST_CI_RUBYGEMS_API_KEY}}
|
data/.rubocop.yml
CHANGED
@@ -1,2 +1,15 @@
|
|
1
1
|
inherit_from:
|
2
2
|
- 'https://raw.githubusercontent.com/fontist/oss-guides/master/ci/rubocop.yml'
|
3
|
+
|
4
|
+
|
5
|
+
AllCops:
|
6
|
+
TargetRubyVersion: 2.7
|
7
|
+
SuggestExtensions: false
|
8
|
+
Exclude:
|
9
|
+
- 'pkg/**/*'
|
10
|
+
|
11
|
+
Gemspec/RequireMFA:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
Layout/LineLength:
|
15
|
+
Max: 160
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/excavate.gemspec
CHANGED
@@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = "Extract nested archives with a single command."
|
13
13
|
spec.homepage = "https://github.com/fontist/excavate"
|
14
14
|
spec.license = "BSD-3-Clause"
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
15
16
|
|
16
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
17
18
|
spec.metadata["source_code_uri"] = "https://github.com/fontist/excavate"
|
@@ -20,17 +21,25 @@ Gem::Specification.new do |spec|
|
|
20
21
|
# Specify which files should be added to the gem when it is released.
|
21
22
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
23
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
23
|
-
`git ls-files -z`.split("\x0").reject
|
24
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
25
|
+
f.match(%r{\A(?:test|spec|features|bin)/})
|
26
|
+
end
|
24
27
|
end
|
25
28
|
spec.bindir = "exe"
|
26
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
27
30
|
spec.require_paths = ["lib"]
|
28
31
|
|
29
32
|
spec.add_runtime_dependency "arr-pm", "~> 0.0"
|
30
|
-
spec.add_runtime_dependency "
|
33
|
+
spec.add_runtime_dependency "bundler", "~> 2.3", ">= 2.3.24"
|
34
|
+
spec.add_runtime_dependency "ffi-libarchive-binary", "~> 0.3"
|
31
35
|
spec.add_runtime_dependency "libmspack", "~> 0.1"
|
32
36
|
spec.add_runtime_dependency "ruby-ole", "~> 1.0"
|
33
37
|
spec.add_runtime_dependency "rubyzip", "~> 2.3"
|
34
|
-
spec.add_runtime_dependency "seven_zip_ruby", "~> 1.0"
|
35
38
|
spec.add_runtime_dependency "thor", "~> 1.0"
|
39
|
+
|
40
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
41
|
+
spec.add_development_dependency "rubocop", "~> 1.7"
|
42
|
+
spec.add_development_dependency "rubocop-performance", "~> 1.15"
|
43
|
+
|
44
|
+
spec.metadata["rubygems_mfa_required"] = "false"
|
36
45
|
end
|
data/lib/excavate/archive.rb
CHANGED
@@ -17,14 +17,12 @@ module Excavate
|
|
17
17
|
@archive = archive
|
18
18
|
end
|
19
19
|
|
20
|
-
def files(recursive_packages: false, files: [], filter: nil)
|
20
|
+
def files(recursive_packages: false, files: [], filter: nil, &block)
|
21
21
|
target = Dir.mktmpdir
|
22
22
|
extract(target, recursive_packages: recursive_packages,
|
23
23
|
files: files, filter: filter)
|
24
24
|
|
25
|
-
all_files_in(target).map
|
26
|
-
yield file
|
27
|
-
end
|
25
|
+
all_files_in(target).map(&block)
|
28
26
|
ensure
|
29
27
|
FileUtils.rm_rf(target)
|
30
28
|
end
|
@@ -155,11 +153,7 @@ module Excavate
|
|
155
153
|
end
|
156
154
|
|
157
155
|
def extract_recursively(archive, target)
|
158
|
-
|
159
|
-
duplicate_dir(archive, target)
|
160
|
-
else
|
161
|
-
extract_once(archive, target)
|
162
|
-
end
|
156
|
+
extract_to_directory(archive, target)
|
163
157
|
|
164
158
|
all_files_in(target).each do |file|
|
165
159
|
next unless archive?(file)
|
@@ -168,6 +162,16 @@ module Excavate
|
|
168
162
|
end
|
169
163
|
end
|
170
164
|
|
165
|
+
def extract_to_directory(archive, target)
|
166
|
+
if File.directory?(archive)
|
167
|
+
duplicate_dir(archive, target)
|
168
|
+
elsif !archive?(archive)
|
169
|
+
copy_file(archive, target)
|
170
|
+
else
|
171
|
+
extract_once(archive, target)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
171
175
|
def duplicate_dir(source, target)
|
172
176
|
Dir.chdir(source) do
|
173
177
|
(Dir.entries(".") - [".", ".."]).each do |entry|
|
@@ -176,6 +180,10 @@ module Excavate
|
|
176
180
|
end
|
177
181
|
end
|
178
182
|
|
183
|
+
def copy_file(archive, target)
|
184
|
+
FileUtils.cp(archive, target)
|
185
|
+
end
|
186
|
+
|
179
187
|
def extract_once(archive, target)
|
180
188
|
extension = normalized_extension(archive)
|
181
189
|
extractor_class = TYPES[extension]
|
@@ -14,30 +14,38 @@ module Excavate
|
|
14
14
|
|
15
15
|
private
|
16
16
|
|
17
|
+
def extract_cpio_inner_new(entry, file, target)
|
18
|
+
path = File.join(target, entry.name)
|
19
|
+
if entry.directory?
|
20
|
+
FileUtils.mkdir_p(path)
|
21
|
+
else
|
22
|
+
FileUtils.mkdir_p(File.dirname(path))
|
23
|
+
File.write(path, file.read, mode: "wb")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
17
27
|
def extract_cpio_new_format(target)
|
18
28
|
File.open(@archive, "rb") do |archive_file|
|
19
29
|
CPIO::ASCIIReader.new(archive_file).each do |entry, file|
|
20
|
-
|
21
|
-
if entry.directory?
|
22
|
-
FileUtils.mkdir_p(path)
|
23
|
-
else
|
24
|
-
FileUtils.mkdir_p(File.dirname(path))
|
25
|
-
File.write(path, file.read, mode: "wb")
|
26
|
-
end
|
30
|
+
extract_cpio_inner_new(entry, file, target)
|
27
31
|
end
|
28
32
|
end
|
29
33
|
end
|
30
34
|
|
35
|
+
def extract_cpio_inner_old(entry, target)
|
36
|
+
path = File.expand_path(entry.filename, target)
|
37
|
+
if entry.directory?
|
38
|
+
FileUtils.mkdir_p(path)
|
39
|
+
else
|
40
|
+
FileUtils.mkdir_p(File.dirname(path))
|
41
|
+
File.write(path, entry.data, mode: "wb")
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
31
45
|
def extract_cpio_old_format(target)
|
32
46
|
File.open(@archive, "rb") do |archive_file|
|
33
47
|
CPIO::ArchiveReader.new(archive_file).each_entry do |entry|
|
34
|
-
|
35
|
-
if entry.directory?
|
36
|
-
FileUtils.mkdir_p(path)
|
37
|
-
else
|
38
|
-
FileUtils.mkdir_p(File.dirname(path))
|
39
|
-
File.write(path, entry.data, mode: "wb")
|
40
|
-
end
|
48
|
+
extract_cpio_inner_old(entry, target)
|
41
49
|
end
|
42
50
|
end
|
43
51
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
require "arr-pm"
|
2
2
|
|
3
|
+
H_MAGIC = "\x8e\xad\xe8\x01\x00\x00\x00\x00".force_encoding("BINARY")
|
4
|
+
|
3
5
|
# fix for Ruby 3.0
|
4
|
-
unless RPM::File::Header::HEADER_MAGIC ==
|
6
|
+
unless RPM::File::Header::HEADER_MAGIC == H_MAGIC
|
5
7
|
RPM::File::Header.send(:remove_const, "HEADER_MAGIC")
|
6
|
-
RPM::File::Header.const_set(
|
8
|
+
RPM::File::Header.const_set(:HEADER_MAGIC, H_MAGIC)
|
7
9
|
end
|
8
10
|
|
9
11
|
module Excavate
|
@@ -25,7 +27,7 @@ module Excavate
|
|
25
27
|
archive_format = tags[:payloadformat]
|
26
28
|
compression_format = tags[:payloadcompressor] == "gzip" ? "gz" : tags[:payloadcompressor]
|
27
29
|
basename = File.basename(archive, ".*")
|
28
|
-
filename = basename
|
30
|
+
filename = "#{basename}.#{archive_format}.#{compression_format}"
|
29
31
|
File.join(dir, filename)
|
30
32
|
end
|
31
33
|
end
|
@@ -1,13 +1,24 @@
|
|
1
|
-
require "
|
1
|
+
require "ffi-libarchive-binary"
|
2
2
|
|
3
3
|
module Excavate
|
4
4
|
module Extractors
|
5
5
|
class SevenZipExtractor < Extractor
|
6
6
|
def extract(target)
|
7
|
-
|
8
|
-
|
7
|
+
Dir.chdir(target) do
|
8
|
+
extract_with_libarchive
|
9
9
|
end
|
10
10
|
end
|
11
|
+
|
12
|
+
def extract_with_libarchive
|
13
|
+
flags = ::Archive::EXTRACT_PERM
|
14
|
+
reader = ::Archive::Reader.open_filename(@archive)
|
15
|
+
|
16
|
+
reader.each_entry do |entry|
|
17
|
+
reader.extract(entry, flags.to_i)
|
18
|
+
end
|
19
|
+
|
20
|
+
reader.close
|
21
|
+
end
|
11
22
|
end
|
12
23
|
end
|
13
24
|
end
|
data/lib/excavate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excavate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: arr-pm
|
@@ -24,20 +24,40 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.3'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 2.3.24
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.3'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 2.3.24
|
27
47
|
- !ruby/object:Gem::Dependency
|
28
48
|
name: ffi-libarchive-binary
|
29
49
|
requirement: !ruby/object:Gem::Requirement
|
30
50
|
requirements:
|
31
51
|
- - "~>"
|
32
52
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
53
|
+
version: '0.3'
|
34
54
|
type: :runtime
|
35
55
|
prerelease: false
|
36
56
|
version_requirements: !ruby/object:Gem::Requirement
|
37
57
|
requirements:
|
38
58
|
- - "~>"
|
39
59
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0.
|
60
|
+
version: '0.3'
|
41
61
|
- !ruby/object:Gem::Dependency
|
42
62
|
name: libmspack
|
43
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,7 +101,7 @@ dependencies:
|
|
81
101
|
- !ruby/object:Gem::Version
|
82
102
|
version: '2.3'
|
83
103
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
104
|
+
name: thor
|
85
105
|
requirement: !ruby/object:Gem::Requirement
|
86
106
|
requirements:
|
87
107
|
- - "~>"
|
@@ -95,19 +115,47 @@ dependencies:
|
|
95
115
|
- !ruby/object:Gem::Version
|
96
116
|
version: '1.0'
|
97
117
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
118
|
+
name: rspec
|
99
119
|
requirement: !ruby/object:Gem::Requirement
|
100
120
|
requirements:
|
101
121
|
- - "~>"
|
102
122
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
104
|
-
type: :
|
123
|
+
version: '3.0'
|
124
|
+
type: :development
|
105
125
|
prerelease: false
|
106
126
|
version_requirements: !ruby/object:Gem::Requirement
|
107
127
|
requirements:
|
108
128
|
- - "~>"
|
109
129
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
130
|
+
version: '3.0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: rubocop
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '1.7'
|
138
|
+
type: :development
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '1.7'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: rubocop-performance
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '1.15'
|
152
|
+
type: :development
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '1.15'
|
111
159
|
description: Extract nested archives with a single command.
|
112
160
|
email:
|
113
161
|
- open.source@ribose.com
|
@@ -116,9 +164,7 @@ executables:
|
|
116
164
|
extensions: []
|
117
165
|
extra_rdoc_files: []
|
118
166
|
files:
|
119
|
-
- ".github/workflows/
|
120
|
-
- ".github/workflows/release.yml"
|
121
|
-
- ".github/workflows/rspec.yml"
|
167
|
+
- ".github/workflows/test-and-release.yml"
|
122
168
|
- ".gitignore"
|
123
169
|
- ".rspec"
|
124
170
|
- ".rubocop.yml"
|
@@ -154,6 +200,7 @@ metadata:
|
|
154
200
|
homepage_uri: https://github.com/fontist/excavate
|
155
201
|
source_code_uri: https://github.com/fontist/excavate
|
156
202
|
changelog_uri: https://github.com/fontist/excavate
|
203
|
+
rubygems_mfa_required: 'false'
|
157
204
|
post_install_message:
|
158
205
|
rdoc_options: []
|
159
206
|
require_paths:
|
@@ -162,14 +209,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
162
209
|
requirements:
|
163
210
|
- - ">="
|
164
211
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
212
|
+
version: 2.7.0
|
166
213
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
214
|
requirements:
|
168
215
|
- - ">="
|
169
216
|
- !ruby/object:Gem::Version
|
170
217
|
version: '0'
|
171
218
|
requirements: []
|
172
|
-
rubygems_version: 3.
|
219
|
+
rubygems_version: 3.3.7
|
173
220
|
signing_key:
|
174
221
|
specification_version: 4
|
175
222
|
summary: Extract nested archives with a single command.
|
@@ -1,35 +0,0 @@
|
|
1
|
-
name: metanorma
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: [ master ]
|
6
|
-
pull_request:
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
test:
|
10
|
-
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
|
11
|
-
runs-on: ${{ matrix.os }}
|
12
|
-
continue-on-error: ${{ matrix.experimental }}
|
13
|
-
strategy:
|
14
|
-
fail-fast: false
|
15
|
-
matrix:
|
16
|
-
ruby: [ '2.5', '2.6', '2.7', '3.0' ]
|
17
|
-
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
18
|
-
experimental: [ true ]
|
19
|
-
steps:
|
20
|
-
- uses: actions/checkout@master
|
21
|
-
with:
|
22
|
-
repository: metanorma/metanorma
|
23
|
-
|
24
|
-
- uses: actions/checkout@master
|
25
|
-
with:
|
26
|
-
path: "excavate"
|
27
|
-
|
28
|
-
- run: 'echo ''gem "excavate", path: "./excavate"'' > Gemfile.devel'
|
29
|
-
|
30
|
-
- uses: ruby/setup-ruby@v1
|
31
|
-
with:
|
32
|
-
ruby-version: ${{ matrix.ruby }}
|
33
|
-
bundler-cache: true
|
34
|
-
|
35
|
-
- run: bundle exec rake
|
@@ -1,36 +0,0 @@
|
|
1
|
-
name: release
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
tags:
|
6
|
-
- 'v*'
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
release:
|
10
|
-
runs-on: ubuntu-18.04
|
11
|
-
steps:
|
12
|
-
- uses: actions/checkout@v1
|
13
|
-
|
14
|
-
- uses: ruby/setup-ruby@v1
|
15
|
-
with:
|
16
|
-
ruby-version: '2.6'
|
17
|
-
|
18
|
-
- run: bundle config set path 'vendor/bundle'
|
19
|
-
|
20
|
-
- run: bundle install --jobs 4 --retry 3
|
21
|
-
|
22
|
-
- run: bundle exec rspec
|
23
|
-
|
24
|
-
- name: Publish to rubygems.org
|
25
|
-
env:
|
26
|
-
RUBYGEMS_API_KEY: ${{secrets.FONTIST_CI_RUBYGEMS_API_KEY}}
|
27
|
-
run: |
|
28
|
-
gem install gem-release
|
29
|
-
touch ~/.gem/credentials
|
30
|
-
cat > ~/.gem/credentials << EOF
|
31
|
-
---
|
32
|
-
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
33
|
-
EOF
|
34
|
-
chmod 0600 ~/.gem/credentials
|
35
|
-
git status
|
36
|
-
gem release
|
data/.github/workflows/rspec.yml
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
name: rspec
|
2
|
-
|
3
|
-
on:
|
4
|
-
push:
|
5
|
-
branches: [ master, main ]
|
6
|
-
pull_request:
|
7
|
-
|
8
|
-
jobs:
|
9
|
-
build:
|
10
|
-
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
|
11
|
-
runs-on: ${{ matrix.os }}
|
12
|
-
continue-on-error: ${{ matrix.experimental }}
|
13
|
-
strategy:
|
14
|
-
fail-fast: false
|
15
|
-
matrix:
|
16
|
-
ruby: [ '2.4', '2.5', '2.6', '2.7' ]
|
17
|
-
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
18
|
-
experimental: [ false ]
|
19
|
-
include:
|
20
|
-
- ruby: '3.0'
|
21
|
-
os: 'ubuntu-latest'
|
22
|
-
experimental: true
|
23
|
-
- ruby: '3.0'
|
24
|
-
os: 'windows-latest'
|
25
|
-
experimental: true
|
26
|
-
- ruby: '3.0'
|
27
|
-
os: 'macos-latest'
|
28
|
-
experimental: true
|
29
|
-
|
30
|
-
steps:
|
31
|
-
- uses: actions/checkout@master
|
32
|
-
|
33
|
-
- uses: ruby/setup-ruby@v1
|
34
|
-
with:
|
35
|
-
ruby-version: ${{ matrix.ruby }}
|
36
|
-
|
37
|
-
- uses: actions/cache@v1
|
38
|
-
with:
|
39
|
-
path: vendor/bundle
|
40
|
-
key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
|
41
|
-
restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
|
42
|
-
|
43
|
-
- run: bundle config set path 'vendor/bundle'
|
44
|
-
|
45
|
-
- run: bundle install --jobs 4 --retry 3
|
46
|
-
|
47
|
-
- run: bundle exec rspec
|