Skip to content

Commit d31e2c6

Browse files
committed
chore: Ruby 3.3+ floor, modern GHA, gemspec hygiene
1 parent 3375d02 commit d31e2c6

7 files changed

Lines changed: 96 additions & 102 deletions

File tree

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
- package-ecosystem: bundler
8+
directory: "/"
9+
schedule:
10+
interval: weekly

.github/workflows/assets.yml

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,41 @@ jobs:
1313
BUNDLE_WITHOUT: "secryst:jsexec"
1414
SKIP_JS: "1"
1515
steps:
16-
- name: Checkout repository
17-
uses: actions/checkout@v2
16+
- name: Checkout monorepo
17+
uses: actions/checkout@v7
1818
with:
1919
repository: interscript/interscript
2020

21-
- name: Run bootstrap script
21+
- name: Bootstrap packages
2222
run: ruby bootstrap.rb
2323

24-
- name: Use Ruby
24+
- name: Set up Ruby
2525
uses: ruby/setup-ruby@v1
2626
with:
27-
ruby-version: "3.0"
27+
ruby-version: "3.3"
2828
bundler-cache: true
29+
working-directory: ruby
2930

3031
- name: Install bundle
31-
working-directory: ./ruby
32+
working-directory: ruby
3233
run: bundle install --jobs 4 --retry 3 --with jsexec --without secryst
3334

34-
- name: Generate visualization json
35-
working-directory: ./ruby
35+
- name: Generate visualization JSON
36+
working-directory: ruby
3637
run: bundle exec rake generate_visualization_json
3738

