Skip to content

Commit

Permalink
Merge pull request #1 from ricochet/feat/wip
Browse files Browse the repository at this point in the history
feat: add early draft
  • Loading branch information
ricochet authored Dec 5, 2024
2 parents 5d9e16b + e01dc0c commit cf5a42f
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 3 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
<div align="center">
<h1><code>ba-template</code></h1>
<h1><code>wkg-github-action</code></h1>
<strong>A <a href="https://bytecodealliance.org/">Bytecode Alliance</a> project</strong>
<p>
<a href="https://github.com/bytecodealliance/ba-template/actions?query=workflow%3Awrpc"><img src="https://github.com/bytecodealliance/ba-template/actions/workflows/ci.yml/badge.svg" alt="build status" /></a>
<a href="https://github.com/bytecodealliance/wkg-github-action/actions?query=workflow%3Awrpc"><img src="https://github.com/bytecodealliance/wkg-github-action/actions/workflows/ci.yml/badge.svg" alt="build status" /></a>
<a href="https://bytecodealliance.zulipchat.com/"><img src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg" alt="zulip chat" /></a>
</p>
<h3>
<a href="https://bytecodealliance.zulipchat.com">Chat</a>
</h3>
</div>

# ba-template
# wkg-github-action

Starter template for Bytecode Alliance repositories.

Under construction! This is very experimental and not yet ready for production workloads!

## TODO

- [ ] do more than wit
- [ ] wkg version
- [ ] oci-ref

## Questions?

Ask over in the Bytecode Alliance <a href="https://bytecodealliance.zulipchat.com">Zulip</a>.
Expand Down
81 changes: 81 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: 'Verify up-to-date'
description: 'Verify WASI ABI files are up-to-date'

inputs:
wkg:
description: 'version of `wkg` to use'
required: false

# parameters to wkg
# TODO we don't like this but shortcut for quick first version
oci-reference-without-tag:
description: 'ghcr.io/webassembly/wasi/wasi-io'
required: true

# registry:
# description: 'OCI registry for the package, e.g. `ghcr.io`'
# required: false
# default: 'ghcr.io'
# namespace:
# description: 'Namespace for the package, e.g. `wasi`'
# required: false
# component:
# description: 'Component name for the package, e.g. `wasi-io`'
# required: true
description:
description: 'Value for org.opencontainers.image.description'
required: false
source:
description: 'Value for org.opencontainers.image.source'
required: false
homepage:
description: 'Value for org.opencontainers.image.homepage'
required: false
version:
description: 'Value for org.opencontainers.image.version without the `v` prefix'
required: true
licenses:
description: 'Value for org.opencontainers.image.licenses'
required: false

features:
description: 'comma-separated list of features to enable'
required: false
default: ''

# cargo install wkg --force

runs:
using: composite
steps:
- name: Setup `wkg`
shell: bash
run: |
set -ex
cargo install wkg --force
# TODO check if we should build a wit package
# TODO wit-dir param

# build wit package
- name: Generate documentation for each world
shell: bash
run: wkg wit build --wit-dir ./wit

# set var for wasi package

- name: Generate documentation for each world
shell: bash
if: ${{ inputs.worlds != '*' }}
run: |
set -ex
wkg oci push ${{ inputs.oci-reference-without-tag }}:${{ inputs.version }} \
--annotation "org.opencontainers.image.description"=${{ inputs.description }} \
--annotation "org.opencontainers.image.source"=${{ inputs.source }} \
--annotation "org.opencontainers.image.url"=${{ inputs.homepage }} \
--annotation "org.opencontainers.image.version"=${{ inputs.version }} \
--annotation "org.opencontainers.image.licenses"=${{ inputs.licenses }}
- uses: actions/upload-artifact@v4
with:
path: ${{ steps.package.outputs.package }}.wasm

0 comments on commit cf5a42f

Please sign in to comment.