-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (54 loc) · 1.67 KB
/
wit.yaml
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: Publish WIT package
on:
push:
tags:
- 'wit-v*'
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
- 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@ed8c79bccf0b1cb1544a358f81684d3acaa5133f
with:
tool: [email protected]
- 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 -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 }} wit
- name: Release
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048
with:
files: ${{ steps.ctx.outputs.tarball }}
make_latest: "false"