-
Notifications
You must be signed in to change notification settings - Fork 546
582 lines (517 loc) · 22.6 KB
/
publish_plugin_to_hub.yml
File metadata and controls
582 lines (517 loc) · 22.6 KB
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
name: Publish plugin to hub
on:
push:
tags:
- "plugins-*-*-v*.*.*"
- "!plugins-destination-duckdb-v*.*.*"
- "!plugins-destination-sqlite-v*.*.*"
- "!plugins-destination-snowflake-v*.*.*"
env:
ui_dir_name: cloud-config-ui
permissions:
contents: read
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
plugin_name_undashed: ${{ steps.undash_plugin_name.outputs.plugin_name }}
plugin_name: ${{ steps.split.outputs.plugin_name }}
plugin_kind: ${{ steps.split.outputs.plugin_kind }}
plugin_version: ${{ steps.split.outputs.plugin_version }}
plugin_dir: ${{ steps.split.outputs.plugin_dir }}
prerelease: ${{ steps.semver_parser.outputs.prerelease }}
plugin_releaser: ${{ steps.set-result.outputs.result }}
ui_build_dir: ${{ steps.split.outputs.ui_build_dir }}
ui_dir_arg: ${{ steps.check-ui-directory.outputs.result }}
steps:
- name: Split tag
id: split
run: |
tag=${{ github.ref_name }}
plugin_kind=$(echo $tag | cut -d- -f2)
plugin_name=$(echo $tag | cut -d- -f3)
plugin_version=$(echo $tag | cut -d- -f4-)
# perform looping till either the plugin version passes our semver test or is empty
until [[ $plugin_version =~ ^v?[0-9]+\.[0-9]+ ]] || [[ $(echo $plugin_version | wc -c) -eq 0 ]] ; do
echo "${plugin_version} is not a valid version"
plugin_name="$plugin_name-$(echo $plugin_version | cut -d- -f1)"
plugin_version=$(echo $plugin_version | cut -d- -f2-)
done
echo "plugin_name=${plugin_name}" >> $GITHUB_OUTPUT
echo "plugin_kind=${plugin_kind}" >> $GITHUB_OUTPUT
echo "plugin_version=${plugin_version}" >> $GITHUB_OUTPUT
echo "plugin_dir=plugins/${plugin_kind}/${plugin_name}" >> $GITHUB_OUTPUT
echo "ui_build_dir=plugins/${plugin_kind}/${plugin_name}/$ui_dir_name/build" >> $GITHUB_OUTPUT
- name: Undash
id: undash_plugin_name
env:
plugin_name: ${{ steps.split.outputs.plugin_name }}
run: |
p=$(echo $plugin_name | sed 's|-|_|g')
echo "plugin_name=${p}" >> $GITHUB_OUTPUT
# Fail if not a valid SemVer string
- name: Parse semver string
uses: booxmedialtd/ws-action-parse-semver@7784200024d6b3fc01253e617ec0168daf603de3
id: semver_parser
with:
input_string: ${{steps.split.outputs.plugin_version}}
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
id: set-result
env:
PLUGIN_DIR: ${{steps.split.outputs.plugin_dir}}
with:
script: |
const fs = require('fs').promises;
const path = require('path');
const pluginFiles = await fs.readdir(process.env.PLUGIN_DIR);
if (pluginFiles.includes('package.json')) {
return 'node';
}
if (pluginFiles.includes('main.go')) {
return 'go';
}
if (pluginFiles.includes('main.py')) {
return 'python';
}
if (pluginFiles.includes('settings.gradle')) {
return 'java';
}
return 'unsupported';
result-encoding: string
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
id: check-ui-directory
env:
PLUGIN_DIR: ${{steps.split.outputs.plugin_dir}}
with:
script: |
const fs = require('fs').promises;
const path = require('path');
const pluginFiles = await fs.readdir(process.env.PLUGIN_DIR);
if (pluginFiles.includes(process.env.ui_dir_name)) {
return '--ui-dir ' + process.env.ui_dir_name + '/build';
}
return '';
result-encoding: string
build-config-ui:
timeout-minutes: 60
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Checkout
if: needs.prepare.outputs.ui_dir_arg != ''
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Go 1.x
if: needs.prepare.outputs.ui_dir_arg != ''
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: ${{ needs.prepare.outputs.plugin_dir }}/go.mod
cache: false
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
if: needs.prepare.outputs.ui_dir_arg != ''
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-build-${{ needs.prepare.outputs.plugin_dir }}-${{ hashFiles(format('{0}/go.sum', needs.prepare.outputs.plugin_dir)) }}
restore-keys: |
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-build-${{ needs.prepare.outputs.plugin_dir }}-
- name: Setup CloudQuery
if: needs.prepare.outputs.ui_dir_arg != ''
uses: cloudquery/setup-cloudquery@4a3af61f7d8c362d8d152a4a17053ed2aaa7180d # v4
with:
version: v6.35.7
- name: Build
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
if: needs.prepare.outputs.ui_dir_arg != ''
run: go build .
- name: Use Node.js LTS
if: needs.prepare.outputs.ui_dir_arg != ''
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: "${{needs.prepare.outputs.plugin_dir}}/${{env.ui_dir_name}}/package-lock.json"
- name: Install dependencies
if: needs.prepare.outputs.ui_dir_arg != ''
run: npm ci
working-directory: "${{needs.prepare.outputs.plugin_dir}}/${{env.ui_dir_name}}"
- name: Build config UI
if: needs.prepare.outputs.ui_dir_arg != ''
env:
REACT_APP_PLUGIN_TEAM: cloudquery
REACT_APP_PLUGIN_KIND: ${{needs.prepare.outputs.plugin_kind}}
REACT_APP_PLUGIN_NAME: ${{needs.prepare.outputs.plugin_name}}
REACT_APP_PLUGIN_VERSION: ${{needs.prepare.outputs.plugin_version}}
working-directory: "${{needs.prepare.outputs.plugin_dir}}/${{env.ui_dir_name}}"
run: |
npm run build
- name: Upload build artifacts
if: needs.prepare.outputs.ui_dir_arg != ''
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
with:
name: build_dir
path: ${{ needs.prepare.outputs.ui_build_dir }}
publish-plugin-to-hub-java:
timeout-minutes: 60
runs-on: ubuntu-latest
needs:
- prepare
- build-config-ui
if: needs.prepare.outputs.plugin_releaser == 'java'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Download build artifacts
if: needs.prepare.outputs.ui_dir_arg != ''
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build_dir
path: ${{ needs.prepare.outputs.ui_build_dir }}
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: "temurin"
java-version: "20"
cache: "gradle"
cache-dependency-path: "${{ needs.prepare.outputs.plugin_dir }}/**/build.gradle"
# Needed for shell escape
- name: Use Node.js LTS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "lts/*"
- name: Install shell escape
run: |
npm install shell-escape@0.2.0
- name: Get Release Notes
id: release-notes
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
PRERELEASE: ${{ needs.prepare.outputs.prerelease }}
with:
result-encoding: string
script: |
const shellescape = require('shell-escape');
const { PRERELEASE } = process.env;
if (PRERELEASE) {
return shellescape(["This is a pre-release version of the plugin and should be used for testing purposes only"])
}
const { data } = await github.rest.repos.getReleaseByTag({
owner: "cloudquery",
repo: context.repo.repo,
tag: context.ref.replace('refs/tags/', ''),
});
return shellescape([data.body]);
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@b19bfcb2a015af55fd6e160d1d1987e887f8c163
with:
find: "(?i)version_${{ needs.prepare.outputs.plugin_kind }}_${{ needs.prepare.outputs.plugin_name_undashed }}"
replace: ${{ needs.prepare.outputs.plugin_version }}
include: ${{ needs.prepare.outputs.plugin_dir }}/docs/*.md
- # Required for the package command to work
name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
- name: Build package
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
run: ./gradlew build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.actor }}
- name: Run package command
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.actor }}
run: |
rm -rf docs/tables.md
java -jar app/build/libs/app.jar package -m ${{ steps.release-notes.outputs.result }} ${{ needs.prepare.outputs.plugin_version }} .
- name: Setup CloudQuery
uses: cloudquery/setup-cloudquery@4a3af61f7d8c362d8d152a4a17053ed2aaa7180d # v4
with:
version: v6.35.7
- name: Publish plugin to hub
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
env:
CLOUDQUERY_API_KEY: ${{ secrets.CLOUDQUERY_API_KEY }}
run: |
cloudquery plugin publish --finalize ${{ needs.prepare.outputs.ui_dir_arg }}
- name: Slack Notify
uses: ravsamhq/notify-slack-action@d0190712a54cd89d2e57a5847f06a78de127711a
if: always()
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Failed to publish to hub ${{ needs.prepare.outputs.plugin_kind }}-${{ needs.prepare.outputs.plugin_name }}@${{ needs.prepare.outputs.plugin_version }}"
footer: "<{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ALERTS_INTEGRATIONS_SLACK_WEBHOOK_URL }}
publish-plugin-to-hub-python:
timeout-minutes: 60
runs-on: ubuntu-latest
needs:
- prepare
- build-config-ui
if: needs.prepare.outputs.plugin_releaser == 'python'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Download build artifacts
if: needs.prepare.outputs.ui_dir_arg != ''
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build_dir
path: ${{ needs.prepare.outputs.ui_build_dir }}
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
- name: Install dependencies
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
run: |
pip install --upgrade pip
pip install -r requirements.txt
# Needed for shell escape
- name: Use Node.js LTS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "lts/*"
- name: Install shell escape
run: |
npm install shell-escape@0.2.0
- name: Get Release Notes
id: release-notes
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
PRERELEASE: ${{ needs.prepare.outputs.prerelease }}
with:
result-encoding: string
script: |
const shellescape = require('shell-escape');
const { PRERELEASE } = process.env;
if (PRERELEASE) {
return shellescape(["This is a pre-release version of the plugin and should be used for testing purposes only"])
}
const { data } = await github.rest.repos.getReleaseByTag({
owner: "cloudquery",
repo: context.repo.repo,
tag: context.ref.replace('refs/tags/', ''),
});
return shellescape([data.body]);
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@b19bfcb2a015af55fd6e160d1d1987e887f8c163
with:
find: "(?i)version_${{ needs.prepare.outputs.plugin_kind }}_${{ needs.prepare.outputs.plugin_name_undashed }}"
replace: ${{ needs.prepare.outputs.plugin_version }}
include: ${{ needs.prepare.outputs.plugin_dir }}/docs/*.md
- # Required for the package command to work
name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
- name: Run package command
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
run: |
rm -rf docs/tables.md
python main.py package -m ${{ steps.release-notes.outputs.result }} ${{ needs.prepare.outputs.plugin_version }} .
- name: Setup CloudQuery
uses: cloudquery/setup-cloudquery@4a3af61f7d8c362d8d152a4a17053ed2aaa7180d # v4
with:
version: v6.35.7
- name: Publish plugin to hub
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
env:
CLOUDQUERY_API_KEY: ${{ secrets.CLOUDQUERY_API_KEY }}
run: |
cloudquery plugin publish --finalize ${{ needs.prepare.outputs.ui_dir_arg }}
- name: Slack Notify
uses: ravsamhq/notify-slack-action@d0190712a54cd89d2e57a5847f06a78de127711a
if: always()
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Failed to publish to hub ${{ needs.prepare.outputs.plugin_kind }}-${{ needs.prepare.outputs.plugin_name }}@${{ needs.prepare.outputs.plugin_version }}"
footer: "<{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ALERTS_INTEGRATIONS_SLACK_WEBHOOK_URL }}
publish-plugin-to-hub-node:
timeout-minutes: 60
runs-on: ubuntu-latest
needs:
- prepare
- build-config-ui
if: needs.prepare.outputs.plugin_releaser == 'node'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Download build artifacts
if: needs.prepare.outputs.ui_dir_arg != ''
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build_dir
path: ${{ needs.prepare.outputs.ui_build_dir }}
- name: Use Node.js LTS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: "${{needs.prepare.outputs.plugin_dir}}/package-lock.json"
- name: Install dependencies
run: npm ci
working-directory: ${{needs.prepare.outputs.plugin_dir}}
- name: Install shell escape
run: |
npm install shell-escape@0.2.0
- name: Get Release Notes
id: release-notes
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
PRERELEASE: ${{ needs.prepare.outputs.prerelease }}
with:
result-encoding: string
script: |
const shellescape = require('shell-escape');
const { PRERELEASE } = process.env;
if (PRERELEASE) {
return shellescape(["This is a pre-release version of the plugin and should be used for testing purposes only"])
}
const { data } = await github.rest.repos.getReleaseByTag({
owner: "cloudquery",
repo: context.repo.repo,
tag: context.ref.replace('refs/tags/', ''),
});
return shellescape([data.body]);
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@b19bfcb2a015af55fd6e160d1d1987e887f8c163
with:
find: "(?i)version_${{ needs.prepare.outputs.plugin_kind }}_${{ needs.prepare.outputs.plugin_name_undashed }}"
replace: ${{ needs.prepare.outputs.plugin_version }}
include: ${{ needs.prepare.outputs.plugin_dir }}/docs/*.md
- # Required for the package command to work
name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
- name: Run package command
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
run: |
rm -rf docs/tables.md
npm run dev -- package -m ${{ steps.release-notes.outputs.result }} ${{ needs.prepare.outputs.plugin_version }} .
- name: Setup CloudQuery
uses: cloudquery/setup-cloudquery@4a3af61f7d8c362d8d152a4a17053ed2aaa7180d # v4
with:
version: v6.35.7
- name: Publish plugin to hub
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
env:
CLOUDQUERY_API_KEY: ${{ secrets.CLOUDQUERY_API_KEY }}
run: |
cloudquery plugin publish --finalize ${{ needs.prepare.outputs.ui_dir_arg }}
- name: Slack Notify
uses: ravsamhq/notify-slack-action@d0190712a54cd89d2e57a5847f06a78de127711a
if: always()
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Failed to publish to hub ${{ needs.prepare.outputs.plugin_kind }}-${{ needs.prepare.outputs.plugin_name }}@${{ needs.prepare.outputs.plugin_version }}"
footer: "<{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ALERTS_INTEGRATIONS_SLACK_WEBHOOK_URL }}
publish-plugin-to-hub-go:
timeout-minutes: 60
permissions:
contents: write
runs-on: ubuntu-latest
needs:
- prepare
- build-config-ui
if: needs.prepare.outputs.plugin_releaser == 'go'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Download build artifacts
if: needs.prepare.outputs.ui_dir_arg != ''
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build_dir
path: ${{ needs.prepare.outputs.ui_build_dir }}
- name: Set up Go 1.x
id: setup-go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: ${{ needs.prepare.outputs.plugin_dir }}/go.mod
cache: false
- uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-publish-plugin-to-hub-cache-plugins-${{ needs.prepare.outputs.plugin_kind }}-${{ needs.prepare.outputs.plugin_name }}-${{ hashFiles(format('{0}/{1}', needs.prepare.outputs.plugin_dir, 'go.sum')) }}
restore-keys: |
${{ runner.os }}-go-${{ steps.setup-go.outputs.go-version }}-publish-plugin-to-hub-cache-plugins-${{ needs.prepare.outputs.plugin_kind }}-${{ needs.prepare.outputs.plugin_name }}-
# Needed for shell escape
- name: Use Node.js LTS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "lts/*"
- name: Install shell escape
run: |
npm install shell-escape@0.2.0
- name: Get Release Notes
id: release-notes
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
PRERELEASE: ${{ needs.prepare.outputs.prerelease }}
with:
result-encoding: string
script: |
const shellescape = require('shell-escape');
const { PRERELEASE } = process.env;
if (PRERELEASE) {
return shellescape(["This is a pre-release version of the plugin and should be used for testing purposes only"])
}
const { data } = await github.rest.repos.getReleaseByTag({
owner: "cloudquery",
repo: context.repo.repo,
tag: context.ref.replace('refs/tags/', ''),
});
return shellescape([data.body]);
- name: Find and Replace
uses: jacobtomlinson/gha-find-replace@b19bfcb2a015af55fd6e160d1d1987e887f8c163
with:
find: "(?i)version_${{ needs.prepare.outputs.plugin_kind }}_${{ needs.prepare.outputs.plugin_name_undashed }}"
replace: ${{ needs.prepare.outputs.plugin_version }}
include: ${{ needs.prepare.outputs.plugin_dir }}/docs/*.md
- name: Run package command
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
run: |
rm -rf docs/tables.md
go run main.go package -m ${{ steps.release-notes.outputs.result }} ${{ needs.prepare.outputs.plugin_version }} .
- name: Setup CloudQuery
uses: cloudquery/setup-cloudquery@4a3af61f7d8c362d8d152a4a17053ed2aaa7180d # v4
with:
version: v6.35.7
- name: Publish plugin to hub
working-directory: ${{ needs.prepare.outputs.plugin_dir }}
env:
CLOUDQUERY_API_KEY: ${{ secrets.CLOUDQUERY_API_KEY }}
run: |
cloudquery plugin publish --finalize ${{ needs.prepare.outputs.ui_dir_arg }}
- name: Push Tag prefixed with plugin directory
if: needs.prepare.outputs.prerelease == ''
run: |
git tag ${{ needs.prepare.outputs.plugin_dir }}/${{ needs.prepare.outputs.plugin_version }} && git push origin ${{ needs.prepare.outputs.plugin_dir }}/${{ needs.prepare.outputs.plugin_version }}
- name: Slack Notify
uses: ravsamhq/notify-slack-action@d0190712a54cd89d2e57a5847f06a78de127711a
if: always()
with:
status: ${{ job.status }}
notify_when: "failure"
notification_title: "Failed to publish to hub ${{ needs.prepare.outputs.plugin_kind }}-${{ needs.prepare.outputs.plugin_name }}@${{ needs.prepare.outputs.plugin_version }}"
footer: "<{repo_url}|{repo}>"
env:
SLACK_WEBHOOK_URL: ${{ secrets.ALERTS_INTEGRATIONS_SLACK_WEBHOOK_URL }}