add uploading and new link to release

This commit is contained in:
Bella 2020-04-27 18:57:21 -04:00
parent 3e44e68a25
commit e6fc35cad6
No known key found for this signature in database
GPG Key ID: DBD4A6030080C8B3
1 changed files with 12 additions and 7 deletions

View File

@ -5,13 +5,18 @@ COMMIT_TRIM="$(git log --format=%h -1)"
COMMIT_FULL="$(git log --format=%H -1)"
COMMIT_MSG="$(git log --format=%s -1)"
# Send message with commit information
curl -H "Content-Type: application/json" -X POST -d '{"embeds": [{"title": "","color": 10195199,"description": "**Changelog:** '"$COMMIT_MSG"'\nCommit: ['${COMMIT_TRIM}'](https://github.com/kami-blue/client/commits/'${COMMIT_TRIM}') Direct: ['${COMMIT_TRIM}'](https://github.com/kami-blue/client/commit/'${COMMIT_FULL}') "}]}' "$WEBHOOK"
# Find the release file and rename it to kamiblue-version-commit-release.jar
#BUILD_DIR="$(readlink -f ./build/libs/)"
#JAR_DIR="$(ls "$BUILD_DIR" | grep "release")"
#mv ${BUILD_DIR}/${JAR_DIR} ${BUILD_DIR}/kamiblue-${CUR_VER}-${COMMIT_TRIM}-release.jar
#JAR_DIR="$(ls "$BUILD_DIR" | grep "release")"
BUILD_DIR="$(readlink -f ./build/libs/)"
JAR_DIR="$(ls "$BUILD_DIR" | grep "release")"
mv ${BUILD_DIR}/${JAR_DIR} ${BUILD_DIR}/kamiblue-${CUR_VER}-${COMMIT_TRIM}-release.jar
JAR_DIR="$(ls "$BUILD_DIR" | grep "release")"
# Upload the release file
#curl -F content=@"$BUILD_DIR/$JAR_DIR" "$WEBHOOK"
# Upload the release
cd ~/
./github-release-linux-amd64 $COMMIT_TRIM $BUILD_DIR/$JAR_DIR --github-access-token $GITHUB_RELEASE_ACCESS_TOKEN --github-repository $GITHUB_RELEASE_REPOSITORY
# Send message with commit information
curl -H "Content-Type: application/json" -X POST -d '{"embeds": [{"title": "","color": 10195199,"description": "**Changelog:** '"$COMMIT_MSG"'\n**Download:** ['${CURVER}-${COMMIT_TRIM}'](https://github.com/kami-blue/nightly-releases/releases/download/'${COMMIT_TRIM}'/'${JAR_DIR}'
)\nCommit: ['${COMMIT_TRIM}'](https://github.com/kami-blue/client/commits/'${COMMIT_TRIM}') Direct: ['${COMMIT_TRIM}'](https://github.com/kami-blue/client/commit/'${COMMIT_FULL}') "}]}' "$WEBHOOK"