Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
- package-ecosystem: bundler
directory: "/"
schedule:
interval: weekly
43 changes: 18 additions & 25 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,41 @@ jobs:
BUNDLE_WITHOUT: "secryst:jsexec"
SKIP_JS: "1"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout monorepo
uses: actions/checkout@v7
with:
repository: interscript/interscript

- name: Run bootstrap script
- name: Bootstrap packages
run: ruby bootstrap.rb

- name: Use Ruby
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
ruby-version: "3.3"
bundler-cache: true
working-directory: ruby

- name: Install bundle
working-directory: ./ruby
working-directory: ruby
run: bundle install --jobs 4 --retry 3 --with jsexec --without secryst

- name: Generate visualization json
working-directory: ./ruby
- name: Generate visualization JSON
working-directory: ruby
run: bundle exec rake generate_visualization_json

- name: Archive json files from the previous step
uses: thedoctor0/zip-release@master
- name: Archive visualization JSON
uses: thedoctor0/zip-release@v0.7.6
with:
filename: 'vis_json.zip'
path: ./vis_json/*.json
directory: ./ruby/
exclusions: '*.git*'
type: zip

- name: Upload artifacts
- name: Upload visualization artifact
id: upload_vis_json
uses: svenstaro/upload-release-action@2.2.1
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ruby/vis_json.zip
Expand All @@ -55,11 +56,11 @@ jobs:
overwrite: true

- name: Generate metadata
working-directory: ./ruby
working-directory: ruby
run: bundle exec rake generate_metadata_json

- name: Archive metadata from the previous step
uses: thedoctor0/zip-release@master
- name: Archive metadata
uses: thedoctor0/zip-release@v0.7.6
with:
filename: 'metadata.zip'
path: ./metadata.json
Expand All @@ -69,23 +70,15 @@ jobs:

- name: Upload metadata
id: upload_metadata
uses: svenstaro/upload-release-action@2.2.1
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ruby/metadata.zip
asset_name: metadata.json.zip
tag: ${{ github.ref }}
overwrite: true

- name: Output link
- name: Output links
run: |
echo ${{ steps.upload_vis_json.outputs.browser_download_url }}
echo ${{ steps.upload_metadata.outputs.browser_download_url }}

# - name: Trigger deploy at interscript.org
# uses: peter-evans/repository-dispatch@v1
# with:
# token: ${{ secrets.INTERSCRIPT_CI_TOKEN }}
# repository: interscript/interscript.org
# event-type: ${{ github.repository }}
# client-payload: '{ "ref": "${{ github.ref }}" }'
27 changes: 27 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: codeql

on:
push:
branches: [main]
pull_request:
schedule:
- cron: "0 0 * * 0" # weekly

permissions:
actions: read
contents: read
security-events: write

jobs:
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ruby]
steps:
- uses: actions/checkout@v7
- uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- uses: github/codeql-action/analyze@v3
36 changes: 25 additions & 11 deletions .github/workflows/rake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,50 @@

jobs:
rspec:
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
name: Test on Ruby ${{ matrix.ruby }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
ruby: [ 3.3, 3.2, 3.1, "3.0", 2.7, 2.6 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
ruby: ["3.3", "3.4"]
os: [ubuntu-latest, windows-latest, macos-latest]
env:
BUNDLE_WITHOUT: "secryst"
SKIP_JS: "1"

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout monorepo
uses: actions/checkout@v7
with:
repository: interscript/interscript

- name: Run bootstrap script
- name: Bootstrap packages
run: ruby bootstrap.rb

- name: Use Ruby
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
working-directory: ruby

- name: Run RSpecs
working-directory: ./ruby
- name: Install Python helper and gems
working-directory: ruby
run: |
pip install regex
bundle install --with=jsexec
bundle exec rspec

- name: RSpec
working-directory: ruby
run: bundle exec rspec
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

standard:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +11 to +48
name: StandardRB
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- run: bundle exec standardrb

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +49 to +57
51 changes: 18 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,60 +9,45 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout monorepo
uses: actions/checkout@v7
with:
repository: interscript/interscript

- name: Run bootstrap script
- name: Bootstrap packages
run: ruby bootstrap.rb

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
ruby-version: '3.3'
bundler-cache: true
working-directory: ruby

- uses: actions/setup-node@v1
- uses: actions/setup-node@v7
with:
node-version: 14.x
node-version: '22'
cache: npm
cache-dependency-path: js/package-lock.json

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

- name: Test Ruby package
working-directory: ./ruby
working-directory: ruby
run: bundle exec rake

- name: Test JS package
working-directory: ./js
working-directory: js
run: npm install && npm run prepareMaps && npm test

- name: Publish to rubygems.org
env:
RUBYGEMS_API_KEY: ${{secrets.INTERSCRIPT_RUBYGEMS_API_KEY}}
RUBYGEMS_API_KEY: ${{ secrets.INTERSCRIPT_RUBYGEMS_API_KEY }}
working-directory: ruby
run: |
gem install gem-release
mkdir -p ~/.gem
touch ~/.gem/credentials
cat > ~/.gem/credentials << EOF
---
:rubygems_api_key: ${RUBYGEMS_API_KEY}
EOF
printf -- "---\n:rubygems_api_key: %s\n" "$RUBYGEMS_API_KEY" > ~/.gem/credentials
chmod 0600 ~/.gem/credentials
pushd ruby
git status
gem install gem-release
gem release
popd

# Let's keep it commented out for now. Please uncomment it once you are ready with
# interscript-api to support Interscript v2.
#
#- name: Trigger interscript-api
# uses: peter-evans/repository-dispatch@v1
# with:
# token: ${{ secrets.INTERSCRIPT_CI_PAT_TOKEN }}
# repository: interscript/interscript-api
# event-type: ${{ github.repository }}
# client-payload: '{ "ref": "${{ github.ref }}" }'
11 changes: 11 additions & 0 deletions .standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# StandardRB config — enforce Ruby style on lib/, leave specs/bin/exe flexible for now.
# Existing violations in lib/ were auto-fixed in this PR; remaining violations are
# tracked in TODO.complete/06-standardrb-ruby-gems.md.
ignore:
- "bin/**/*"
- "exe/**/*"
- "spec/**/*"
- "docs/**/*"
- "reference-docs/**/*"
- "pkg/**/*"
- "vendor/**/*"
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [Latest]

See GitHub releases for detailed release notes: https://github.com/interscript/interscript-ruby/releases
42 changes: 42 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Contributing

Thanks for your interest in contributing!

## Development setup

```bash
git clone <this repo>
cd <repo>
bundle install # Ruby projects
# or
npm ci # JS projects
```

## Workflow

1. Fork → branch from `main`
2. Make changes with tests
3. Run `bundle exec rspec` (Ruby) or `npm test` (JS) locally
4. Run `bundle exec standardrb` (Ruby) or `npm run lint` (JS)
5. Open a PR with a clear description

## Code style

- Ruby: enforced by [StandardRB](https://github.com/standardrb/standard)
- JavaScript: enforced by ESLint + Prettier
- Python: enforced by ruff

## Commit messages

Use [Conventional Commits](https://www.conventionalcommits.org/):

```
feat: add new transliteration system
fix: correct off-by-one in CALT lookup
chore: bump dependencies
docs: clarify README
```

## Releases

Maintainers tag releases following semver. CI publishes on tag push.
Loading
Loading