added separate github upload script

This commit is contained in:
Bella 2020-04-30 21:52:32 -04:00
parent fcfb27a60d
commit d6bde97c68
No known key found for this signature in database
GPG Key ID: DBD4A6030080C8B3
1 changed files with 23 additions and 0 deletions

23
scripts/githubUpload.sh Normal file
View File

@ -0,0 +1,23 @@
#!/bin/bash
# Separate upload script to run in case the first fails
cd ~/kamiblue
CUR_VER="$(tail -c +2 ./scripts/curVer)"
COMMIT_TRIM="$(git log --format=%h -1)"
# Find the release file and rename it to kamiblue-version-commit-release.jar
BUILD_DIR=$HOME/kamiblue/build/libs/
JAR_DIR="$(ls "$BUILD_DIR" | grep "release")"
./gradlew build
# delete the release in case it exists
git tag -d $CUR_VER-$COMMIT_TRIM
git push origin :refs/tags/$CUR_VER-$COMMIT_TRIM
# Upload the release
cd ~/
source ~/.profile
./github-release-linux-amd64 $CUR_VER-$COMMIT_TRIM $BUILD_DIR/$JAR_DIR --commit master --tag $CUR_VER-$COMMIT_TRIM --github-repository $GITHUB_RELEASE_REPOSITORY --github-access-token $GITHUB_RELEASE_ACCESS_TOKEN