forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (136 loc) · 4.94 KB
/
publish-bulk-cdk.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
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
name: Publish Bulk CDK
on:
push:
branches:
- master
paths:
- "airbyte-cdk/bulk/**"
workflow_dispatch:
inputs:
build-number:
description: "Build Number"
required: false
type: number
concurrency:
group: publish-bulk-cdk
cancel-in-progress: false
env:
S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }}
S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }}
jobs:
publish-bulk-cdk:
name: Publish Bulk CDK
runs-on: linux-20.04-large # Custom runner, defined in GitHub org settings
timeout-minutes: 30
steps:
- name: Checkout Airbyte
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "21"
- name: Docker login
# Some tests use testcontainers which pull images from DockerHub.
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Set Build Number [manual]
if: github.event.inputs.build-number
env:
BUILD_NUMBER: ${{ github.event.inputs.build-number }}
run: |
mkdir -p airbyte-cdk/bulk/build/generated
echo $BUILD_NUMBER > airbyte-cdk/bulk/build/generated/build.number
- name: Set Build Number [auto]
if: ${{ !github.event.inputs.build-number }}
uses: burrunan/gradle-cache-action@v1
env:
CI: true
with:
job-id: bulk-cdk-publish
concurrent: true
gradle-distribution-sha-256-sum-warning: false
arguments: --scan :airbyte-cdk:bulk:generateBuildNumberFile
- name: Read Build Number
run: echo "BUILD_NUMBER=$(cat airbyte-cdk/bulk/build/generated/build.number)" >>$GITHUB_ENV
- name: Build Bulk CDK
uses: burrunan/gradle-cache-action@v1
env:
CI: true
with:
job-id: bulk-cdk-publish
concurrent: true
gradle-distribution-sha-256-sum-warning: false
arguments: --scan :airbyte-cdk:bulk:bulkCdkBuild
- name: Publish Poms and Jars to CloudRepo
uses: burrunan/gradle-cache-action@v1
env:
CI: true
CLOUDREPO_USER: ${{ secrets.CLOUDREPO_USER }}
CLOUDREPO_PASSWORD: ${{ secrets.CLOUDREPO_PASSWORD }}
with:
job-id: bulk-cdk-publish
read-only: true
concurrent: true
execution-only-caches: true
gradle-distribution-sha-256-sum-warning: false
arguments: --scan :airbyte-cdk:bulk:bulkCdkPublish
- name: Post failure to Slack channel
if: ${{ env.DRY_RUN == 'false' && failure() }}
uses: slackapi/[email protected]
continue-on-error: true
with:
channel-id: C07K1P3UL6Q # The `#dev-java-cdk-releases` channel
payload: |
{
"text": "Error while publishing Bulk CDK!",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Error while publishing Bulk CDK!"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "See details on <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|GitHub>\n"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}
- name: Post success to Slack channel
if: ${{ env.DRY_RUN == 'false' && !failure() }}
uses: slackapi/[email protected]
continue-on-error: true
with:
channel-id: C07K1P3UL6Q # The `#dev-java-cdk-releases` channel
payload: |
{
"text": "Bulk CDK version 0.${{ env.BUILD_NUMBER }} published successfully!",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Bulk CDK version 0.${{ env.BUILD_NUMBER }} published successfully!"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "See details on <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|GitHub>\n"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN_AIRBYTE_TEAM }}