Unverified Commit 1c5a6641 by Cuong Tran Committed by GitHub

Use Github acttions to publish to rubygem (#656)

parent 1288a82f
name: CI name: CI
on: [push] on:
pull_request:
branches:
- '*'
push:
branches:
- '*'
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
...@@ -12,17 +20,17 @@ jobs: ...@@ -12,17 +20,17 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: Setup System
run: |
sudo apt-get install libsqlite3-dev
- name: Setup Ruby - name: Setup Ruby
uses: actions/setup-ruby@v1 uses: actions/setup-ruby@v1
with: with:
ruby-version: ${{ matrix.ruby }} ruby-version: ${{ matrix.ruby }}
- name: Bundle - name: Bundle
run: | run: |
gem update --system gem update --system
gem update bundler gem update bundler
bundle install --jobs 4 --retry 3 bundle install --jobs 4 --retry 3
- name: Test - name: Test
run: bundle exec rubocop && bundle exec rspec run: bundle exec rubocop && bundle exec rspec
name: Release
on:
push:
tags:
- 'release/v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x
- name: Bundle
run: |
gem update --system
gem update bundler
bundle install --jobs 4 --retry 3
- name: Publish to GPR
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:github: Bearer ${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: ${{secrets.GPR_AUTH_TOKEN}}
OWNER: ctran
...@@ -163,7 +163,7 @@ you can do so with a simple environment variable, instead of editing the ...@@ -163,7 +163,7 @@ you can do so with a simple environment variable, instead of editing the
== Options == Options
Usage: annotate [options] [model_file]* Usage: annotate [options] [model_file]*
--additional-file-patterns Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%model_name%/*.rb,/baz/%model_name%.rb`) --additional_file_patterns Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%model_name%/*.rb,/baz/%model_name%.rb`)
-d, --delete Remove annotations from all model files or the routes.rb file -d, --delete Remove annotations from all model files or the routes.rb file
-p [before|top|after|bottom], Place the annotations at the top (before) or the bottom (after) of the model/test/fixture/factory/route/serializer file(s) -p [before|top|after|bottom], Place the annotations at the top (before) or the bottom (after) of the model/test/fixture/factory/route/serializer file(s)
--position --position
...@@ -216,18 +216,18 @@ you can do so with a simple environment variable, instead of editing the ...@@ -216,18 +216,18 @@ you can do so with a simple environment variable, instead of editing the
--ignore-unknown-models don't display warnings for bad model files --ignore-unknown-models don't display warnings for bad model files
--with-comment include database comments in model annotations --with-comment include database comments in model annotations
=== Option: +additional-file-patterns+ === Option: +additional_file_patterns+
CLI: +--additional-file-patterns+<br> CLI: +--additional_file_patterns+<br>
Ruby: +:additional-file-patterns+ Ruby: +:additional_file_patterns+
Provide additional paths for the gem to annotate. These paths can include globs. Provide additional paths for the gem to annotate. These paths can include globs.
It is recommended to use absolute paths. Here are some examples: It is recommended to use absolute paths. Here are some examples:
- <code>/app/lib/decorates/%MODEL_NAME%/*.rb</code> - <code>/app/lib/decorates/%MODEL_NAME%/&ast;.rb</code>
- <code>/app/lib/forms/%PLURALIZED_MODEL_NAME%/**/*.rb</code> - <code>/app/lib/forms/%PLURALIZED_MODEL_NAME%/&ast;&ast;/&ast;.rb</code>
- <code>/app/lib/forms/%TABLE_NAME%/*.rb</code> - <code>/app/lib/forms/%TABLE_NAME%/&ast;.rb</code>
The appropriate model will be inferred using the <code>%*%</code> syntax, annotating any matching files. The appropriate model will be inferred using the <code>%*%</code> syntax, annotating any matching files.
It works with existing filename resolutions (options for which can be found in the +resolve_filename+ method of It works with existing filename resolutions (options for which can be found in the +resolve_filename+ method of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment