kotlin 2.0, gradle 8.5, compile to java 21 not 8??? #46
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
name: Compile & Deploy Gradle Jar | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: "adopt" | |
java-version: "17" | |
- name: Make gradlew executable | |
run: chmod +x ./gradlew | |
- name: Cache Gradle Dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle/caches | |
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: gradle-${{ runner.os }}- | |
- name: Create build directory | |
run: mkdir -p build | |
- name: Gradle build | |
run: | | |
echo "REPO_NAME=${{ github.event.repository.name }}" >> $GITHUB_ENV | |
./gradlew build -PoutputDir=build | |
- name: Install JQ | |
run: sudo apt-get install jq | |
- name: Obtain Pterodactyl upload endpoint | |
run: | | |
response=$(curl "https://${{ vars.PTERO_HOST }}/api/client/servers/${{ vars.PTERO_SERVER_ID }}/files/upload" \ | |
-H 'Accept: application/json' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Authorization: Bearer ${{ secrets.PTERO_API_KEY }}' \ | |
-X GET) | |
url=$(echo "$response" | jq -r .attributes.url) | |
echo "URL=$url" >> $GITHUB_ENV | |
- name: Upload jar to Pterodactyl upload endpoint | |
run: | | |
echo $URL | |
echo $REPO_NAME | |
file=$(ls build/libs/$REPO_NAME.jar) | |
curl "$URL" \ | |
-H 'Content-Type: multipart/form-data' \ | |
-F "files=@$file" \ | |
-X POST | |
- name: Restart Pterodactyl server | |
run: | | |
curl "https://${{ vars.PTERO_HOST }}/api/client/servers/${{ vars.PTERO_SERVER_ID }}/power" \ | |
-H 'Accept: application/json' \ | |
-H 'Content-Type: application/json' \ | |
-H 'Authorization: Bearer ${{ secrets.PTERO_API_KEY }}' \ | |
-X POST \ | |
-d '{ | |
"signal": "restart" | |
}' |