-
Notifications
You must be signed in to change notification settings - Fork 27
45 lines (45 loc) · 1.17 KB
/
workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: steps
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
name: test on ruby ${{ matrix.ruby }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: ruby/setup-ruby@master
with:
ruby-version: ${{ matrix.ruby }}
- run: gem install bundler
- run: bundle install
- run: bundle exec rake
- run: bundle exec overcommit --sign
- env:
GIT_AUTHOR_NAME: John Doe
GIT_AUTHOR_EMAIL: johndoe@example.com
run: bundle exec overcommit --run
strategy:
matrix:
ruby: ['3.0', '3.1', '3.2']
deploy:
if: github.ref == 'refs/heads/main'
name: to rubygems
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: ruby/setup-ruby@master
with:
ruby-version: 3.2
- env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem