2020-03-31 17:43:36 +03:00
|
|
|
name: push
|
2020-03-31 18:55:02 +03:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
create:
|
|
|
|
tags:
|
|
|
|
- v*
|
2020-03-31 17:43:36 +03:00
|
|
|
jobs:
|
|
|
|
launcher:
|
|
|
|
name: Launcher
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-03-31 17:49:53 +03:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2020-03-31 17:43:36 +03:00
|
|
|
|
|
|
|
- name: Cache Gradle
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches
|
2020-03-31 18:55:02 +03:00
|
|
|
key: gravit-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-launcher
|
2020-03-31 17:43:36 +03:00
|
|
|
|
|
|
|
- name: Set up JDK 11
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 11
|
|
|
|
|
|
|
|
- name: Grant execute permission for gradlew
|
|
|
|
run: chmod +x gradlew
|
|
|
|
|
|
|
|
- name: Build with Gradle
|
2020-03-31 18:00:15 +03:00
|
|
|
run: ./gradlew build
|
|
|
|
|
|
|
|
- name: Create artifacts
|
|
|
|
run: |
|
|
|
|
mkdir -p artifacts/modules
|
|
|
|
cd LaunchServer/build/libs/
|
|
|
|
zip -r -9 ../../../artifacts/libraries.zip * -x "LaunchServer.jar" -x "LaunchServer-clean.jar"
|
|
|
|
cp LaunchServer.jar ../../../artifacts/LaunchServer.jar
|
|
|
|
cd ../../../ServerWrapper/build/libs
|
|
|
|
cp ServerWrapper.jar ../../../artifacts/ServerWrapper.jar
|
|
|
|
cd ../../../LauncherAuthlib/build/libs
|
|
|
|
cp LauncherAuthlib.jar ../../../artifacts/LauncherAuthlib.jar
|
|
|
|
cd ../../../
|
|
|
|
cp modules/*_module/build/libs/*.jar artifacts/modules
|
|
|
|
cp modules/*_swmodule/build/libs/*.jar artifacts/modules
|
|
|
|
cp modules/*_lmodule/build/libs/*.jar artifacts/modules
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: Launcher
|
|
|
|
path: artifacts
|
2020-03-31 18:55:02 +03:00
|
|
|
|
|
|
|
- name: Create release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
if: github.event_name == 'create'
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ github.ref }}
|
|
|
|
release_name: GravitLauncher ${{ github.ref }}
|
|
|
|
draft: false
|
|
|
|
prerelease: false
|
|
|
|
|
|
|
|
- name: Pack release
|
|
|
|
if: github.event_name == 'create'
|
|
|
|
run: |
|
|
|
|
cd artifacts/
|
|
|
|
zip -r -9 ../Release.zip *
|
|
|
|
|
|
|
|
- name: Upload release
|
|
|
|
if: github.event_name == 'create'
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: ./Release.zip
|
|
|
|
asset_name: Release.zip
|
|
|
|
asset_content_type: application/zip
|