Skip to content
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
17 changes: 12 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,36 @@ 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:
registry: ghcr.io
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
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}" \
Expand All @@ -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::"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package componentized:http@0.0.0-0;
package componentized:http@0.1.0-dev;

interface client {
enum method {
Expand Down
2 changes: 1 addition & 1 deletion components/wit/worlds.wit
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion wit/http.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package componentized:http@0.0.0-0;
package componentized:http@0.1.0-dev;

interface client {
enum method {
Expand Down