-
Notifications
You must be signed in to change notification settings - Fork 4.2k
230 lines (206 loc) · 8.28 KB
/
release-airbyte-os.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: Release Open Source Airbyte
concurrency: release-airbyte
on:
workflow_dispatch:
inputs:
partToBump:
description: "Please choose the type of version upgrade : major|minor|patch"
required: true
default: "patch"
jobs:
# In case of self-hosted EC2 errors, remove this block.
start-release-airbyte-runner:
name: "Release Airbyte: Start EC2 Runner"
timeout-minutes: 10
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Checkout Airbyte
uses: actions/checkout@v3
- name: Check PAT rate limits
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.GH_PAT_BUILD_RUNNER_OSS }} \
${{ secrets.GH_PAT_BUILD_RUNNER_BACKUP }}
- name: Start AWS Runner
id: start-ec2-runner
uses: ./.github/actions/start-aws-runner
with:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
github-token: ${{ env.PAT }}
release-airbyte-platform:
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest.
needs:
- start-release-airbyte-runner
runs-on: ${{ needs.start-release-airbyte-runner.outputs.label }} # run the job on the newly created runner
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "21"
- uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Checkout Airbyte Platform
uses: actions/checkout@v3
with:
repository: airbytehq/airbyte-platform
ref: main
path: airbyte-platform
fetch-depth: 0
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
- name: Release Airbyte Platform
id: release_airbyte_platform
working-directory: airbyte-platform
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
PART_TO_BUMP: ${{ github.event.inputs.partToBump }}
CLOUDREPO_USER: ${{ secrets.CLOUDREPO_USER }}
CLOUDREPO_PASSWORD: ${{ secrets.CLOUDREPO_PASSWORD }}
run: |
./tools/bin/release_version.sh # this script calls the bump_version.sh script
- name: Auto Commit Version for Airbyte Platform
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: airbyte-platform
commit_message: Bump Airbyte version from ${{ steps.release_airbyte_platform.outputs.PREV_VERSION }} to ${{ steps.release_airbyte_platform.outputs.NEW_VERSION }}
- name: Generate Change Log for Airbyte Platform
working-directory: airbyte-platform
env:
PREV_VERSION: ${{ steps.release_airbyte_platform.outputs.PREV_VERSION }}
GIT_REVISION: ${{ steps.release_airbyte_platform.outputs.GIT_REVISION }}
run: |
CHANGELOG=`PAGER=cat git log v${PREV_VERSION}..${GIT_REVISION} --oneline --decorate=no`
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo -e "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo $CHANGELOG
- name: Create Release for Airbyte Platform
id: create_release
uses: ncipollo/release-action@v1
env:
NEW_VERSION: ${{ steps.release_airbyte_platform.outputs.NEW_VERSION }}
with:
owner: airbytehq
repo: airbyte-platform
body: ${{ env.CHANGELOG }}
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
tag: v${{ env.NEW_VERSION }}
release-airbyte:
# In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest.
needs:
- start-release-airbyte-runner
- release-airbyte-platform
runs-on: ${{ needs.start-release-airbyte-runner.outputs.label }} # run the job on the newly created runner
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Checkout Airbyte
uses: actions/checkout@v3
with:
repository: airbytehq/airbyte
ref: master
path: airbyte
fetch-depth: 0
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
- name: Bump Version for Airbyte
id: bump_version
working-directory: airbyte
env:
PART_TO_BUMP: ${{ github.event.inputs.partToBump }}
run: |
./tools/bin/bump_version.sh
- name: Run run-ab-platform script to download artifacts from Airbyte Platform
working-directory: airbyte
run: |
./run-ab-platform.sh --refresh
./run-ab-platform.sh --download
- name: Auto Commit Version and Platform Artifacts into Airbyte
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: airbyte
commit_message: Bump Airbyte version from ${{ steps.bump_version.outputs.PREV_VERSION }} to ${{ steps.bump_version.outputs.NEW_VERSION }}
push_options: --force
- name: Generate Change Log for Airbyte
working-directory: airbyte
env:
PREV_VERSION: ${{ steps.bump_version.outputs.PREV_VERSION }}
GIT_REVISION: ${{ steps.bump_version.outputs.GIT_REVISION }}
run: |
CHANGELOG=`PAGER=cat git log v${PREV_VERSION}..${GIT_REVISION} --oneline --decorate=no`
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo -e "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo $CHANGELOG
- name: Create Release for Airbyte
id: create_release
uses: ncipollo/release-action@v1
env:
NEW_VERSION: ${{ steps.bump_version.outputs.NEW_VERSION }}
with:
owner: airbytehq
repo: airbyte
body: ${{ env.CHANGELOG }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ env.NEW_VERSION }}
# We are releasing octavia from a separate job because:
# - The self hosted runner used in releaseAirbyte does not have the docker buildx command to build multi-arch images
release-octavia:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "21"
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Release Octavia
id: release_octavia
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
PART_TO_BUMP: ${{ github.event.inputs.partToBump }}
run: ./tools/bin/release_version_octavia.sh
# In case of self-hosted EC2 errors, remove this block.
stop-release-airbyte-runner:
name: "Release Airbyte: Stop EC2 Runner"
timeout-minutes: 10
needs:
- start-release-airbyte-runner # required to get output from the start-runner job
- release-airbyte # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Checkout Airbyte
uses: actions/checkout@v3
- name: Check PAT rate limits
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.GH_PAT_BUILD_RUNNER_OSS }} \
${{ secrets.GH_PAT_BUILD_RUNNER_BACKUP }}
- name: Stop EC2 runner
uses: supertopher/[email protected]
with:
mode: stop
github-token: ${{ env.PAT }}
label: ${{ needs.start-release-airbyte-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-release-airbyte-runner.outputs.ec2-instance-id }}