-
Notifications
You must be signed in to change notification settings - Fork 3
85 lines (66 loc) · 2.2 KB
/
gem.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
name: Ruby Gem
on: [push, pull_request]
jobs:
variables:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.variables.outputs.branch }}
version: ${{ steps.variables.outputs.version }}
repository_url: ${{ steps.variables.outputs.repository_url }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x.x'
- id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Generate variables
id: variables
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: .github/scripts/variables.sh ${{ steps.gitversion.outputs.legacySemVerPadded }}
gem:
needs: variables
runs-on: ubuntu-latest
outputs:
name: ${{ steps.gem.outputs.name }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Build gem
id: gem
run: .github/scripts/build_gem.sh --version "${{ needs.variables.outputs.version }}"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.gem.outputs.name }}
path: ${{ steps.gem.outputs.name }}
- uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 14
- uses: kamiazya/setup-graphviz@v1
- name: Test gem
run: .github/scripts/test_gem.sh --workdir "${{ github.workspace }}/spec/fixture" --verbose
publish:
needs: gem
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{ needs.gem.outputs.name }}
- name: Publish to GPR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .github/scripts/publish_gem.sh --gem ${{ needs.gem.outputs.name }} --token $GITHUB_TOKEN --verbose
- name: Publish to RubyGems
if: startsWith(github.ref, 'refs/tags/') # Only publish tagged commits
env:
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
run: .github/scripts/publish_gem.sh --gem ${{ needs.gem.outputs.name }} --key $RUBYGEMS_API_KEY --verbose