-
Notifications
You must be signed in to change notification settings - Fork 25
148 lines (146 loc) · 6.31 KB
/
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: release
# Publishes twitter/util, twitter/scrooge, twitter/finagle, twitter/twitter-server,
# and twitter/finatra.
#
# Expects a repository dispatch event: https://developer.github.com/v3/repos/#create-a-repository-dispatch-event
# in the form of JSON data POST to /repos/twitter/dodo/dispatches:
#
# {
# "event_type": "release",
# "client_payload": {
# "phab_id": "D12345",
# "version": "17.12.0",
# "scrooge_sbt_plugin": true,
# "scrooge_maven_plugin": true,
# "dry_run": true
# }
# }
env:
JAVA_OPTS: "-Dsbt.log.noformat=true"
PGP_KEY: ${{ secrets.PGP_KEY }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_PASS: ${{ secrets.BINTRAY_PASS }}
API_USER: ${{ secrets.API_USER }}
API_KEY: ${{ secrets.API_KEY }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
defaults:
run:
shell: bash
on:
repository_dispatch:
types: [release]
jobs:
release:
runs-on: ubuntu-20.04
steps:
- name: dump/context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/[email protected]
- uses: actions/setup-java@v1
with:
java-version: 1.8
- uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]
- uses: olafurpg/setup-gpg@v3
- name: setup/gpg
run: ${{ github.workspace }}/bin/gpg-init
- name: setup/maven
uses: whelk-io/maven-settings-xml-action@v14
with:
servers: '[{ "id": "sonatype-nexus-staging", "username": "${{ secrets.SONATYPE_USERNAME }}", "password": "${{ secrets.SONATYPE_PASSWORD }}" }]'
- name: setup/sbt
run: |
cp -r ${{ github.workspace }}/bin/.sbt ~/.sbt
# checkout util and release
- name: checkout/util
uses: actions/[email protected]
with:
repository: twitter/util
token: ${{ secrets.API_KEY }}
ref: release
path: util
- name: release/util
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose util
working-directory: ${{ github.workspace }}/util
# checkout scrooge and release
- name: checkout/scrooge
if: ${{ success() }}
uses: actions/[email protected]
with:
repository: twitter/scrooge
token: ${{ secrets.API_KEY }}
ref: release
path: scrooge
- name: release/scrooge
if: ${{ success() }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose scrooge
working-directory: ${{ github.workspace }}/scrooge
# scrooge-sbt-plugin
- name: release/scrooge-sbt-plugin
if: ${{ success() && github.event.client_payload.scrooge_sbt_plugin }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose scrooge-sbt-plugin
working-directory: ${{ github.workspace }}/scrooge
# scrooge-maven-plugin
- name: release/scrooge-maven-plugin
if: ${{ success() && github.event.client_payload.scrooge_maven_plugin }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose scrooge-maven-plugin
working-directory: ${{ github.workspace }}/scrooge
# checkout finagle and release
- name: checkout/finagle
if: ${{ success() }}
uses: actions/[email protected]
with:
repository: twitter/finagle
token: ${{ secrets.API_KEY }}
ref: release
path: finagle
- name: release/finagle
if: ${{ success() }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose finagle
working-directory: ${{ github.workspace }}/finagle
# checkout twitter-server and release
- name: checkout/twitter-server
if: ${{ success() }}
uses: actions/[email protected]
with:
repository: twitter/twitter-server
token: ${{ secrets.API_KEY }}
ref: release
path: twitter-server
- name: release/twitter-server
if: ${{ success() }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose twitter-server
working-directory: ${{ github.workspace }}/twitter-server
# checkout finatra and release
- name: checkout/finatra
if: ${{ success() }}
uses: actions/[email protected]
with:
repository: twitter/finatra
token: ${{ secrets.API_KEY }}
ref: release
path: finatra
- name: release/finatra
if: ${{ success() }}
run: |
${{ github.workspace }}/bin/publish --phab-id ${{ github.event.client_payload.phab_id }} --version ${{ github.event.client_payload.version }} --dry-run ${{ github.event.client_payload.dry_run }} --verbose finatra
working-directory: ${{ github.workspace }}/finatra
- name: slack/notification-failure
if: ${{ cancelled() || failure() }}
run: ${{ github.workspace }}/bin/slack --verbose --denote-dry-run ${{ github.event.client_payload.dry_run }} --message "🐣 Versioned release \`failed\`." --color "#DA2700"
- name: slack/notification-success
if: ${{ success() }}
run: ${{ github.workspace }}/bin/slack --verbose --denote-dry-run ${{ github.event.client_payload.dry_run }} --message "🐣 Versioned release \`successful\`." --color "#229954"