38-
- name: Archive json files from the previous step
39-
uses: thedoctor0/zip-release@master
39+
- name: Archive visualization JSON
40+
uses: thedoctor0/zip-release@v0.7.6
4041
with:
4142
filename: 'vis_json.zip'
4243
path: ./vis_json/*.json
4344
directory: ./ruby/
4445
exclusions: '*.git*'
4546
type: zip
4647

47-
- name: Upload artifacts
48+
- name: Upload visualization artifact
4849
id: upload_vis_json
49-
uses: svenstaro/upload-release-action@2.2.1
50+
uses: svenstaro/upload-release-action@v2
5051
with:
5152
repo_token: ${{ secrets.GITHUB_TOKEN }}
5253
file: ruby/vis_json.zip
@@ -55,11 +56,11 @@ jobs:
5556
overwrite: true
5657

5758
- name: Generate metadata
58-
working-directory: ./ruby
59+
working-directory: ruby
5960
run: bundle exec rake generate_metadata_json
6061

61-
- name: Archive metadata from the previous step
62-
uses: thedoctor0/zip-release@master
62+
- name: Archive metadata
63+
uses: thedoctor0/zip-release@v0.7.6
6364
with:
6465
filename: 'metadata.zip'
6566
path: ./metadata.json
@@ -69,23 +70,15 @@ jobs:
6970

7071
- name: Upload metadata
7172
id: upload_metadata
72-
uses: svenstaro/upload-release-action@2.2.1
73+
uses: svenstaro/upload-release-action@v2
7374
with:
7475
repo_token: ${{ secrets.GITHUB_TOKEN }}
7576
file: ruby/metadata.zip
7677
asset_name: metadata.json.zip
7778
tag: ${{ github.ref }}
7879
overwrite: true
7980

80-
- name: Output link
81+
- name: Output links
8182
run: |
8283
echo ${{ steps.upload_vis_json.outputs.browser_download_url }}
8384
echo ${{ steps.upload_metadata.outputs.browser_download_url }}
84-
85-
# - name: Trigger deploy at interscript.org
86-
# uses: peter-evans/repository-dispatch@v1
87-
# with:
88-
# token: ${{ secrets.INTERSCRIPT_CI_TOKEN }}
89-
# repository: interscript/interscript.org
90-
# event-type: ${{ github.repository }}
91-
# client-payload: '{ "ref": "${{ github.ref }}" }'

.github/workflows/rake.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,39 @@ on:
88

99
jobs:
1010
rspec:
11-
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
11+
name: Test on Ruby ${{ matrix.ruby }} / ${{ matrix.os }}
1212
runs-on: ${{ matrix.os }}
13-
continue-on-error: true
1413
strategy:
1514
fail-fast: false
1615
matrix:
17-
ruby: [ 3.3, 3.2, 3.1, "3.0", 2.7, 2.6 ]
18-
os: [ ubuntu-latest, windows-latest, macos-latest ]
16+
ruby: ["3.3", "3.4"]
17+
os: [ubuntu-latest, windows-latest, macos-latest]
1918
env:
2019
BUNDLE_WITHOUT: "secryst"
2120
SKIP_JS: "1"
2221

2322
steps:
24-
- name: Checkout repository
25-
uses: actions/checkout@v2
23+
- name: Checkout monorepo
24+
uses: actions/checkout@v7
2625
with:
2726
repository: interscript/interscript
2827

29-
- name: Run bootstrap script
28+
- name: Bootstrap packages
3029
run: ruby bootstrap.rb
3130

32-
- name: Use Ruby
31+
- name: Set up Ruby
3332
uses: ruby/setup-ruby@v1
3433
with:
3534
ruby-version: ${{ matrix.ruby }}
3635
bundler-cache: true
36+
working-directory: ruby
3737

38-
- name: Run RSpecs
39-
working-directory: ./ruby
38+
- name: Install Python helper and gems
39+
working-directory: ruby
4040
run: |
4141
pip install regex
4242
bundle install --with=jsexec
43-
bundle exec rspec
43+
44+
- name: RSpec
45+
working-directory: ruby
46+
run: bundle exec rspec

.github/workflows/release.yml

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,60 +9,45 @@ jobs:
99
release:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout repository
13-
uses: actions/checkout@v2
12+
- name: Checkout monorepo
13+
uses: actions/checkout@v7
1414
with:
1515
repository: interscript/interscript
1616

17-
- name: Run bootstrap script
17+
- name: Bootstrap packages
1818
run: ruby bootstrap.rb
1919

2020
- uses: ruby/setup-ruby@v1
2121
with:
22-
ruby-version: '3.0'
22+
ruby-version: '3.3'
23+
bundler-cache: true
24+
working-directory: ruby
2325

24-
- uses: actions/setup-node@v1
26+
- uses: actions/setup-node@v7
2527
with:
26-
node-version: 14.x
28+
node-version: '22'
29+
cache: npm
30+
cache-dependency-path: js/package-lock.json
2731

28-
# For now let's install without secryst, as we don't necessarily need it.
29-
# We may need to change it once we start to depend on secryst maps.
30-
- name: Install bundle
31-
working-directory: ./ruby
32+
- name: Install gems
33+
working-directory: ruby
3234
run: bundle install --jobs 4 --retry 3 --with jsexec --without secryst
3335

3436
- name: Test Ruby package
35-
working-directory: ./ruby
37+
working-directory: ruby
3638
run: bundle exec rake
3739

3840
- name: Test JS package
39-
working-directory: ./js
41+
working-directory: js
4042
run: npm install && npm run prepareMaps && npm test
4143

4244
- name: Publish to rubygems.org
4345
env:
44-
RUBYGEMS_API_KEY: ${{secrets.INTERSCRIPT_RUBYGEMS_API_KEY}}
46+
RUBYGEMS_API_KEY: ${{ secrets.INTERSCRIPT_RUBYGEMS_API_KEY }}
47+
working-directory: ruby
4548
run: |
46-
gem install gem-release
4749
mkdir -p ~/.gem
48-
touch ~/.gem/credentials
49-
cat > ~/.gem/credentials << EOF
50-
---
51-
:rubygems_api_key: ${RUBYGEMS_API_KEY}
52-
EOF
50+
printf -- "---\n:rubygems_api_key: %s\n" "$RUBYGEMS_API_KEY" > ~/.gem/credentials
5351
chmod 0600 ~/.gem/credentials
54-
pushd ruby
55-
git status
52+
gem install gem-release
5653
gem release
57-
popd
58-
59-
# Let's keep it commented out for now. Please uncomment it once you are ready with
60-
# interscript-api to support Interscript v2.
61-
#
62-
#- name: Trigger interscript-api
63-
# uses: peter-evans/repository-dispatch@v1
64-
# with:
65-
# token: ${{ secrets.INTERSCRIPT_CI_PAT_TOKEN }}
66-
# repository: interscript/interscript-api
67-
# event-type: ${{ github.repository }}
68-
# client-payload: '{ "ref": "${{ github.ref }}" }'

Gemfile

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,40 @@
11
source "https://rubygems.org"
22

3-
# Specify your gem's dependencies in interscript.gemspec
43
gemspec
54

6-
gem "rake", "~> 12.0"
7-
gem "rspec", "~> 3.0"
5+
gem "rake", "~> 13.0"
6+
gem "rspec", "~> 3.13"
87

98
gem "interscript-maps", path: "../maps"
109

11-
unless Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7")
12-
group :secryst do
13-
if File.exist? "../../secryst"
14-
gem "secryst", path: "../../secryst"
15-
else
16-
gem "secryst"
17-
end
10+
group :secryst do
11+
if File.exist?("../../secryst")
12+
gem "secryst", path: "../../secryst"
13+
else
14+
gem "secryst"
1815
end
1916
end
2017

21-
gem 'regexp_parser'
18+
gem "regexp_parser"
2219

2320
unless ENV["SKIP_JS"]
2421
group :jsexec do
25-
gem 'mini_racer'
22+
gem "mini_racer"
2623
end
2724
end
2825

2926
unless ENV["SKIP_PYTHON"]
3027
group :pyexec do
31-
gem 'pycall'
28+
gem "pycall"
3229
end
3330
end
3431

3532
group :rababa do
36-
gem 'rababa', "~> 0.1.1"
33+
gem "rababa", "~> 0.1.1"
3734
end
3835

39-
gem 'pry'
36+
gem "pry"
37+
gem "iso-639-data"
38+
gem "iso-15924"
4039

41-
gem 'iso-639-data'
42-
gem 'iso-15924'
43-
44-
gem 'simplecov', require: false, group: :test
40+
gem "simplecov", require: false, group: :test

exe/interscript

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env ruby
12
require 'interscript/command'
23

34
if ARGV.any? && !Interscript::Command.all_tasks.key?(ARGV.first)

interscript.gemspec

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
1-
require_relative 'lib/interscript/version'
1+
require_relative "lib/interscript/version"
22

33
Gem::Specification.new do |spec|
44
spec.name = "interscript"
55
spec.version = Interscript::VERSION
6-
spec.summary = %q{Interoperable script conversion systems}
7-
spec.description = %q{Interoperable script conversion systems}
6+
spec.summary = "Interoperable script conversion systems"
7+
spec.description = "Interoperable script conversion systems."
88
spec.authors = ["Ribose Inc."]
99
spec.email = ["open.source@ribose.com"]
1010

11-
spec.date = %q{2019-11-17}
1211
spec.homepage = "https://www.interscript.com"
1312
spec.license = "BSD-2-Clause"
13+
spec.required_ruby_version = ">= 3.3.0"
1414

15-
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
15+
spec.metadata["homepage_uri"] = spec.homepage
16+
spec.metadata["source_code_uri"] = "https://github.com/interscript/interscript-ruby"
17+
spec.metadata["changelog_uri"] = "https://github.com/interscript/interscript-ruby/releases"
18+
spec.metadata["bug_tracker_uri"] = "https://github.com/interscript/interscript-ruby/issues"
19+
spec.metadata["rubygems_mfa_required"] = "true"
1620

17-
spec.metadata["homepage_uri"] = spec.homepage
18-
spec.metadata["source_code_uri"] = "https://github.com/interscript/interscript"
19-
20-
# Specify which files should be added to the gem when it is released.
21-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
23-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21+
spec.files = Dir.chdir(__dir__) do
22+
Dir[
23+
"lib/**/*",
24+
"exe/**/*",
25+
"docs/**/*",
26+
"README*",
27+
"LICENSE*",
28+
"*.gemspec"
29+
].select { |f| File.file?(f) }
2430
end
2531
spec.bindir = "exe"
26-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
2733
spec.require_paths = ["lib"]
2834

2935
spec.add_dependency "thor"
30-
spec.add_dependency "interscript-maps", "~> #{Interscript::VERSION.split('.')[0,2].join(".")}.0a"
36+
spec.add_dependency "interscript-maps", "~> #{Interscript::VERSION.split('.')[0, 2].join(".")}.0a"
3137
spec.add_dependency "text"
3238
end

0 commit comments

Comments
 (0)