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
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.2', '3.3', '3.4']
manticore-version: ['9.3.2', 'dev']

services:
manticoresearch:
image: manticoresearch/manticore:${{ matrix.manticore-version }}
ports:
- 9308:9308

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rspec
env:
MANTICORESEARCH_URI: http://localhost:9308

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Run RuboCop
run: bundle exec rubocop
57 changes: 57 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Generate Documentation

on:
push:
branches: [ main ]
paths:
- 'lib/**'
- 'docs/**'
- '.github/workflows/docs.yml'

jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true

- name: Install dependencies
run: |
gem install yard
bundle install

- name: Generate YARD documentation
run: |
mkdir -p docs/yard
yard doc --output-dir docs/yard
# Add a .nojekyll file to disable Jekyll processing
touch docs/yard/.nojekyll
# Create a zip archive for easy deployment
cd docs
zip -r ../manticore-client-docs.zip yard

- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: manticore-client-docs
path: manticore-client-docs.zip
retention-days: 30

- name: Commit to docs branch
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git checkout -b docs || git checkout docs
git pull origin docs || echo "No docs branch yet"
cp -r docs/yard/* .
git add .
git commit -m "Update YARD documentation" || echo "No changes to commit"
git push -u origin docs
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release Gem

on:
push:
tags:
- 'v*'

jobs:
build:
name: Build + Publish
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

services:
manticoresearch:
image: manticoresearch/manticore:9.3.2
ports:
- 9308:9308

steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true

- name: Install dependencies
run: bundle install

- name: Run tests
run: bundle exec rspec
env:
MANTICORE_URL: http://localhost:9308

- name: Build gem
run: bundle exec rake build

- name: Publish to GPR
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
env:
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
OWNER: ${{ github.repository_owner }}

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem push pkg/*.gem
env:
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by: https://openapi-generator.tech
#

Gemfile.lock
*.gem
*.rbc
/.config
Expand Down
7 changes: 6 additions & 1 deletion manticore-client.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ Gem::Specification.new do |spec|
spec.add_dependency "marcel"
spec.add_dependency "zeitwerk"

spec.files = `git ls-files`.split("\n")
spec.files = `git ls-files`.split("\n").reject do |f|
f.match(%r{^(spec|docs)/}) ||
f.match(%r{^\.(git|github)/}) ||
f.match(/^\.(gitignore|rubocop.yml|openapi|rspec)/) ||
f.match(/^(Rakefile|Gemfile|Gemfile.lock)\b/)
end

spec.executables = []
spec.require_paths = ["lib"]
Expand Down
Loading