-
Notifications
You must be signed in to change notification settings - Fork 127
563 lines (495 loc) · 21.6 KB
/
wasmcloud.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
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
name: wasmCloud
on:
pull_request:
merge_group:
workflow_dispatch:
push:
branches:
- main
tags:
- 'actor-v[0-9].[0-9]+.[0-9]+'
- 'actor-v[0-9].[0-9]+.[0-9]+-*'
- 'control-interface-v[0-9].[0-9]+.[0-9]+'
- 'control-interface-v[0-9].[0-9]+.[0-9]+-*'
- 'core-v[0-9].[0-9]+.[0-9]+'
- 'core-v[0-9].[0-9]+.[0-9]+-*'
- 'host-sys-v[0-9].[0-9]+.[0-9]+'
- 'host-sys-v[0-9].[0-9]+.[0-9]+-*'
- 'host-v[0-9].[0-9]+.[0-9]+'
- 'host-v[0-9].[0-9]+.[0-9]+-*'
- 'opentelemetry-nats-v[0-9].[0-9]+.[0-9]+'
- 'opentelemetry-nats-v[0-9].[0-9]+.[0-9]+-*'
- 'provider-archive-v[0-9].[0-9]+.[0-9]+'
- 'provider-archive-v[0-9].[0-9]+.[0-9]+-*'
- 'provider-sdk-v[0-9].[0-9]+.[0-9]+'
- 'provider-sdk-v[0-9].[0-9]+.[0-9]+-*'
- 'provider-wit-bindgen-v[0-9].[0-9]+.[0-9]+'
- 'provider-wit-bindgen-v[0-9].[0-9]+.[0-9]+-*'
- 'runtime-v[0-9].[0-9]+.[0-9]+'
- 'runtime-v[0-9].[0-9]+.[0-9]+-*'
- 'tracing-v[0-9].[0-9]+.[0-9]+'
- 'tracing-v[0-9].[0-9]+.[0-9]+-*'
- 'v[0-9].[0-9]+.[0-9]+'
- 'v[0-9].[0-9]+.[0-9]+-*'
- 'wascap-v[0-9].[0-9]+.[0-9]+'
- 'wascap-v[0-9].[0-9]+.[0-9]+-*'
- 'wash-cli-v[0-9].[0-9]+.[0-9]+'
- 'wash-cli-v[0-9].[0-9]+.[0-9]+-*'
- 'wash-lib-v[0-9].[0-9]+.[0-9]+'
- 'wash-lib-v[0-9].[0-9]+.[0-9]+-*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-bin:
strategy:
matrix:
config:
- target: aarch64-unknown-linux-musl
test-bin: |
nix profile install --inputs-from . 'nixpkgs#qemu'
qemu-aarch64 ./result/bin/wash --version
qemu-aarch64 ./result/bin/wasmcloud --version
test-oci: docker load < ./result
# TODO: Run aarch64 binary within OCI
- target: aarch64-apple-darwin
test-bin: |
file ./result/bin/wash
file ./result/bin/wasmcloud
test-oci: docker load < ./result
- target: aarch64-linux-android
test-bin: |
file ./result/bin/wash
file ./result/bin/wasmcloud
test-oci: docker load < ./result
- target: riscv64gc-unknown-linux-gnu-fhs
test-bin: |
nix build -L '.#wasmcloud-riscv64gc-unknown-linux-gnu'
nix shell --inputs-from . 'nixpkgs#qemu' -c qemu-riscv64 ./result/bin/wasmcloud --version
- target: x86_64-apple-darwin
test-bin: |
file ./result/bin/wash
file ./result/bin/wasmcloud
test-oci: docker load < ./result
# TODO: Build for GNU once https://github.com/rust-lang/rust/issues/92212 is resolved
#- target: x86_64-pc-windows-gnu
# test-bin: |
# nix profile install --inputs-from . 'nixpkgs#wine64'
# wine64 ./result/bin/wash.exe --version
# wine64 ./result/bin/wasmcloud.exe --version
# test-oci: docker load < ./result
# # TODO: Run win64 binary within OCI
- target: x86_64-unknown-linux-musl
test-bin: |
./result/bin/wash --version
./result/bin/wasmcloud --version
test-oci: |
docker load < ./result
docker run --rm wasmcloud:$(nix eval --raw .#wasmcloud-x86_64-unknown-linux-musl-oci.imageTag) wash --version
docker run --rm wasmcloud:$(nix eval --raw .#wasmcloud-x86_64-unknown-linux-musl-oci.imageTag) wasmcloud --version
name: wasmcloud-${{ matrix.config.target }}
runs-on: ubuntu-22.04-16-cores
steps:
- uses: actions/checkout@v4.1.1
- uses: ./.github/actions/install-nix
# need to run condition inside job steps so that job will pass if all steps are skipped
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore
with:
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: ./.github/actions/build-nix
with:
package: wasmcloud-${{ matrix.config.target }}
- run: ${{ matrix.config.test-bin }}
- uses: ./.github/actions/build-nix
if: ${{ !endsWith(matrix.config.target, 'fhs') }}
with:
package: wasmcloud-${{ matrix.config.target }}-oci
- run: ${{ matrix.config.test-oci }}
if: ${{ !endsWith(matrix.config.target, 'fhs') }}
build-windows:
name: wasmcloud-x86_64-pc-windows-msvc
runs-on: windows-latest-8-cores
steps:
- uses: actions/checkout@v4.1.1
- run: cargo build --release -p wash-cli -p wasmcloud
- run: mkdir "artifact/bin"
- run: move "target/release/wasmcloud.exe" "artifact/bin/wasmcloud.exe"
- run: move "target/release/wash.exe" "artifact/bin/wash.exe"
- uses: actions/upload-artifact@v4
with:
name: wasmcloud-x86_64-pc-windows-msvc
path: artifact
build-lipo:
name: wasmcloud-universal-darwin
needs: build-bin
runs-on: macos-12
steps:
- uses: actions/download-artifact@v4
with:
name: wasmcloud-aarch64-apple-darwin
path: aarch64
- uses: actions/download-artifact@v4
with:
name: wasmcloud-x86_64-apple-darwin
path: x86_64
- run: chmod +x ./x86_64/bin/*
- run: ./x86_64/bin/wash --version
- run: ./x86_64/bin/wasmcloud --version
- run: mkdir -p ./artifact/bin
- run: lipo -create ./aarch64/bin/wash ./x86_64/bin/wash -output ./artifact/bin/wash
- run: lipo -create ./aarch64/bin/wasmcloud ./x86_64/bin/wasmcloud -output ./artifact/bin/wasmcloud
- run: chmod +x ./artifact/bin/wash
- run: ./artifact/bin/wash --version
- run: chmod +x ./artifact/bin/wasmcloud
- run: ./artifact/bin/wasmcloud --version
- uses: actions/upload-artifact@v4
with:
name: wasmcloud-universal-darwin
path: artifact
test-linux:
runs-on: ubuntu-22.04-16-cores
needs: build-bin
steps:
- uses: actions/download-artifact@v4
with:
name: wasmcloud-x86_64-unknown-linux-musl
- run: chmod +x ./bin/wash
- run: chmod +x ./bin/wasmcloud
- run: ./bin/wash --version
- run: ./bin/wasmcloud --version
test-windows:
runs-on: windows-latest-8-cores
needs: build-windows
steps:
- uses: actions/download-artifact@v4
with:
name: wasmcloud-x86_64-pc-windows-msvc
- run: .\bin\wash.exe --version
- run: .\bin\wasmcloud.exe --version
cargo:
strategy:
matrix:
check:
- audit
- fmt
- clippy
- nextest
name: cargo ${{ matrix.check }}
runs-on: ubuntu-22.04-16-cores
steps:
- uses: actions/checkout@v4.1.1
- uses: ./.github/actions/install-nix
# need to run condition inside job steps so that job will pass if all steps are skipped
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore
with:
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L .#checks.x86_64-linux.${{ matrix.check }}
build-doc:
runs-on: ubuntu-22.04-16-cores
steps:
- uses: actions/checkout@v4.1.1
- uses: ./.github/actions/install-nix
with:
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L .#checks.x86_64-linux.doc
- run: cp --no-preserve=mode -R ./result/share/doc ./doc
- run: rm -f doc/.lock
- name: Create `.nojekyll`
run: touch doc/.nojekyll
- name: Write `index.html`
run: |
cat <<EOF > doc/index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Redirecting to wasmcloud_host/index.html</title>
<meta http-equiv="refresh" content="0; URL=wasmcloud_host/index.html">
<link rel="canonical" href="https://${{ github.repository_owner }}.github.io/wasmCloud/wasmcloud_host/index.html">
EOF
- uses: actions/upload-pages-artifact@v3.0.1
with:
path: doc
deploy-doc:
runs-on: ubuntu-22.04-16-cores
needs: build-doc
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/deploy-pages@v4.0.4
id: deployment
oci:
strategy:
matrix:
include:
- bin: wasmcloud
- bin: wash
prefix: wash-cli-
runs-on: ubuntu-22.04-16-cores
permissions:
packages: write
needs:
- build-bin
- test-linux
steps:
- uses: actions/checkout@v4.1.1
- uses: ./.github/actions/install-nix
with:
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Extract tag context
id: ctx
run: |
echo "owner=${GITHUB_REPOSITORY_OWNER,,}" >> "$GITHUB_OUTPUT"
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
version=${GITHUB_REF_NAME#${{ matrix.prefix }}v}
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "version is ${version}"
if [[ $version == *"-"* ]]; then
echo "version ${version} is a pre-release"
echo "prerelease=true" >> "$GITHUB_OUTPUT"
fi
- name: Login to AzureCR
if: startswith(github.ref, format('refs/tags/{0}v', matrix.prefix)) || github.ref == 'refs/heads/main'
continue-on-error: ${{ github.repository_owner != 'wasmCloud' }}
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.AZURECR_PUSH_URL }}
username: ${{ secrets.AZURECR_PUSH_USER }}
password: ${{ secrets.AZURECR_PUSH_PASSWORD }}
- name: Login to GitHub Container Registry
if: startswith(github.ref, format('refs/tags/{0}v', matrix.prefix)) || github.ref == 'refs/heads/main'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub
if: startswith(github.ref, format('refs/tags/{0}v', matrix.prefix)) || github.ref == 'refs/heads/main'
continue-on-error: ${{ github.repository_owner != 'wasmCloud' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_PUSH_USER }}
password: ${{ secrets.DOCKERHUB_PUSH_PASSWORD }}
- name: Install `buildah`
run: nix profile install --inputs-from . 'nixpkgs#buildah'
- name: Build `${{ matrix.bin }}` image
run: nix run -L .#build-${{ matrix.bin }}-oci-debian ${{ matrix.bin }}
- name: Test `${{ matrix.bin }}` image
run: |
buildah push ${{ matrix.bin }}:amd64 docker-daemon:${{ matrix.bin }}:test
docker run --rm ${{ matrix.bin }}:test ${{ matrix.bin }} --version
- name: Push `${{ matrix.bin }}` commit rev tag
if: startswith(github.ref, format('refs/tags/{0}v', matrix.prefix)) || github.ref == 'refs/heads/main'
run: |
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://ghcr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:${{ github.sha }}
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://ghcr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:${{ steps.ctx.outputs.sha_short }}
docker run --rm ghcr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:${{ github.sha }} ${{ matrix.bin }} --version
docker run --rm ghcr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:${{ steps.ctx.outputs.sha_short }} ${{ matrix.bin }} --version
- name: Push `${{ matrix.bin }}` `canary` tag
if: github.ref == 'refs/heads/main'
continue-on-error: ${{ github.repository_owner != 'wasmCloud' }}
run: |
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:canary
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://ghcr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:canary
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://wasmcloud.azurecr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:canary
docker run --rm ${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:canary ${{ matrix.bin }} --version
docker run --rm ghcr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:canary ${{ matrix.bin }} --version
docker run --rm wasmcloud.azurecr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:canary ${{ matrix.bin }} --version
- name: Push `${{ matrix.bin }}` version tag
if: startswith(github.ref, format('refs/tags/{0}v', matrix.prefix))
continue-on-error: ${{ github.repository_owner != 'wasmCloud' }}
run: |
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:${{ steps.ctx.outputs.version }}
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://ghcr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:${{ steps.ctx.outputs.version }}
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://wasmcloud.azurecr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:${{ steps.ctx.outputs.version }}
docker run --rm ${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:${{ steps.ctx.outputs.version }} ${{ matrix.bin }} --version
docker run --rm ghcr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:${{ steps.ctx.outputs.version }} ${{ matrix.bin }} --version
docker run --rm wasmcloud.azurecr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:${{ steps.ctx.outputs.version }} ${{ matrix.bin }} --version
- name: Push `${{ matrix.bin }}` `latest` tag
if: startswith(github.ref, format('refs/tags/{0}v', matrix.prefix)) && !steps.ctx.outputs.prerelease
continue-on-error: ${{ github.repository_owner != 'wasmCloud' }}
run: |
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:latest
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://ghcr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:latest
buildah manifest push --all --format 'v2s2' ${{ matrix.bin }} docker://wasmcloud.azurecr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:latest
docker run --rm ${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:latest ${{ matrix.bin }} --version
docker run --rm ghcr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:latest ${{ matrix.bin }} --version
docker run --rm wasmcloud.azurecr.io/${{ steps.ctx.outputs.owner }}/${{ matrix.bin }}:latest ${{ matrix.bin }} --version
release:
if: startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/wash-cli-v')
needs:
- build-bin
- build-doc
- build-lipo
- cargo
- oci
- test-linux
- test-windows
runs-on: ubuntu-22.04-16-cores
permissions:
contents: write
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/download-artifact@v4
with:
path: artifacts
- run: |
for dir in ./artifacts/wasmcloud-*; do
target=${dir#./artifacts/wasmcloud-}
for bin_path in $(find ${dir}/bin -type f); do
chmod +x ${bin_path}
bin=$(basename ${bin_path})
case "$bin" in
*.exe)
bin="${bin%.exe}"
mkdir -p ./${bin}
mv ${bin_path} ./${bin}/${bin}-${target}.exe
;;
*)
mkdir -p ./${bin}
mv ${bin_path} ./${bin}/${bin}-${target%-fhs}
;;
esac
done
done
- uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
prerelease: true
generate_release_notes: true
files: ./wasmcloud/*
- uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/wash-cli-v')
with:
draft: true
prerelease: true
generate_release_notes: true
files: ./wash/*
snapcraft:
if: startsWith(github.ref, 'refs/tags/wash-cli-v')
needs: cargo
runs-on: ubuntu-22.04-16-cores
steps:
- uses: actions/checkout@v4.1.1
- uses: snapcore/action-build@v1
id: build
with:
path: ./crates/wash-cli
- uses: snapcore/action-publish@v1
continue-on-error: ${{ github.repository_owner != 'wasmCloud' }}
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge
nfpm:
if: startsWith(github.ref, 'refs/tags/wash-cli-v')
env:
REF: ${{ github.ref }}
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_API_TOKEN }}
needs:
- cargo
- build-bin
- test-linux
runs-on: ubuntu-22.04-16-cores
steps:
- uses: actions/checkout@v4.1.1
- uses: ./.github/actions/install-nix
with:
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Install NFPM
run: nix profile install -L --inputs-from . 'nixpkgs#nfpm'
- uses: actions/download-artifact@v4
with:
name: wasmcloud-aarch64-unknown-linux-musl
path: ./crates/wash-cli/aarch64
- uses: actions/download-artifact@v4
with:
name: wasmcloud-x86_64-unknown-linux-musl
path: ./crates/wash-cli/x86_64
- name: Make wash executable
working-directory: ./crates/wash-cli
run: |
chmod +x ./aarch64/bin/wash
chmod +x ./x86_64/bin/wash
- name: Build `deb` and `rpm`
working-directory: ./crates/wash-cli
run: |
export VERSION=$(echo $REF| cut -d- -f3 | tr -d "v")
nfpm pkg --packager deb -f build/nfpm.amd64.yaml
nfpm pkg --packager deb -f build/nfpm.arm64.yaml
nfpm pkg --packager rpm -f build/nfpm.amd64.yaml
nfpm pkg --packager rpm -f build/nfpm.arm64.yaml
- name: Push `deb`
working-directory: ./crates/wash-cli
run: |
debs=(35 203 206 207 210 215 219 220 221 233 235 237 261 266)
for distro_version in "${debs[@]}"; do
curl -F "package[distro_version_id]=${distro_version}" -F "package[package_file]=@$(ls wash_*_amd64.deb)" https://$PACKAGECLOUD_TOKEN:@packagecloud.io/api/v1/repos/wasmcloud/core/packages.json;
curl -F "package[distro_version_id]=${distro_version}" -F "package[package_file]=@$(ls wash_*_arm64.deb)" https://$PACKAGECLOUD_TOKEN:@packagecloud.io/api/v1/repos/wasmcloud/core/packages.json;
done
- name: Push `rpm`
working-directory: ./crates/wash-cli
run: |
rpms=(194 204 209 216 226 231 236 239 240 244 260 273)
for distro_version in "${rpms[@]}"; do
curl -F "package[distro_version_id]=${distro_version}" -F "package[package_file]=@$(ls wash-*.aarch64.rpm)" https://$PACKAGECLOUD_TOKEN:@packagecloud.io/api/v1/repos/wasmcloud/core/packages.json;
curl -F "package[distro_version_id]=${distro_version}" -F "package[package_file]=@$(ls wash-*.x86_64.rpm)" https://$PACKAGECLOUD_TOKEN:@packagecloud.io/api/v1/repos/wasmcloud/core/packages.json;
done
crates:
strategy:
matrix:
include:
- crate: actor
workspace-dependencies: true
- crate: control-interface
- crate: core
workspace-dependencies: true
- crate: host
workspace-dependencies: true
- crate: host-sys
workspace-dependencies: true
- crate: opentelemetry-nats
- crate: provider-archive
workspace-dependencies: true
- crate: provider-sdk
workspace-dependencies: true
- crate: provider-wit-bindgen
workspace-dependencies: true
- crate: runtime
workspace-dependencies: true
- crate: tracing
workspace-dependencies: true
- crate: wascap
- crate: wash-cli
workspace-dependencies: true
- crate: wash-lib
workspace-dependencies: true
name: publish ${{ matrix.crate }} to crates.io
needs: cargo
runs-on: ubuntu-22.04-16-cores
steps:
- uses: actions/checkout@v4.1.1
- name: Extract tag context
id: ctx
run: |
version=${GITHUB_REF_NAME#${{ matrix.crate }}-v}
echo "version is ${version}"
if [[ $version == *"-"* ]]; then
echo "version ${version} is a pre-release"
echo "prerelease=true" >> "$GITHUB_OUTPUT"
fi
- name: dry-run publish ${{ matrix.crate }} to crates.io
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
continue-on-error: ${{ matrix.workspace-dependencies }} # publish may fail due to workspace crates not being published yet
run: cargo publish --dry-run
working-directory: ./crates/${{ matrix.crate }}
- name: publish ${{ matrix.crate }} to crates.io
if: startsWith(github.ref, format('refs/tags/{0}-v', matrix.crate)) && !steps.ctx.outputs.prerelease
continue-on-error: ${{ github.repository_owner != 'wasmCloud' }}
run: cargo publish --token ${{ secrets.CRATES_PUBLISH_TOKEN }}
working-directory: ./crates/${{ matrix.crate }}