Skip to content

Commit 2ed0320

Browse files
authored
Merge pull request #42 from fermyon/generate-manifests
Generate manifests for canary and regular releases
2 parents 8788ebd + 65e28aa commit 2ed0320

File tree

3 files changed

+87
-1
lines changed

3 files changed

+87
-1
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
tag: ${{ env.RELEASE_VERSION }}
189189

190190
checksums:
191-
name: generate checksums
191+
name: generate checksums and manifests
192192
runs-on: ubuntu-latest
193193
needs: release
194194
steps:
@@ -216,3 +216,14 @@ jobs:
216216
file: checksums-${{ env.RELEASE_VERSION }}.txt
217217
tag: ${{ env.RELEASE_VERSION }}
218218

219+
- name: create plugin manifest
220+
shell: bash
221+
run: ./manifest/generate-manifest.sh ${{ env.RELEASE_VERSION }} checksums-${{ env.RELEASE_VERSION }}.txt > py2wasm.json
222+
223+
- name: upload plugin manifest to releases
224+
uses: svenstaro/upload-release-action@v2
225+
with:
226+
repo_token: ${{ secrets.GITHUB_TOKEN }}
227+
file: py2wasm.json
228+
tag: ${{ env.RELEASE_VERSION }}
229+

manifest/generate-manifest.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
3+
if [ $# -ne 2 ]; then
4+
echo 1>&2 "Usage: $0 VERSION_STRING CHECKSUM_FILE"
5+
exit 3
6+
fi
7+
8+
[ ! -f "$2" ] && echo -e "The second argument has to be the checksum file\n\n"Usage: $0 VERSION_STRING CHECKSUM_FILE"" && exit 3
9+
10+
# The first argument is if the version (either the tag or canary)
11+
# The second argument is the checksum file
12+
SPIN_COMPAT_STRING=$(cat manifest/plugin-spin-compat.txt )
13+
VERSION=$1
14+
PLUGIN_BINARY_VERSION_STRING=$1
15+
16+
17+
# If canary release tag with epoch at the end as it is monotonic
18+
if [[ $VERSION == "canary" ]]; then
19+
PLUGIN_VERSION=$(cat ./crates/spin-python-engine/Cargo.toml | grep version | head -n 1 | awk '{print $3}')
20+
VERSION="${PLUGIN_VERSION//\"}post.$(date +%s)"
21+
PLUGIN_BINARY_VERSION_STRING="canary"
22+
fi
23+
24+
# Gather the checksums
25+
26+
LINUX_ARM=$(cat $2 | grep "linux-aarch64" | awk '{print $1}')
27+
LINUX_AMD=$(cat $2 | grep "linux-amd64" | awk '{print $1}')
28+
MAC_ARM=$(cat $2 | grep "macos-aarch64" | awk '{print $1}')
29+
MAC_AMD=$(cat $2 | grep "macos-amd64" | awk '{print $1}')
30+
WINDOWS_AMD=$(cat $2 | grep "windows-amd64" | awk '{print $1}')
31+
32+
# Dump out the json manifest
33+
cat <<EOF
34+
{
35+
"name": "py2wasm",
36+
"description": "A plugin to convert Python applications to Spin compatible modules",
37+
"homepage": "https://github.com/fermyon/spin-python-sdk",
38+
"version": "${VERSION//v}",
39+
"spinCompatibility": "${SPIN_COMPAT_STRING}",
40+
"license": "Apache-2.0",
41+
"packages": [
42+
{
43+
"os": "linux",
44+
"arch": "amd64",
45+
"url": "https://github.com/fermyon/spin-python-sdk/releases/download/${PLUGIN_BINARY_VERSION_STRING}/py2wasm-${PLUGIN_BINARY_VERSION_STRING}-linux-amd64.tar.gz",
46+
"sha256": "${LINUX_AMD}"
47+
},
48+
{
49+
"os": "linux",
50+
"arch": "aarch64",
51+
"url": "https://github.com/fermyon/spin-python-sdk/releases/download/${PLUGIN_BINARY_VERSION_STRING}/py2wasm-${PLUGIN_BINARY_VERSION_STRING}-linux-aarch64.tar.gz",
52+
"sha256": "${LINUX_ARM}"
53+
},
54+
{
55+
"os": "macos",
56+
"arch": "aarch64",
57+
"url": "https://github.com/fermyon/spin-python-sdk/releases/download/${PLUGIN_BINARY_VERSION_STRING}/py2wasm-${PLUGIN_BINARY_VERSION_STRING}-macos-aarch64.tar.gz",
58+
"sha256": "${MAC_ARM}"
59+
},
60+
{
61+
"os": "macos",
62+
"arch": "amd64",
63+
"url": "https://github.com/fermyon/spin-python-sdk/releases/download/${PLUGIN_BINARY_VERSION_STRING}/py2wasm-${PLUGIN_BINARY_VERSION_STRING}-macos-amd64.tar.gz",
64+
"sha256": "${MAC_AMD}"
65+
},
66+
{
67+
"os": "windows",
68+
"arch": "amd64",
69+
"url": "https://github.com/fermyon/spin-python-sdk/releases/download/${PLUGIN_BINARY_VERSION_STRING}/py2wasm-${PLUGIN_BINARY_VERSION_STRING}-windows-amd64.tar.gz",
70+
"sha256": "${WINDOWS_AMD}"
71+
}
72+
]
73+
}
74+
EOF

manifest/plugin-spin-compat.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
>=0.9

0 commit comments

Comments
 (0)