Skip to content

Commit

Permalink
build wasm go plugin test
Browse files Browse the repository at this point in the history
  • Loading branch information
cr7258 committed Jun 26, 2024
1 parent c67358e commit 2546963
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/build-and-push-wasm-go-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,26 @@ jobs:
fi
for plugin in ${PLUGIN_DIRS[@]}; do
echo "Building and pushing wasm go plugin: ${plugin}"
IMAGE="${{ env.IMAGE_REGISTRY_SERVICE }}/${{ env.IMAGE_REPOSITORY }}/wasm-go-${plugin}:${PLUGIN_VERSION}"
PLUGIN_DIR="./extensions/${plugin}"
max_retries=3
retries=0
while [ ${retries} -lt ${MAX_RETRIES} ]; do
echo "Build and push wasm go plugin: ${plugin}"
IMAGE="${{ env.IMAGE_REGISTRY_SERVICE }}/${{ env.IMAGE_REPOSITORY }}/wasm-go-${plugin}:${PLUGIN_VERSION}"
PLUGIN_DIR="./extensions/${plugin}"
GOPROXY="https://proxy.golang.org,direct" PLUGIN_NAME="${plugin}" make build
if [ $? -eq 0 ]; then
tar czvf ${PLUGIN_DIR}/plugin.tar.gz ${PLUGIN_DIR}/plugin.wasm
oras push $IMAGE ${PLUGIN_DIR}/plugin.tar.gz:application/vnd.oci.image.layer.v1.tar+gzip
break
else
retries=(( retries++ ))
echo "Build failed. Retrying (${retries}/${max_retries})..."
fi
done
GOPROXY="https://proxy.golang.org,direct" PLUGIN_NAME="${plugin}" make build
tar czvf ${PLUGIN_DIR}/plugin.tar.gz ${PLUGIN_DIR}/plugin.wasm
oras push $IMAGE ${PLUGIN_DIR}/plugin.tar.gz:application/vnd.oci.image.layer.v1.tar+gzip
if [ ${retries} -eq ${max_retries} ]; then
echo "Build failed after ${max_retries} retries."
exit 1
fi
done

0 comments on commit 2546963

Please sign in to comment.