diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2d8fb8e..69685fb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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: @@ -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 }} + diff --git a/manifest/generate-manifest.sh b/manifest/generate-manifest.sh new file mode 100755 index 0000000..e4b7f29 --- /dev/null +++ b/manifest/generate-manifest.sh @@ -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 <=0.9