-
Notifications
You must be signed in to change notification settings - Fork 10
58 lines (54 loc) · 1.81 KB
/
component-wit.yaml
File metadata and controls
58 lines (54 loc) · 1.81 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
name: Component / WIT
on:
push:
tags:
- 'component-wit-v*'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # for softprops/action-gh-release
packages: write # for publishing the wit to ghcr.io
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Extract tag context
id: ctx
run: |
version=${GITHUB_REF_NAME#wit-v}
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "tarball=wit-${version}.tar.gz" >> "$GITHUB_OUTPUT"
echo "version is ${version}"
- uses: taiki-e/install-action@06203676c62f0d3c765be3f2fcfbebbcb02d09f5 # v2.69.6
with:
tool: wash@0.37.0
- name: Generate and set config
shell: bash
env:
OCI_USERNAME: ${{ github.repository_owner }}
OCI_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: |
cat << EOF > package_config.toml
[namespace_registries]
wasmcloud = "wasmcloud.com"
wrpc = "bytecodealliance.org"
wasi = "wasi.dev"
[registry."wasmcloud.com".oci]
auth = { username = "${OCI_USERNAME,,}", password = "${OCI_PASSWORD}" }
EOF
echo "WASH_PACKAGE_CONFIG_FILE=$(realpath package_config.toml)" >> $GITHUB_ENV
- name: Build
run: |
wash wit build --wit-dir ./component/wit -f package.wasm
- name: Push version-tagged WebAssembly binary to GHCR
run: |
wash wit publish package.wasm
- name: Package tarball for release
run: |
tar -cvzf ${{ steps.ctx.outputs.tarball }} -C ./component wit
- name: Release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
files: ${{ steps.ctx.outputs.tarball }}
make_latest: "false"