From 58b624e0b9d1c1f33e180fd8b9c94d30342a68d7 Mon Sep 17 00:00:00 2001 From: ppom Date: Tue, 9 Jan 2024 12:00:00 +0100 Subject: [PATCH] Automate release --- release.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 release.sh diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..9f3e84e --- /dev/null +++ b/release.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +set -exu + +docker run -it --rm -e HOME=/tmp/ -v "$(pwd)":/tmp/code -w /tmp/code -u "$(id -u)" golang:1.20 make reaction.deb + +make signatures + +TAG="$(git tag --sort=v:refname | tail -n1)" + +rsync -avz -e 'ssh -J pica01' ./ip46tables ./reaction ./reaction.deb ./ip46tables.minisig ./reaction.minisig ./reaction.deb.minisig akesi:/var/www/static/reaction/releases/"$TAG" + +TOKEN="$(rbw get framagit.org token)" + +DATA='{ +"tag_name":"'"$TAG"'", +"assets":{"links":[ +{"url": "https://static.ppom.me/reaction/releases/'"$TAG"'/reaction", "name": "reaction (x86-64)", "link_type": "package"}, +{"url": "https://static.ppom.me/reaction/releases/'"$TAG"'/ip46tables", "name": "ip46tables (x86-64)", "link_type": "package"}, +{"url": "https://static.ppom.me/reaction/releases/'"$TAG"'/reaction.deb", "name": "reaction.deb (x86-64)", "link_type": "package"}, +{"url": "https://static.ppom.me/reaction/releases/'"$TAG"'/reaction.minisig", "name": "reaction.minisig", "link_type": "other"}, +{"url": "https://static.ppom.me/reaction/releases/'"$TAG"'/ip46tables.minisig", "name": "ip46tables.minisig", "link_type": "other"}, +{"url": "https://static.ppom.me/reaction/releases/'"$TAG"'/reaction.deb.minisig", "name": "reaction.deb.minisig", "link_type": "other"} +]}}' + +DATA="$(echo "$DATA" | tr '\n' ' ')" + +curl \ + --fail-with-body \ + --location \ + -X POST \ + -H 'Content-Type: application/json' \ + -H "PRIVATE-TOKEN: $TOKEN" \ + 'https://framagit.org/api/v4/projects/90566/releases' \ + --data "$DATA" + +make clean