Skip to content

Commit af0014f

Browse files
ctranpeterfication
authored andcommitted
Use Github acttions to publish to rubygem (ctran#656)
1 parent c74829c commit af0014f

File tree

3 files changed

+55
-11
lines changed

3 files changed

+55
-11
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
name: CI
2-
on: [push]
2+
on:
3+
pull_request:
4+
branches:
5+
- '*'
6+
7+
push:
8+
branches:
9+
- '*'
10+
311
jobs:
412
test:
513
runs-on: ubuntu-latest
@@ -12,17 +20,17 @@ jobs:
1220
steps:
1321
- name: Checkout
1422
uses: actions/checkout@v1
15-
- name: Setup System
16-
run: |
17-
sudo apt-get install libsqlite3-dev
23+
1824
- name: Setup Ruby
1925
uses: actions/setup-ruby@v1
2026
with:
2127
ruby-version: ${{ matrix.ruby }}
28+
2229
- name: Bundle
2330
run: |
2431
gem update --system
2532
gem update bundler
2633
bundle install --jobs 4 --retry 3
34+
2735
- name: Test
2836
run: bundle exec rubocop && bundle exec rspec

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- 'release/v*'
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v1
14+
15+
- name: Setup Ruby
16+
uses: actions/setup-ruby@v1
17+
with:
18+
ruby-version: 2.6.x
19+
20+
- name: Bundle
21+
run: |
22+
gem update --system
23+
gem update bundler
24+
bundle install --jobs 4 --retry 3
25+
26+
- name: Publish to GPR
27+
run: |
28+
mkdir -p $HOME/.gem
29+
touch $HOME/.gem/credentials
30+
chmod 0600 $HOME/.gem/credentials
31+
printf -- "---\n:github: Bearer ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
32+
gem build *.gemspec
33+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
34+
env:
35+
GEM_HOST_API_KEY: ${{secrets.GPR_AUTH_TOKEN}}
36+
OWNER: ctran

README.rdoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ you can do so with a simple environment variable, instead of editing the
163163
== Options
164164

165165
Usage: annotate [options] [model_file]*
166-
--additional-file-patterns Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%model_name%/*.rb,/baz/%model_name%.rb`)
166+
--additional_file_patterns Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%model_name%/*.rb,/baz/%model_name%.rb`)
167167
-d, --delete Remove annotations from all model files or the routes.rb file
168168
-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)
169169
--position
@@ -216,18 +216,18 @@ you can do so with a simple environment variable, instead of editing the
216216
--ignore-unknown-models don't display warnings for bad model files
217217
--with-comment include database comments in model annotations
218218

219-
=== Option: +additional-file-patterns+
219+
=== Option: +additional_file_patterns+
220220

221-
CLI: +--additional-file-patterns+<br>
222-
Ruby: +:additional-file-patterns+
221+
CLI: +--additional_file_patterns+<br>
222+
Ruby: +:additional_file_patterns+
223223

224224
Provide additional paths for the gem to annotate. These paths can include globs.
225225
It is recommended to use absolute paths. Here are some examples:
226226

227227

228-
- <code>/app/lib/decorates/%MODEL_NAME%/*.rb</code>
229-
- <code>/app/lib/forms/%PLURALIZED_MODEL_NAME%/**/*.rb</code>
230-
- <code>/app/lib/forms/%TABLE_NAME%/*.rb</code>
228+
- <code>/app/lib/decorates/%MODEL_NAME%/&ast;.rb</code>
229+
- <code>/app/lib/forms/%PLURALIZED_MODEL_NAME%/&ast;&ast;/&ast;.rb</code>
230+
- <code>/app/lib/forms/%TABLE_NAME%/&ast;.rb</code>
231231

232232
The appropriate model will be inferred using the <code>%*%</code> syntax, annotating any matching files.
233233
It works with existing filename resolutions (options for which can be found in the +resolve_filename+ method of

0 commit comments

Comments
 (0)