Skip to content

Commit

Permalink
Added a prep-release script
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteFang5 committed Jul 29, 2021
1 parent 8e412f7 commit adb8b5b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions prep-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -euo pipefail

VERSION="" #"${1}"
FOLDER="release" #"${2}"

FILENAME=$(find ${FOLDER} -name "*Setup*.exe" -type f)
FILENAME=$(basename -- ${FILENAME}) #"poe-overlay-Setup-${VERSION}.exe"
FILEPATH="${FOLDER}/${FILENAME}"
VERSION=$(echo "${FILENAME}" | grep -Po '(?<=Setup-)[0-9]+([.][0-9]+)+')

SHA512=$(openssl dgst -sha512 -binary $FILEPATH | openssl enc -base64 | tr -d '\r' | tr -d '\n')
FILESIZE=$(stat -c%s $FILEPATH)
RELEASEDATE=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")

cat > "${FOLDER}/latest.yml" <<EOF
version: ${VERSION}
files:
- url: ${FILENAME}
sha512: ${SHA512}
size: ${FILESIZE}
path: ${FILENAME}
sha512: ${SHA512}
releaseDate: '${RELEASEDATE}'
EOF

0 comments on commit adb8b5b

Please sign in to comment.