-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b82afcb
commit 535ef15
Showing
1 changed file
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
name: Publish a Wasm Component package to GitHub Artifacts | ||
|
||
# Run this action whenever a new release is tagged | ||
on: | ||
push: | ||
tags: | ||
|
@@ -14,26 +15,43 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the repo and install dependencies | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Docker meta | ||
- name: Install cargo-binstall | ||
uses: cargo-bins/[email protected] | ||
- name: Install wkg | ||
shell: bash | ||
run: cargo binstall wkg | ||
|
||
# To version our image we want to obtain the version from the tag | ||
- name: Get version | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/WebAssembly/wasi/io | ||
tags: | | ||
type=semver,pattern={{version}} | ||
- name: Login to GitHub Container Registry | ||
# To upload our image to the GitHub registry, we first have to login | ||
- name: Login to the GitHub registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Build our `.wit` files into a Wasm binary | ||
- name: Build | ||
shell: bash | ||
run: wkg wit build -o wasi-io.wasm | ||
|
||
- uses: bytecodealliance/wkg-github-action@v1 | ||
# Upload the Wasm binary to the GitHub registry | ||
- uses: bytecodealliance/wkg-github-action@v2 | ||
with: | ||
description: 'A WASI API providing I/O stream abstractions.' | ||
oci-reference-without-tag: 'ghcr.io/WebAssembly/wasi/io' | ||
file: 'wasi-io.wasm' | ||
description: 'A WASI API providing I/O stream abstractions.' | ||
source: 'https://github.com/webassembly/wasi' | ||
homepage: 'https://wasi.dev' | ||
version: ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} | ||
|