generated from titan-data/template
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github Actions with minor fixes (#11)
Fixes #6
- Loading branch information
Showing
21 changed files
with
217 additions
and
49 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,54 @@ | ||
name: Publish | ||
|
||
on: create | ||
|
||
jobs: | ||
build: | ||
name: Build ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04, macOS-10.14] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: '8.0.212' | ||
- name: Setup Env | ||
run: ./scripts/setup.sh ${{ matrix.os }} | ||
- name: Build Jar | ||
run: ./scripts/compile-maven.sh | ||
- name: Compile Binary | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: ./scripts/build.sh ${{ matrix.os }} | ||
- name: Upload ${{ matrix.os }} Binary | ||
if: matrix.os == 'macOS-10.14' | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: titan-cli-0.3.0-darwin_amd64.zip | ||
path: releases | ||
- name: Upload ${{ matrix.os }} Binary | ||
if: matrix.os == 'ubuntu-18.04' | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: titan-cli-0.3.0-linux_amd64.zip | ||
path: releases | ||
release: | ||
name: Draft Release | ||
runs-on: ubuntu-18.04 | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/download-artifact@master | ||
with: | ||
name: titan-cli-0.3.0-darwin_amd64.zip | ||
path: releases | ||
- uses: actions/download-artifact@master | ||
with: | ||
name: titan-cli-0.3.0-linux_amd64.zip | ||
path: releases | ||
- name: Draft Release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: ./scripts/draft-release.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,20 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
test: | ||
name: Test on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04, windows-2019, macOS-10.14] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-java@v1 | ||
with: | ||
java-version: '8.0.212' | ||
- name: Run Maven Tests | ||
run: uname -a |
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
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
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,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
os=$1 | ||
|
||
#Setup Linux | ||
if [ $os = "ubuntu-18.04" ]; then | ||
${PWD}/scripts/build-linux.sh | ||
fi | ||
|
||
#Setup OSX | ||
if [ $os = "macOS-10.14" ]; then | ||
export PATH=${PWD}/graalvm-ce-19.0.0/Contents/Home/bin:$PATH | ||
export JAVA_HOME=${PWD}/graalvm-ce-19.0.0/Contents/Home/jre | ||
${PWD}/scripts/build-osx.sh | ||
fi |
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,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
if [[ -z "$GITHUB_TOKEN" ]]; then | ||
echo "Set the GITHUB_TOKEN env variable." | ||
exit 1 | ||
fi | ||
|
||
RELEASE=${GITHUB_REF##*/} | ||
body='{ | ||
"tag_name": "'${RELEASE}'", | ||
"target_commitish": "master", | ||
"name": "'${RELEASE}'", | ||
"body": "Draft release for '${RELEASE}'", | ||
"draft": true, | ||
"prerelease": false | ||
}' | ||
|
||
#Draft Release | ||
RAW_URL=$(curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ | ||
--data "$body" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases" | | ||
jq -r '.upload_url') | ||
|
||
#Prepare Upload | ||
UPLOAD_URL="${RAW_URL%/*}" | ||
|
||
echo $UPLOAD_URL | ||
for file in ${PWD}/releases/*.zip; do | ||
${PWD}/scripts/upload_asset.sh "$UPLOAD_URL/assets?name=$(basename $file)" $file | ||
done |
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
#!/usr/bin/env bash | ||
|
||
os=$1 | ||
|
||
#Setup Linux | ||
if [ $os = "ubuntu-18.04" ]; then | ||
echo $os | ||
fi | ||
|
||
#Setup OSX | ||
if [ $os = "macOS-10.14" ]; then | ||
echo $os | ||
curl -L https://github.com/oracle/graal/releases/download/vm-19.0.0/graalvm-ce-darwin-amd64-19.0.0.tar.gz --output graal.tar.gz | ||
gunzip -c graal.tar.gz | tar xopf - | ||
export PATH=${PWD}/graalvm-ce-19.0.0/Contents/Home/bin:$PATH | ||
export JAVA_HOME=${PWD}/graalvm-ce-19.0.0/Contents/Home/jre | ||
gu install native-image | ||
fi |
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,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
UPLOAD_URL=$1 | ||
FILE=$2 | ||
SIZE=$(wc -c $FILE | awk '{print $1}') | ||
|
||
|
||
#Upload Asset | ||
curl \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
-H "Content-Length: $SIZE"\ | ||
-H "Content-Type: application/zip" \ | ||
--data-binary @$FILE "$UPLOAD_URL" |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.