Skip to content

Commit 535ef15

Browse files
authored
Update publish.yml (#92)
1 parent b82afcb commit 535ef15

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Publish a Wasm Component package to GitHub Artifacts
22

3+
# Run this action whenever a new release is tagged
34
on:
45
push:
56
tags:
@@ -14,26 +15,43 @@ jobs:
1415
runs-on: ubuntu-latest
1516

1617
steps:
18+
# Checkout the repo and install dependencies
1719
- name: Checkout repository
1820
uses: actions/checkout@v2
19-
- name: Docker meta
21+
- name: Install cargo-binstall
22+
uses: cargo-bins/[email protected]
23+
- name: Install wkg
24+
shell: bash
25+
run: cargo binstall wkg
26+
27+
# To version our image we want to obtain the version from the tag
28+
- name: Get version
2029
id: meta
2130
uses: docker/metadata-action@v5
2231
with:
2332
images: ghcr.io/WebAssembly/wasi/io
2433
tags: |
2534
type=semver,pattern={{version}}
26-
- name: Login to GitHub Container Registry
35+
36+
# To upload our image to the GitHub registry, we first have to login
37+
- name: Login to the GitHub registry
2738
uses: docker/login-action@v3
2839
with:
2940
registry: ghcr.io
3041
username: ${{ github.actor }}
3142
password: ${{ secrets.GITHUB_TOKEN }}
43+
44+
# Build our `.wit` files into a Wasm binary
45+
- name: Build
46+
shell: bash
47+
run: wkg wit build -o wasi-io.wasm
3248

33-
- uses: bytecodealliance/wkg-github-action@v1
49+
# Upload the Wasm binary to the GitHub registry
50+
- uses: bytecodealliance/wkg-github-action@v2
3451
with:
35-
description: 'A WASI API providing I/O stream abstractions.'
3652
oci-reference-without-tag: 'ghcr.io/WebAssembly/wasi/io'
53+
file: 'wasi-io.wasm'
54+
description: 'A WASI API providing I/O stream abstractions.'
3755
source: 'https://github.com/webassembly/wasi'
3856
homepage: 'https://wasi.dev'
3957
version: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}

0 commit comments

Comments
 (0)