-
Notifications
You must be signed in to change notification settings - Fork 7
34 lines (31 loc) · 1022 Bytes
/
ci.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
name: ci
on:
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
- name: Install dependencies
run: bundle install
- name: Run tests
run: rspec .
publish:
name: Build and publish gem
if: github.ref == 'refs/heads/main' && needs.test.result == 'success'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
- name: Publish to GPR
run: |
curl -u $RUBYGEMS_USERNAME:$RUBYGEMS_PASSWORD https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
gem build arxiv.gemspec
gem push `ls | grep *.gem`
env:
RUBYGEMS_USERNAME: "${{ secrets.RUBYGEMS_USERNAME }}"
RUBYGEMS_PASSWORD: "${{ secrets.RUBYGEMS_PASSWORD }}"