feat(ci): add OCI publishing to WADM WIT workflow #1
Workflow file for this run
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
name: wit-wasmcloud-wadm-publish | |
on: | |
push: | |
tags: | |
- "wit-wasmcloud-wadm-v*" | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
sparse-checkout: | | |
wit | |
.github | |
- name: Extract tag context | |
id: ctx | |
run: | | |
version=${GITHUB_REF_NAME#wit-wasmcloud-wadm-v} | |
echo "version=${version}" >> "$GITHUB_OUTPUT" | |
echo "tarball=wit-wasmcloud-wadm-${version}.tar.gz" >> "$GITHUB_OUTPUT" | |
echo "version is ${version}" | |
- uses: ./.github/actions/configure-wkg | |
with: | |
oci-username: ${{ github.repository_owner }} | |
oci-password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
working-directory: wit/wadm | |
run: wkg wit build -o package.wasm | |
- name: Push version-tagged WebAssembly binary to GHCR | |
working-directory: wit/wadm | |
run: wkg publish package.wasm | |
- name: Package tarball for release | |
run: | | |
tar cvzf ${{ steps.ctx.outputs.tarball }} -C wit wadm/wit | |
- name: Release | |
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9 | |
with: | |
files: ${{ steps.ctx.outputs.tarball }} | |
make_latest: "false" |