-
Notifications
You must be signed in to change notification settings - Fork 1
/
newRelease.sh
29 lines (23 loc) · 889 Bytes
/
newRelease.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# THIS SCRIPT FILE UPDATES LOCAL FILES WITH NEW VERSION VARIABLES
# AND CREATES A NEW DRAFT RELEASE ON GITHUB
# NOTE: Hardcoded JVM path ln:25
# REQUIRES: gh, lua
function user_confirmation() {
read -p "did the previous script work as intended? (y/n) " -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
[[ "$0" == "$BASH_SOURCE" ]] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
fi
}
# Update files to new version
lua updateVersion.lua $1
user_confirmation
# create new release
gh release create $1 -t "GoICasterCompanion v$1" -p -d -R rvrx/GoICasterCompanion
user_confirmation
# Generate DMG
./gradlew createDmg -Dorg.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home/
user_confirmation
# Upload DMG
gh release upload $1 build/distributions/GoICC\ v$1.dmg