From d1f086aa3f350d83e23dba75582573849d15fdde Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Fri, 4 Sep 2026 15:59:05 -0400 Subject: [PATCH 1/2] Publish wit interface to ghcr.io/componentized/http It is not longer published to ghcr.io/componentized/http/interface. This better aligns with where wkg expects to resolve interfaces. Signed-off-by: Scott Andrews --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b59288b..150ffbd 100644 --- a/Makefile +++ b/Makefile @@ -69,8 +69,9 @@ endif @$(eval DESCRIPTION := $(shell head -n 3 "lib/${FILE}.md" | tail -n 1)) @$(eval REVISION := $(shell git rev-parse HEAD)$(shell git diff --quiet HEAD && echo "+dirty")) @$(eval TAG := $(patsubst v%,%,$(subst +,_,$(VERSION)))) + @$(eval IMAGE := $(if $(filter interface.wasm,$(FILE)),${REPOSITORY}:${TAG},${REPOSITORY}/${COMPONENT}:${TAG})) - @echo "::group::${FILE} -> ${REPOSITORY}/${COMPONENT}:${TAG}" + @echo "::group::${FILE} -> ${IMAGE}" @DIGEST=$$( \ wkg oci push \ --annotation "org.opencontainers.image.title=${COMPONENT}" \ @@ -79,11 +80,11 @@ endif --annotation "org.opencontainers.image.source=https://github.com/${GITHUB_REPOSITORY}.git" \ --annotation "org.opencontainers.image.revision=${REVISION}" \ --annotation "org.opencontainers.image.licenses=Apache-2.0" \ - "${REPOSITORY}/${COMPONENT}:${TAG}" \ + "${IMAGE}" \ "lib/${FILE}" \ 2>&1 \ | tee /dev/stderr \ | grep -o 'sha256:[a-f0-9]\{64\}' \ ) ; \ - cosign sign --yes "${REPOSITORY}/${COMPONENT}:${TAG}@$${DIGEST}" + cosign sign --yes "${IMAGE}@$${DIGEST}" @echo "::endgroup::" From 0dfaa9c3d04a7e308c38681cc3f35d4480466a3c Mon Sep 17 00:00:00 2001 From: Scott Andrews Date: Fri, 4 Sep 2026 18:54:09 -0400 Subject: [PATCH 2/2] Use interface version for pre-release publishing Previously, commits to main were published as 'dev'. Now they are published using the version number on the interface, so long as that version is a pre-release version. That it, it contains a '-'. Tags continue to be published based on the name of the tag. This also changes the current version from `0.0.0-0` to `0.1.0-dev`. Signed-off-by: Scott Andrews --- .github/workflows/ci.yaml | 17 ++++++++++++----- .../package.wit | 2 +- components/wit/worlds.wit | 2 +- wit/http.wit | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) rename components/wit/deps/{componentized-http-0.0.0-0 => componentized-http-0.1.0-dev}/package.wit (98%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d39302a..e0d1cb6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -65,18 +65,23 @@ jobs: uses: cargo-bins/cargo-binstall@main - name: Install wkg run: cargo binstall --force wkg + - name: Install wasm-tools + run: cargo binstall --force wasm-tools - name: Install cosign uses: sigstore/cosign-installer@v4.1.2 - - name: Get tag version - if: startsWith(github.ref, 'refs/tags/') - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - name: Download components.tar uses: actions/download-artifact@v8 with: name: components.tar - name: Extract components run: tar -xvf components.tar -C lib + - name: Get interface version + id: interface_version + run: echo ::set-output name=VERSION::$( wasm-tools component wit lib/interface.wasm --json | jq -r '.packages[0].name' | cut -d'@' -f2 )} + - name: Get tag version + if: startsWith(github.ref, 'refs/tags/') + id: tag_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - name: Login to GitHub Container Registry uses: docker/login-action@v4 with: @@ -84,10 +89,12 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Publish components to gchr.io + # only publish tags and pre-releases from main + if: startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && contains(steps.interface_version.outputs.VERSION, '-')) run: make publish env: REPOSITORY: "ghcr.io/${{ github.repository }}" - VERSION: "${{ case(github.ref == 'refs/heads/main', 'dev', steps.get_version.outputs.VERSION) }}" + VERSION: "${{ case(github.ref == 'refs/heads/main', steps.interface_version.outputs.VERSION, steps.tag_version.outputs.VERSION) }}" - name: Draft GitHub Release if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v3 diff --git a/components/wit/deps/componentized-http-0.0.0-0/package.wit b/components/wit/deps/componentized-http-0.1.0-dev/package.wit similarity index 98% rename from components/wit/deps/componentized-http-0.0.0-0/package.wit rename to components/wit/deps/componentized-http-0.1.0-dev/package.wit index 3cbee81..38d3bb1 100644 --- a/components/wit/deps/componentized-http-0.0.0-0/package.wit +++ b/components/wit/deps/componentized-http-0.1.0-dev/package.wit @@ -1,4 +1,4 @@ -package componentized:http@0.0.0-0; +package componentized:http@0.1.0-dev; interface client { enum method { diff --git a/components/wit/worlds.wit b/components/wit/worlds.wit index 2130a11..2f2b2f9 100644 --- a/components/wit/worlds.wit +++ b/components/wit/worlds.wit @@ -2,5 +2,5 @@ package componentized:components; world http-client { import wasi:http/client@0.3.1; - export componentized:http/client@0.0.0-0; + export componentized:http/client@0.1.0-dev; } diff --git a/wit/http.wit b/wit/http.wit index 0986c1c..5dfbcb6 100644 --- a/wit/http.wit +++ b/wit/http.wit @@ -1,4 +1,4 @@ -package componentized:http@0.0.0-0; +package componentized:http@0.1.0-dev; interface client { enum method {