-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (97 loc) · 2.86 KB
/
main.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Verify code
on:
push:
branches: [development]
jobs:
rspec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.0.3
- name: Run specs & upload coverage report
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
COVERAGE: 'true'
with:
coverageCommand: bundle exec rake rspec
coverageLocations: ${{github.workspace}}/coverage/coverage.xml:cobertura
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.0.3
- run: bin/rubocop
doctest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.0.3
- run: bundle exec rake yard:doctest
deploy:
concurrency:
group: deploy
cancel-in-progress: true
needs: [rspec, rubocop, doctest]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.0.3
- name: Bump gem version
run: |
git config user.name github-actions
git config user.email [email protected]
bundle exec bump patch --changelog
- name: Build gem and release to Rubygems
uses: cadwallion/publish-rubygems-action@master
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push code to main
run: git push origin -f development:main --follow-tags
- name: Get current gem version
run: echo "::set-output name=version::$(bundle exec bump current)"
id: gem
- name: Create github release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: Release ${{ steps.gem.outputs.version }}
tag_name: v${{ steps.gem.outputs.version }}
prerelease: false
draft: false
- name: Publish gem to Github
uses: jstastny/publish-gem-to-github@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: oleander
docs:
runs-on: ubuntu-latest
needs: [deploy]
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.0.3
- name: Build docs
run: |
bundle exec rake yard:docs
git config user.name github-actions
git config user.email [email protected]
git add docs/
git commit -m 'update docs'
git push -f origin development:gh-pages