-
-
Notifications
You must be signed in to change notification settings - Fork 11
86 lines (72 loc) · 2.43 KB
/
Copy pathci.yml
File metadata and controls
86 lines (72 loc) · 2.43 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
79
80
81
82
83
84
85
86
name: CI
on:
- push
- pull_request
jobs:
test:
name: Test with Asciidoctor ${{ matrix.asciidoctor }} on Ruby ${{ matrix.ruby }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- '3.1'
- '3.0'
- '2.7'
#- head TODO: Uncomment after asciidoctor fixes compatibility with Ruby >=3.5
- jruby-head
asciidoctor: [2.0.17]
include:
- { asciidoctor: 'git:main', ruby: 3.1 }
- { asciidoctor: 2.0.10 , ruby: 2.7 }
- { asciidoctor: 2.0.0 , ruby: 2.7 }
- { asciidoctor: 1.5.8 , ruby: 2.7 }
- { asciidoctor: 1.5.7.1 , ruby: 2.7 }
- { asciidoctor: 1.5.7 , ruby: 2.7 }
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
ASCIIDOCTOR_VERSION: ${{ matrix.asciidoctor }}
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.asciidoctor == 'git:main' }}
steps:
- uses: actions/checkout@v2
- run: sudo apt-get install pandoc
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: false # XXX: problems with nokogiri on ruby 3.1+
- run: bundle install
- run: bundle exec rake test
- if: matrix.ruby != 'jruby-head'
run: bundle exec rake build:js
- run: bundle exec rake readme2md
publish:
name: Publish to RubyGems and npmjs
needs: [test]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: sudo apt-get install pandoc
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- uses: actions/setup-node@v2
with:
node-version: 12
registry-url: https://registry.npmjs.org
- run: bundle exec rake build
- run: bundle exec rake build:js
- run: bundle exec rake readme2md
- name: Publish to RubyGems
run: |
install -D -m 0600 /dev/null $HOME/.gem/credentials
printf -- '---\n:rubygems_api_key: %s\n' "$RUBYGEMS_API_KEY" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} # c9a4......f34d
- name: Publish to npmjs
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # d0e3......b2a6