-
Notifications
You must be signed in to change notification settings - Fork 4
78 lines (74 loc) · 2.5 KB
/
Copy pathci.yml
File metadata and controls
78 lines (74 loc) · 2.5 KB
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
name: CI
on: push
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
with:
ruby-version: 3.2
bundler-cache: true
- name: Run linter
run: bundle exec rubocop --parallel --format=progress --format=github
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby_version:
- 2.7
- "3.0"
- 3.1
- 3.2
- 3.3
- 3.4
- "4.0"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Install dependencies via Appraisal
run: bundle exec appraisal install
- name: Run tests via Appraisal
run: bundle exec appraisal rake test
release-please:
name: Release Please
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/heads/') }}
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
version: ${{ steps.release-please.outputs.version }}
steps:
- uses: krystal/release-please-manifest-action@092261975f7de95f39420852ffa44410d8e726bc # v2.0.0
id: release-please
with:
target-branch-pattern: '^(main|master|release-[0-9]+(\.[0-9]+)?\.x)$'
app-id: ${{ vars.RELEASE_BOT_APP_ID }}
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
release:
runs-on: ubuntu-latest
needs: [release-please, test]
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Ruby
uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
with:
ruby-version: 3.2
bundler-cache: true
- name: Build Gem
run: gem build *.gemspec
- name: Setup credentials
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
env:
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
- name: Publish to RubyGems
run: |
gem push *.gem