Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add early draft #1

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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