-
Notifications
You must be signed in to change notification settings - Fork 0
578 lines (506 loc) · 21.6 KB
/
binaries.yml
File metadata and controls
578 lines (506 loc) · 21.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
name: cli
on:
workflow_dispatch:
pull_request:
push:
branches:
- 'main'
tags:
- 'gateway-*'
- 'grafbase-*'
permissions:
# Allow checks read
checks: write
# Allow repo checkout
contents: write
# Allow PRs write
pull-requests: write
# Allow issues write
issues: write
env:
GRAFBASE_SKIP_ASSET_VERSION_CHECK: 'true'
CARGO_TERM_COLOR: 'always'
CARGO_PROFILE_DEV_DEBUG: 0
CARGO_PROFILE_TEST_DEBUG: 0
DO_NOT_TRACK: 1
GRAFBASE_RUDDERSTACK_WRITE_KEY: ${{ secrets.GRAFBASE_RUDDERSTACK_WRITE_KEY }}
GRAFBASE_RUDDERSTACK_DATAPLANE_URL: ${{ secrets.GRAFBASE_RUDDERSTACK_DATAPLANE_URL }}
CLI_RELEASE_CLOUDFLARE_R2_ENDPOINT_URL: https://d267a8ab95268b272f5147e8939c9d38.r2.cloudflarestorage.com
CLI_RELEASE_CLOUDFLARE_R2_PUBLIC_URL: https://pub-b0013effd6614b32a4fb9bf338b90658.r2.dev
CLI_RELEASE_CLOUDFLARE_R2_BUCKET_NAME: cli-releases
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
detect-change-type:
runs-on: ubicloud-standard-2
outputs:
build: ${{ steps.filter.outputs.build }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Path filter check
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
build:
- Dockerfile
- 'gateway/**/*'
- 'cli/**/*'
- 'engine/**/*'
- '.github/workflows/gateway.yml'
- '.github/actions/**/*'
- '!**/*.md'
lint:
name: 'Lint'
needs: [detect-change-type]
if: ${{ needs.detect-change-type.outputs.build == 'true' || startsWith(github.ref, 'refs/tags/') }}
runs-on: ubicloud-standard-8
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Rust job init
uses: ./.github/actions/init_rust_job
with:
platform: linux
cache-key: ${{ runner.os }}-${{ runner.arch }}-cargo-dev-${{ hashFiles('Cargo.lock') }}
restore-key: ${{ runner.os }}-${{ runner.arch }}-cargo-dev
- name: Prepare Grafbase assets
uses: ./.github/actions/cli_assets
- name: Lint
uses: ./.github/actions/lint
test:
name: 'Test'
needs: [lint]
if: ${{ needs.detect-change-type.outputs.build == 'true' || startsWith(github.ref, 'refs/tags/') }}
runs-on: ubicloud-standard-8
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Rust job init
uses: ./.github/actions/init_rust_job
with:
platform: linux
cache-key: ${{ runner.os }}-${{ runner.arch }}-cargo-dev-${{ hashFiles('Cargo.lock') }}
restore-key: ${{ runner.os }}-${{ runner.arch }}-cargo-dev
- name: Prepare Grafbase assets
uses: ./.github/actions/cli_assets
- name: Test
uses: ./.github/actions/test
with:
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
datadog-api-key: ${{ secrets.DATADOG_API_KEY }}
individual-builds:
needs: [detect-change-type]
if: ${{ needs.detect-change-type.outputs.build == 'true' || startsWith(github.ref, 'refs/tags/') }}
strategy:
fail-fast: false
matrix:
package:
[
grafbase-local-common,
grafbase-local-server,
grafbase-local-backend,
grafbase,
grafbase-gateway,
federated-server
]
runs-on: ubicloud-standard-8
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Rust job init
uses: ./.github/actions/init_rust_job
with:
platform: linux
cache-key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ matrix.package }}-${{ hashFiles('Cargo.lock') }}
restore-key: ${{ runner.os }}-${{ runner.arch }}-cargo-build
- name: Build assets
if: ${{ matrix.package != 'grafbase-gateway' }}
uses: ./.github/actions/cli_assets
- name: Individual package build
shell: bash
run: |
set -euo pipefail
# The actual features used for each dependency depends on what is being built simultaneously.
# However, each package is published individually, so we're checking that all packages compile
# with only their defined features.
# See: https://github.com/rust-lang/cargo/issues/4463
cargo check --all-features --package ${{ matrix.package }}
- name: Individual package without lambda
if: ${{ matrix.package == 'grafbase-gateway' }}
shell: bash
run: |
set -euo pipefail
cargo check --package ${{ matrix.package }}
docker-grafbase:
needs: [test]
if: ${{ needs.detect-change-type.outputs.build == 'true' || startsWith(github.ref, 'refs/tags/') }}
runs-on: ubicloud-standard-8
permissions:
packages: write
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker images
run: |
# Re-use the latest layers if possible
docker pull ghcr.io/grafbase/grafbase:latest || true
docker build -f cli/Dockerfile -t ghcr.io/grafbase/grafbase:$COMMIT_SHA .
- name: Rust job init
uses: ./.github/actions/init_rust_job
with:
platform: linux
cache-key: ${{ runner.os }}-${{ runner.arch }}-cargo-dev-${{ hashFiles('Cargo.lock') }}
restore-key: ${{ runner.os }}-${{ runner.arch }}-cargo-dev
- name: Docker tests
run: |
GRAFBASE_DOCKER_IMAGE="ghcr.io/grafbase/grafbase:$COMMIT_SHA" RUST_BACKTRACE=1 cargo nextest run -p grafbase-docker-tests
- name: Tag latest version
if: ${{ github.ref == 'refs/heads/main' }}
run: |
docker tag ghcr.io/grafbase/grafbase:$COMMIT_SHA ghcr.io/grafbase/grafbase:latest
- name: Tag released grafbase version
if: ${{ startsWith(github.ref, 'refs/tags') && startsWith(github.ref_name, 'grafbase-') }}
run: |
docker tag ghcr.io/grafbase/grafbase:$COMMIT_SHA ghcr.io/grafbase/grafbase:$(echo "$REF" | sed -e "s/^refs\/tags\/grafbase-//")
env:
REF: ${{ github.ref }}
- name: Push docker image
run: |
docker push --all-tags ghcr.io/grafbase/grafbase
docker-gateway:
needs: [test]
if: ${{ needs.detect-change-type.outputs.build == 'true' || startsWith(github.ref, 'refs/tags/') }}
runs-on: ubicloud-standard-8
permissions:
packages: write
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker images
run: |
# Re-use the latest layers if possible
docker pull ghcr.io/grafbase/gateway:latest || true
docker build -t ghcr.io/grafbase/gateway:$COMMIT_SHA .
- name: Tag latest version
if: ${{ github.ref == 'refs/heads/main' }}
run: |
docker tag ghcr.io/grafbase/gateway:$COMMIT_SHA ghcr.io/grafbase/gateway:latest
- name: Tag released gateway version
if: ${{ startsWith(github.ref, 'refs/tags') && startsWith(github.ref_name, 'gateway-') }}
run: |
docker tag ghcr.io/grafbase/gateway:$COMMIT_SHA ghcr.io/grafbase/gateway:$(echo "$REF" | sed -e "s/^refs\/tags\/gateway-//")
env:
REF: ${{ github.ref }}
- name: Push docker image
run: |
docker push --all-tags ghcr.io/grafbase/gateway
linux:
needs: [test]
strategy:
fail-fast: false
matrix:
archs:
[
{
runner: ubicloud-standard-8,
target: x86_64-unknown-linux-musl,
platform: linux
},
{
runner: ubicloud-standard-8-arm,
target: aarch64-unknown-linux-musl,
platform: linux-arm
}
]
runs-on: ${{ matrix.archs.runner }}
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Rust job init
uses: ./.github/actions/init_rust_job
with:
platform: ${{ matrix.archs.platform }}
cache-key: ${{ runner.os }}-${{ runner.arch }}-cargo-release-${{ hashFiles('Cargo.lock') }}
restore-key: ${{ runner.os }}-${{ runner.arch }}-cargo-release
- name: Prepare Grafbase assets
uses: ./.github/actions/cli_assets
- name: Install musl
run: |
sudo apt update
sudo apt install musl
- name: Build grafbase release
run: |
cd cli
cargo build --release -p grafbase --target ${{ matrix.archs.target }} --timings
- name: Build gateway release
run: |
cargo build --release -p grafbase-gateway --target ${{ matrix.archs.target }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.archs.platform }}-release-timings.html
path: target/cargo-timings/cargo-timing.html
- if: ${{ github.event_name == 'pull_request' && matrix.archs.runner != 'ubicloud-standard-8-arm' }}
name: Upload the binaries of the change to R2
run: |
aws s3api put-object \
--endpoint-url $CLI_RELEASE_CLOUDFLARE_R2_ENDPOINT_URL \
--bucket $CLI_RELEASE_CLOUDFLARE_R2_BUCKET_NAME \
--key ${GITHUB_SHA}/${{ matrix.archs.target }}/grafbase \
--body target/${{ matrix.archs.target }}/release/grafbase
aws s3api put-object \
--endpoint-url $CLI_RELEASE_CLOUDFLARE_R2_ENDPOINT_URL \
--bucket $CLI_RELEASE_CLOUDFLARE_R2_BUCKET_NAME \
--key ${GITHUB_SHA}/${{ matrix.archs.target }}/grafbase-gateway \
--body target/${{ matrix.archs.target }}/release/grafbase-gateway
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_RELEASES_BUCKET_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_RELEASES_BUCKET_SECRET_ACCESS_KEY }}
- name: Parse version tag for grafbase
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'grafbase-')
run: |
VERSION_BUMP="${{ github.ref_name }}"
VERSION_BUMP=${VERSION_BUMP//grafbase-} # remove the grafbase prefix from the tag
echo VERSION_BUMP=${VERSION_BUMP} >> $GITHUB_ENV
- name: Parse version tag for gateway
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'gateway-')
run: |
VERSION_BUMP="${{ github.ref_name }}"
VERSION_BUMP=${VERSION_BUMP//gateway-} # remove the gateway prefix from the tag
echo VERSION_BUMP=${VERSION_BUMP} >> $GITHUB_ENV
- if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'grafbase-')
name: Upload grafbase binaries
uses: actions/upload-artifact@v4
with:
name: ${{ env.VERSION_BUMP }}-${{ matrix.archs.platform }}
path: |
target/${{ matrix.archs.target }}/release/grafbase
- if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'gateway-')
name: Upload gateway binaries
uses: actions/upload-artifact@v4
with:
name: gateway-${{ env.VERSION_BUMP }}-${{ matrix.archs.platform }}
path: |
target/${{ matrix.archs.target }}/release/grafbase-gateway
- name: Build gateway lambda release
shell: bash
run: |
BUILD_PROFILE=release
if [[ $GITHUB_REF =~ ^refs/tags/gateway- ]]; then
BUILD_PROFILE=lambda
fi
echo "Building lambda with $BUILD_PROFILE profile"
cargo build --profile $BUILD_PROFILE -p grafbase-gateway --target ${{ matrix.archs.target }} --features lambda
- if: ${{ github.event_name == 'pull_request' && matrix.archs.runner != 'ubicloud-standard-8-arm' }}
name: Upload lambda gateway binary to R2
run: |
BUILD_PROFILE=release
if [[ $GITHUB_REF =~ ^refs/tags/gateway- ]]; then
BUILD_PROFILE=lambda
fi
aws s3api put-object \
--endpoint-url $CLI_RELEASE_CLOUDFLARE_R2_ENDPOINT_URL \
--bucket $CLI_RELEASE_CLOUDFLARE_R2_BUCKET_NAME \
--key ${GITHUB_SHA}/${{ matrix.archs.target }}/grafbase-gateway-lambda \
--body target/${{ matrix.archs.target }}/$BUILD_PROFILE/grafbase-gateway
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_RELEASES_BUCKET_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_RELEASES_BUCKET_SECRET_ACCESS_KEY }}
- if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'gateway-')
name: Upload gateway lambda binary
uses: actions/upload-artifact@v4
with:
name: gateway-lambda-${{ env.VERSION_BUMP }}-${{ matrix.archs.platform }}
path: |
target/${{ matrix.archs.target }}/lambda/grafbase-gateway
windows:
needs: [test]
runs-on: windows-latest-8-cores
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Rust job init
uses: ./.github/actions/init_rust_job
with:
platform: windows
cache-key: ${{ runner.os }}-${{ runner.arch }}-x86_64-pc-windows-msvc-cargo-release-${{ hashFiles('Cargo.lock') }}
restore-key: ${{ runner.os }}-${{ runner.arch }}-cargo-release
- name: Prepare Grafbase assets
uses: ./.github/actions/cli_assets
- if: ${{ !startsWith(github.ref, 'refs/tags/') }}
name: Test
uses: ./.github/actions/test
with:
with-integration-tests: 'false'
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
datadog-api-key: ${{ secrets.DATADOG_API_KEY }}
- name: Build grafbase release
shell: bash
run: |
cd cli
cargo build --release -p grafbase --target x86_64-pc-windows-msvc --timings
- uses: actions/upload-artifact@v4
with:
name: windows-release-timings.html
path: target/cargo-timings/cargo-timing.html
- name: Parse version tag for grafbase
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'grafbase-')
shell: bash
run: |
VERSION_BUMP="${{ github.ref_name }}"
VERSION_BUMP=${VERSION_BUMP//grafbase-} # remove the grafbase prefix from the tag
echo VERSION_BUMP=${VERSION_BUMP} >> $GITHUB_ENV
- if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'grafbase-')
name: Upload grafbase x86_64-pc-windows-msvc binary
uses: actions/upload-artifact@v4
with:
name: ${{ env.VERSION_BUMP }}-x86_64-pc-windows-msvc
path: target/x86_64-pc-windows-msvc/release/grafbase.exe
darwin:
needs: [test]
runs-on: macos-latest-xlarge
strategy:
fail-fast: false
matrix:
target: [aarch64-apple-darwin, x86_64-apple-darwin]
steps:
- name: Get sources
uses: actions/checkout@v4
- name: Rust job init
uses: ./.github/actions/init_rust_job
with:
platform: macos
cache-key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.target }}-cargo-release-${{ hashFiles('Cargo.lock') }}
restore-key: ${{ runner.os }}-${{ runner.arch }}-cargo-release
- name: Prepare Grafbase assets
uses: ./.github/actions/cli_assets
- if: ${{ !startsWith(github.ref, 'refs/tags/') && matrix.target == 'x86_64-apple-darwin' }}
name: Test
uses: ./.github/actions/test
with:
with-integration-tests: 'false'
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
datadog-api-key: ${{ secrets.DATADOG_API_KEY }}
- name: Build grafbase ${{ matrix.target }} release
run: |
cargo build --release -p grafbase --target ${{ matrix.target }} --timings
- name: Build gateway ${{ matrix.target }} release
run: |
cargo build --release -p grafbase-gateway --target ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-release-timings.html
path: target/cargo-timings/cargo-timing.html
- name: Parse version tag for grafbase
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'grafbase-')
run: |
VERSION_BUMP="${{ github.ref_name }}"
VERSION_BUMP=${VERSION_BUMP//grafbase-} # remove the grafbase prefix from the tag
echo VERSION_BUMP=${VERSION_BUMP} >> $GITHUB_ENV
- name: Parse version tag for gateway
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'gateway-')
run: |
VERSION_BUMP="${{ github.ref_name }}"
VERSION_BUMP=${VERSION_BUMP//gateway-} # remove the gateway prefix from the tag
echo VERSION_BUMP=${VERSION_BUMP} >> $GITHUB_ENV
- if: ${{ github.event_name == 'pull_request' && matrix.archs.runner != 'ubicloud-standard-8-arm' }}
name: Upload the binaries of the change to R2
run: |
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /
aws s3api put-object \
--endpoint-url $CLI_RELEASE_CLOUDFLARE_R2_ENDPOINT_URL \
--bucket $CLI_RELEASE_CLOUDFLARE_R2_BUCKET_NAME \
--key ${GITHUB_SHA}/${{ matrix.target }}/grafbase \
--body target/${{ matrix.target }}/release/grafbase
aws s3api put-object \
--endpoint-url $CLI_RELEASE_CLOUDFLARE_R2_ENDPOINT_URL \
--bucket $CLI_RELEASE_CLOUDFLARE_R2_BUCKET_NAME \
--key ${GITHUB_SHA}/${{ matrix.target }}/grafbase-gateway \
--body target/${{ matrix.target }}/release/grafbase-gateway
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_RELEASES_BUCKET_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_RELEASES_BUCKET_SECRET_ACCESS_KEY }}
- if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'grafbase-')
name: Upload grafbase ${{ matrix.target }} binary
uses: actions/upload-artifact@v4
with:
name: ${{ env.VERSION_BUMP }}-${{ matrix.target }}
path: target/${{ matrix.target }}/release/grafbase
- if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'gateway-')
name: Upload gateway ${{ matrix.target }} binary
uses: actions/upload-artifact@v4
with:
name: gateway-${{ env.VERSION_BUMP }}-${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/grafbase-gateway
release-grafbase:
needs: [windows, linux, darwin]
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'grafbase-')
uses: ./.github/workflows/grafbase-partial-release.yml
with:
draft: false
tag: ${{ github.ref_name }}
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') || contains(github.ref, 'rc') }}
secrets:
CRATES_ACCESS_TOKEN: ${{ secrets.CRATES_ACCESS_TOKEN }}
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
CLOUDFLARE_ASSETS_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ASSETS_ACCOUNT_ID }}
CLOUDFLARE_ASSETS_R2_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ASSETS_R2_ACCESS_KEY_ID }}
CLOUDFLARE_ASSETS_R2_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_ASSETS_R2_SECRET_ACCESS_KEY }}
release-gateway:
needs: [windows, linux, darwin]
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'gateway-')
uses: ./.github/workflows/gateway-partial-release.yml
with:
draft: false
tag: ${{ github.ref_name }}
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') || contains(github.ref, 'rc') }}
secrets:
CRATES_ACCESS_TOKEN: ${{ secrets.CRATES_ACCESS_TOKEN }}
NPM_ACCESS_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
CLOUDFLARE_ASSETS_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ASSETS_ACCOUNT_ID }}
CLOUDFLARE_ASSETS_R2_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ASSETS_R2_ACCESS_KEY_ID }}
CLOUDFLARE_ASSETS_R2_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_ASSETS_R2_SECRET_ACCESS_KEY }}
after-build:
# This job is responsible for reacting to build success or failure. It must
# happen after the builds, hence the `needs`. But it must not be skipped
# when the builds are cancelled or fail (hence the `if: ${{ always() }}`).
needs: [linux, darwin]
runs-on: ubicloud-standard-2
if: ${{ always() }}
steps:
- name: Check that the builds succeeded
run: exit 1
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
- name: Report release failures
if: ${{ failure() && startsWith(github.ref, 'refs/tags/') && startsWith(github.ref_name, 'grafbase-') }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notification_title: '({workflow}) grafbase release failed'
message_format: 'Check the link below to see what failed.'
footer: '<{run_url}|View Run>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}