Skip to content

Merge pull request #165 from ktock/prepare-0.5.2 #11

Merge pull request #165 from ktock/prepare-0.5.2

Merge pull request #165 from ktock/prepare-0.5.2 #11

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
DOCKER_BUILDKIT: 1
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-22.04
name: Release
env:
OUTPUT_DIR: ${{ github.workspace }}/builds
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.21.x
- uses: actions/checkout@v4
- name: Build binaries
run: |
PREFIX=${OUTPUT_DIR} make artifacts
- name: Build wasm image
run: |
PREFIX=${OUTPUT_DIR} make c2w-net-proxy.wasm
- name: sha256sum
run: |
( cd ${OUTPUT_DIR}; sha256sum * ) > "${GITHUB_WORKSPACE}/SHA256SUMS"
mv "${GITHUB_WORKSPACE}/SHA256SUMS" "${OUTPUT_DIR}/SHA256SUMS"
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
SHA256SUM_OF_SHA256SUMS=$(sha256sum ${OUTPUT_DIR}/SHA256SUMS | cut -d ' ' -f 1)
RELEASE_TAG="${GITHUB_REF##*/}"
MINIMAL_TAR=$(ls -1 ${OUTPUT_DIR} | grep container2wasm-v | head -1)
MINIMAL_TAR_LIST=$(tar --list -vvf ${OUTPUT_DIR}/${MINIMAL_TAR})
cat <<EOF > ${GITHUB_WORKSPACE}/release-note.txt
(TBD)
## About the tarball binaries
Extract it to a path like \`/usr/local/bin/\` or \`~/bin/\`
<details>
<summary>list of files</summary>
\`\`\`
${MINIMAL_TAR_LIST}
\`\`\`
</details>
## About \`c2w-net-proxy.wasm\`
Please refer to [the document about networking for container on browser](https://github.com/ktock/container2wasm/tree/${RELEASE_TAG}/examples/networking/fetch/) for details and usage.
---
The sha256sum of SHA256SUMS is \`${SHA256SUM_OF_SHA256SUMS}\`
EOF
ls -al ${OUTPUT_DIR}/
gh release create -F ${GITHUB_WORKSPACE}/release-note.txt --draft --title "${RELEASE_TAG}" "${RELEASE_TAG}" ${OUTPUT_DIR}/*