Skip to content

Commit

Permalink
Oh, let's go back to the start...
Browse files Browse the repository at this point in the history
Had to re-create the repo and squash all commits because CI setup was **messy** (junk PRs, commits, etc).
Also it was a nice opportunity to remove some embarassing history, LMAO. It's all good now.
  • Loading branch information
baygeldin committed Mar 7, 2022
0 parents commit 0320b41
Show file tree
Hide file tree
Showing 43 changed files with 2,978 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
ruby: ['2.6', '3.1']

steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install dependencies
run: bundle install
- name: Cache crate
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ hashFiles('**/Cargo.lock') }}-ruby-${{ matrix.ruby }}
- name: Build crate
run: bundle exec rake build
- name: Lint source code with with RuboCop
run: bundle exec rake rubocop
- name: Verify static types with Steep
run: bundle exec rake steep
- name: Transpile source source with RubyNext
run: bundle exec rake nextify
- name: Run specs with RSpec
run: bundle exec rake spec
117 changes: 117 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Release

on:
push:
branches:
- main

jobs:
check:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
release-type: ruby
package-name: tantiny
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
extra-files: |
lib/tantiny/version.rb
Cargo.toml
outputs:
tag_name: ${{ steps.release.outputs.tag_name }}
release_created: ${{ steps.release.outputs.release_created }}

publish:
needs: check

if: ${{ needs.check.outputs.release_created }}

runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
release-type: ruby
package-name: tantiny
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
version-file: "lib/tantiny/version.rb"
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
- name: Install dependencies
run: bundle install
- name: Transpile source source with RubyNext
run: bundle exec rake nextify
- 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 build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_AUTH_TOKEN }}"

compile:
needs: check

if: ${{ needs.check.outputs.release_created }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
ruby: ['2.6', '2.7', '3.0', '3.1']
os: ['ubuntu-latest', 'macos-latest']

permissions:
contents: write

steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install dependencies
run: bundle install
- name: Cache crate
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ hashFiles('**/Cargo.lock') }}-ruby-${{ matrix.ruby }}-os-${{ matrix.os }}
- name: Build crate
run: bundle exec rake build
- name: Create tarball
run: bundle exec rake thermite:tarball
- name: Upload to GitHub Releases
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.check.outputs.tag_name }}
files: tantiny-*.tar.gz
- name: Try installing without Cargo
run: |
gem uninstall tantiny
CARGO=fake gem install t
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
*.gem
*.rbc
/lib/.rbnext/
mkmf.log
.byebug_history
.rspec_status
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/
/lib/tantiny.so

Gemfile.lock
.ruby-version
.ruby-gemset
.tool-versions

# Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

# Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# Cargo
/target
Cargo.lock
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require spec_helper
11 changes: 11 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require: standard

inherit_gem:
standard: config/base.yml

AllCops:
Exclude:
- 'bin/*'
- 'vendor/**/*'
- 'Gemfile'
TargetRubyVersion: 3.1
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## [0.2.0] - 2022-03-07

- Dummy release
20 changes: 20 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "tantiny"
version = "0.2.0" # {x-release-please-version}
edition = "2021"
authors = ["Alexander Baygeldin"]
repository = "https://github.com/baygeldin/tantiny"

[lib]
crate-type = ["cdylib"]

[dependencies]
rutie = "0.8"
tantivy = "0.16"
lazy_static = "1.4"
paste = "1.0"

[package.metadata.thermite]
github_releases = true
github_release_type = "latest"
git_tag_regex = "^v(\\d+\\.\\d+\\.\\d+)$"
13 changes: 13 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec

gem "standard", "~> 1.7"
gem "rake", "~> 13.0"
gem "rspec", "~> 3.0"
gem "rubocop", "~> 1.21"
gem "steep", "~> 0.47"
gem "simplecov", "~> 0.21"
gem "pry"
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Alexander Baygeldin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 0320b41

Please sign in to comment.