You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ff/release.sh

57 lines
1.6 KiB
Bash

#!/bin/bash
#set -x
TOKEN=$(< token.txt)
EDITOR=nano git commit -a
git push
COMMIT=$(git log | head -n 1 | cut -d' ' -f2)
echo $COMMIT
export PATH=$PATH:"C:\Program Files\7-Zip"
TAG=$(date +%s)
"C:/Program Files/Python310/python.exe" setup.py build
sleep 2
mv ./build/exe.win-amd64-3.10/ ./build/ippigeon-win
7z a -r release-$COMMIT.zip ./build/ippigeon-win
7z a -sfx7z.sfx IPPigeon-install.exe ./build/ippigeon-win
mv ./build/ippigeon-win/ ./build/exe.win-amd64-3.10
#sleep 30
DATA='{
"body": "Autogenerated release",
"draft": false,
"name": "Development release",
"prerelease": true,
"tag_name": "'$TAG'",
"target_commitish": "'$COMMIT'"
}'
OUT=$(curl -X 'POST' \
'https://git.deck.sh/api/v1/repos/Interfaz/ff/releases?token='$TOKEN'' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d "$DATA")
ID=$(echo $OUT | cut -d',' -f 1 | cut -d':' -f 2)
OUT=$(curl -X 'POST' \
'https://git.deck.sh/api/v1/repos/Interfaz/ff/releases/'$ID'/assets?token='$TOKEN'' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'attachment=@IPPigeon-install.exe;type=application/octet-stream')
URL=$(echo $OUT | cut -d',' -f 7 | cut -d\" -f4)
OUT=$(curl -X 'POST' \
'https://git.deck.sh/api/v1/repos/Interfaz/ff/releases/'$ID'/assets?token='$TOKEN'' \
-H 'accept: application/json' \
-H 'Content-Type: multipart/form-data' \
-F 'attachment=@'release-$COMMIT.zip';type=application/x-zip-compressed')
URLZIP=$(echo $OUT | cut -d',' -f 7 | cut -d\" -f4)
curl -d "Self extracting installer: $URL
Portable Zip: $URLZIP" https://notify.deck.sh/ipro-release
rm release-$COMMIT.zip
rm IPPigeon-install.exe