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
13 changes: 12 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ jobs:
tag: ${{ env.RELEASE_VERSION }}

checksums:
name: generate checksums
name: generate checksums and manifests
runs-on: ubuntu-latest
needs: release
steps:
Expand Down Expand Up @@ -216,3 +216,14 @@ jobs:
file: checksums-${{ env.RELEASE_VERSION }}.txt
tag: ${{ env.RELEASE_VERSION }}

- name: create plugin manifest
shell: bash
run: ./manifest/generate-manifest.sh ${{ env.RELEASE_VERSION }} checksums-${{ env.RELEASE_VERSION }}.txt > py2wasm.json

- name: upload plugin manifest to releases
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: py2wasm.json
tag: ${{ env.RELEASE_VERSION }}

74 changes: 74 additions & 0 deletions manifest/generate-manifest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/bash

if [ $# -ne 2 ]; then
echo 1>&2 "Usage: $0 VERSION_STRING CHECKSUM_FILE"
exit 3
fi

[ ! -f "$2" ] && echo -e "The second argument has to be the checksum file\n\n"Usage: $0 VERSION_STRING CHECKSUM_FILE"" && exit 3

# The first argument is if the version (either the tag or canary)
# The second argument is the checksum file
SPIN_COMPAT_STRING=$(cat manifest/plugin-spin-compat.txt )
VERSION=$1
PLUGIN_BINARY_VERSION_STRING=$1


# If canary release tag with epoch at the end as it is monotonic
if [[ $VERSION == "canary" ]]; then
PLUGIN_VERSION=$(cat ./crates/spin-python-engine/Cargo.toml | grep version | head -n 1 | awk '{print $3}')
VERSION="${PLUGIN_VERSION//\"}post.$(date +%s)"
PLUGIN_BINARY_VERSION_STRING="canary"
fi

# Gather the checksums

LINUX_ARM=$(cat $2 | grep "linux-aarch64" | awk '{print $1}')
LINUX_AMD=$(cat $2 | grep "linux-amd64" | awk '{print $1}')
MAC_ARM=$(cat $2 | grep "macos-aarch64" | awk '{print $1}')
MAC_AMD=$(cat $2 | grep "macos-amd64" | awk '{print $1}')
WINDOWS_AMD=$(cat $2 | grep "windows-amd64" | awk '{print $1}')

# Dump out the json manifest
cat <<EOF
{
"name": "py2wasm",
"description": "A plugin to convert Python applications to Spin compatible modules",
"homepage": "https://github.com/fermyon/spin-python-sdk",
"version": "${VERSION//v}",
"spinCompatibility": "${SPIN_COMPAT_STRING}",
"license": "Apache-2.0",
"packages": [
{
"os": "linux",
"arch": "amd64",
"url": "https://github.com/fermyon/spin-python-sdk/releases/download/${PLUGIN_BINARY_VERSION_STRING}/py2wasm-${PLUGIN_BINARY_VERSION_STRING}-linux-amd64.tar.gz",
"sha256": "${LINUX_AMD}"
},
{
"os": "linux",
"arch": "aarch64",
"url": "https://github.com/fermyon/spin-python-sdk/releases/download/${PLUGIN_BINARY_VERSION_STRING}/py2wasm-${PLUGIN_BINARY_VERSION_STRING}-linux-aarch64.tar.gz",
"sha256": "${LINUX_ARM}"
},
{
"os": "macos",
"arch": "aarch64",
"url": "https://github.com/fermyon/spin-python-sdk/releases/download/${PLUGIN_BINARY_VERSION_STRING}/py2wasm-${PLUGIN_BINARY_VERSION_STRING}-macos-aarch64.tar.gz",
"sha256": "${MAC_ARM}"
},
{
"os": "macos",
"arch": "amd64",
"url": "https://github.com/fermyon/spin-python-sdk/releases/download/${PLUGIN_BINARY_VERSION_STRING}/py2wasm-${PLUGIN_BINARY_VERSION_STRING}-macos-amd64.tar.gz",
"sha256": "${MAC_AMD}"
},
{
"os": "windows",
"arch": "amd64",
"url": "https://github.com/fermyon/spin-python-sdk/releases/download/${PLUGIN_BINARY_VERSION_STRING}/py2wasm-${PLUGIN_BINARY_VERSION_STRING}-windows-amd64.tar.gz",
"sha256": "${WINDOWS_AMD}"
}
]
}
EOF
1 change: 1 addition & 0 deletions manifest/plugin-spin-compat.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
>=0.9