-
Notifications
You must be signed in to change notification settings - Fork 34
85 lines (78 loc) · 2.41 KB
/
manual_release.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: Manual release
on:
workflow_dispatch:
inputs:
version:
description: 'Version of the pact-ruby-standalone package to be released'
required: true
type: string
increment:
description: 'The increment for this version'
required: true
type: choice
default: minor
options:
- major
- minor
- patch
- pre
notify_released:
description: 'Notify downstream project of release'
required: false
type: boolean
default: true
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
- name: Set up environment
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git config --global push.default current
bundler -v
bundle install
- name: Prepare manual release
id: prepare
run: script/prepare-manual-release-in-github-workflow.sh
env:
INCREMENT: ${{ github.event.inputs.increment }}
VERSION: ${{ github.event.inputs.version }}
- name: Create release
uses: ncipollo/release-action@v1
with:
name: pact-${{ steps.prepare.outputs.version }}
tag: ${{ steps.prepare.outputs.tag }}
artifacts: pkg/*
bodyFile: build/RELEASE_NOTES.md
token: ${{ secrets.GITHUB_TOKEN }}
outputs:
version: ${{ steps.prepare.outputs.version }}
increment: ${{ steps.prepare.outputs.increment }}
notify-released:
if: ${{ github.event.inputs.notify_released == 'true' }}
needs: release
strategy:
matrix:
repository: [pact-foundation/pact-node, pact-foundation/homebrew-pact-ruby-standalone]
runs-on: ubuntu-latest
steps:
- name: Notify ${{ matrix.repository }} of gem release
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GHTOKENFORRELEASEDISPATCH }}
repository: ${{ matrix.repository }}
event-type: pact-ruby-standalone-released
client-payload: |
{
"version": "${{ needs.release.outputs.version }}",
"increment": "${{ needs.release.outputs.increment }}"
}