-
Notifications
You must be signed in to change notification settings - Fork 48
74 lines (69 loc) · 2.12 KB
/
release_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
name: Release gem
on:
repository_dispatch:
types:
- release-triggered
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
- run: |
gem install bundler -v 2.4
bundle install
- name: Test
run: bundle exec rake
release:
needs: test
runs-on: ubuntu-latest
outputs:
gem_name: ${{ steps.release.outputs.gem_name }}
version: ${{ steps.release.outputs.version }}
increment: ${{ steps.release.outputs.increment }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pact-foundation/release-gem@v1
id: release
env:
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_API_KEY }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
INCREMENT: '${{ github.event.client_payload.increment }}'
record-release:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
- name: Bundle install
run: |
gem install bundler -v 2.4
bundle config set --local without development test
bundle install
- name: Record release
run: script/ci/record-release.sh
env:
PACT_BROKER_BASE_URL: https://pact-foundation.pactflow.io
PACT_BROKER_TOKEN: ${{ secrets.PACT_BROKER_TOKEN_PACT_FOUNDATION }}
notify-gem-released:
needs: release
strategy:
matrix:
repository: [pact-foundation/pact-ruby-cli, pact-foundation/pact-ruby-standalone, pact-foundation/pact_broker-client]
runs-on: ubuntu-latest
steps:
- name: Notify ${{ matrix.repository }} of gem release
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GHTOKENFORPACTCLIRELEASE }}
repository: ${{ matrix.repository }}
event-type: gem-released
client-payload: |
{
"name": "${{ needs.release.outputs.gem_name }}",
"version": "${{ needs.release.outputs.version }}",
"increment": "${{ needs.release.outputs.increment }}"
}