@@ -98,14 +98,20 @@ jobs:
98
98
- name : Install Java
99
99
uses : actions/setup-java@v1
100
100
with :
101
- java-version : ' 17 '
101
+ java-version : " 17 "
102
102
- name : Install Pyenv and Tox
103
103
# Beside PyEnv, this does not set any runtimes up because it uses an AMI image that has everything pre-installed. See https://github.com/airbytehq/airbyte/issues/4559/
104
104
run : |
105
105
python3 -m pip install --quiet virtualenv==16.7.9 --user
106
106
python3 -m virtualenv venv
107
107
source venv/bin/activate
108
108
pip install --quiet tox==3.24.4
109
+ - name : Install yq
110
+ run : |
111
+ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
112
+ sudo add-apt-repository ppa:rmescandon/yq
113
+ sudo apt update
114
+ sudo apt install yq -y
109
115
- name : Test and install CI scripts
110
116
# all CI python packages have the prefix "ci_"
111
117
run : |
@@ -153,20 +159,20 @@ jobs:
153
159
SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_CONNECTOR_RELEASE_AUTH_TOKEN }}
154
160
SENTRY_ORG : airbyte-5j
155
161
SENTRY_PROJECT : airbyte-connectors
156
- - name : Add Success Comment
162
+ - name : Add Published Success Comment
157
163
if : github.event.inputs.comment-id && success()
158
164
uses : peter-evans/create-or-update-comment@v1
159
165
with :
160
166
comment-id : ${{ github.event.inputs.comment-id }}
161
167
body : |
162
- > :white_check_mark: ${{github.event.inputs.connector}} https://github.com/${{github.repository}}/actions/runs/${{github.run_id }}
163
- - name : Add Failure Comment
168
+ > :rocket: Successfully published ${{github.event.inputs.connector}}
169
+ - name : Add Published Failure Comment
164
170
if : github.event.inputs.comment-id && !success()
165
171
uses : peter-evans/create-or-update-comment@v1
166
172
with :
167
173
comment-id : ${{ github.event.inputs.comment-id }}
168
174
body : |
169
- > :x: ${{github.event.inputs.connector}} https://github.com/${{github.repository}}/actions/runs/${{github.run_id }}
175
+ > :x: Failed to publish ${{github.event.inputs.connector}}
170
176
- name : Slack Notification - Failure
171
177
if : failure()
172
178
uses : rtCamp/action-slack-notify@master
@@ -177,6 +183,54 @@ jobs:
177
183
SLACK_COLOR : DC143C
178
184
SLACK_TITLE : " Failed to publish connector ${{ github.event.inputs.connector }} from branch ${{ github.ref }}"
179
185
SLACK_FOOTER : " "
186
+ - name : Check if connector in definitions yaml
187
+ run : |
188
+ connector="airbyte/${{ env.IMAGE_NAME }}"
189
+ definitionpath=./airbyte-config/init/src/main/resources/seed/
190
+ sourcecheck=$(yq e ".. | select(has(\"dockerRepository\")) | select(.dockerRepository == \"$connector\")" "$definitionpath"source_definitions.yaml)
191
+ destcheck=$(yq e ".. | select(has(\"dockerRepository\")) | select(.dockerRepository == \"$connector\")" "$definitionpath"destination_definitions.yaml)
192
+ if [[ (-z "$sourcecheck" && -z "$destcheck") ]]
193
+ then exit 1
194
+ fi
195
+ - name : Bump version in definitions yaml
196
+ run : |
197
+ connector="airbyte/${{ env.IMAGE_NAME }}"
198
+ definitionpath=./airbyte-config/init/src/main/resources/seed/
199
+ sourcename=$(yq e ".[] | select(has(\"dockerRepository\")) | select(.dockerRepository == \"$connector\") | .name" "$definitionpath"source_definitions.yaml)
200
+ destname=$(yq e ".[] | select(has(\"dockerRepository\")) | select(.dockerRepository == \"$connector\") | .name" "$definitionpath"destination_definitions.yaml)
201
+ if [ -z "$sourcename" ]
202
+ then yq e "(.[] | select(.name == \"$destname\").dockerImageTag)|=\"${{ env.IMAGE_VERSION }}\"" -i "$definitionpath"destination_definitions.yaml
203
+ else yq e "(.[] | select(.name == \"$sourcename\").dockerImageTag)|=\"${{ env.IMAGE_VERSION }}\"" -i "$definitionpath"source_definitions.yaml
204
+ fi
205
+ - name : Run gradle process changes
206
+ run : |
207
+ ./gradlew :airbyte-config:init:processResources
208
+ - name : git commit and push
209
+ run : |
210
+ git add -u
211
+ git commit -m "auto-bump connector version"
212
+ git push origin ${{ github.ref }}
213
+ - name : Add Version Bump Success Comment
214
+ if : github.event.inputs.comment-id && success()
215
+ uses : peter-evans/create-or-update-comment@v1
216
+ with :
217
+ comment-id : ${{ github.event.inputs.comment-id }}
218
+ body : |
219
+ > :rocket: Auto-bumped version for ${{github.event.inputs.connector}}
220
+ - name : Add Version Bump Failure Comment
221
+ if : github.event.inputs.comment-id && !success()
222
+ uses : peter-evans/create-or-update-comment@v1
223
+ with :
224
+ comment-id : ${{ github.event.inputs.comment-id }}
225
+ body : |
226
+ > :x: Couldn't auto-bump version for ${{github.event.inputs.connector}}
227
+ - name : Add Final Success Comment
228
+ if : github.event.inputs.comment-id && success()
229
+ uses : peter-evans/create-or-update-comment@v1
230
+ with :
231
+ comment-id : ${{ github.event.inputs.comment-id }}
232
+ body : |
233
+ > :white_check_mark: ${{github.event.inputs.connector}} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
180
234
# In case of self-hosted EC2 errors, remove this block.
181
235
stop-publish-image-runner :
182
236
name : Stop Build EC2 Runner
0 commit comments