-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85892d3
commit 2f59790
Showing
2 changed files
with
41 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
name: Build JaimesHut | ||
on: | ||
push: | ||
pull_request: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
Build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone the repo | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Build with gradle | ||
run: | | ||
export VERSION="`if [[ $GITHUB_REF == refs\/tags* ]]; then echo ${GITHUB_REF//refs\/tags\//}; fi`" | ||
if [ "$VERSION" = "" ]; | ||
then | ||
branch="`if [[ $GITHUB_REF == refs\/heads* ]]; then echo ${GITHUB_REF//refs\/heads\//}; fi`" | ||
export VERSION="$branch-SNAPSHOT" | ||
fi | ||
gradle buildFatJar -Pin_version="$VERSION" | ||
- name: Upload to release | ||
if: github.event_name == 'release' | ||
run: | | ||
releaseId=$(jq --raw-output '.release.id' ${GITHUB_EVENT_PATH}) | ||
filename="`ls build/libs/JaimesHut-fat-*.jar`" | ||
url="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/$releaseId/assets?name=$(basename $filename)" | ||
echo "Upload to $url" | ||
curl -L \ | ||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
-H "Content-Type: application/zip" \ | ||
--data-binary @"$filename" \ | ||
"$url" | ||
This file was deleted.
Oops, something went wrong.