Launcher/.github/workflows/push.yml

73 lines
2.6 KiB
YAML
Raw Normal View History

2020-03-31 17:43:36 +03:00
name: push
2022-01-06 20:14:04 +03:00
on: push
2020-03-31 17:43:36 +03:00
jobs:
launcher:
name: Launcher
runs-on: ubuntu-latest
steps:
2020-04-05 10:27:04 +03:00
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
2020-03-31 17:43:36 +03:00
2020-04-05 10:27:04 +03:00
- name: Cache Gradle
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: gravit-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-launcher
2020-03-31 17:43:36 +03:00
2022-01-06 20:14:04 +03:00
- name: Set up JDK 17
2020-04-05 10:27:04 +03:00
uses: actions/setup-java@v1
with:
2022-01-06 20:14:04 +03:00
java-version: 17
2020-03-31 17:43:36 +03:00
2020-04-05 10:27:04 +03:00
- name: Grant execute permission for gradlew
run: chmod +x gradlew
2020-03-31 17:43:36 +03:00
2020-04-05 10:27:04 +03:00
- name: Build with Gradle
run: ./gradlew build
2020-04-05 10:27:04 +03:00
- name: Create artifacts
run: |
mkdir -p artifacts/modules
2022-01-06 20:14:04 +03:00
cd LaunchServer/build/libs
2020-04-05 10:27:04 +03:00
zip -r -9 ../../../artifacts/libraries.zip * -x "LaunchServer.jar" -x "LaunchServer-clean.jar"
cp LaunchServer.jar ../../../artifacts/LaunchServer.jar
2022-01-06 20:14:04 +03:00
cd ../../..
cp ServerWrapper/build/libs/ServerWrapper.jar artifacts/ServerWrapper.jar
cp LauncherAuthlib/build/libs/LauncherAuthlib.jar artifacts/LauncherAuthlib.jar
2020-05-01 04:58:50 +03:00
cp modules/*_module/build/libs/*.jar artifacts/modules || true
cp modules/*_lmodule/build/libs/*.jar artifacts/modules || true
2020-04-05 10:27:04 +03:00
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: Launcher
path: artifacts
2022-01-06 20:14:04 +03:00
- name: Get version value, set to env
if: startsWith(github.event.ref, 'refs/tags')
run: echo "LAUNCHER_VERSION=$(echo ${{ github.event.ref }} | awk -F\/ '{print $3}')" >> $GITHUB_ENV
- name: Prebuild release files
if: startsWith(github.event.ref, 'refs/tags')
run: |
cd artifacts
zip -r -9 Release.zip *
zip -j -9 LaunchServerModules.zip ../modules/*_module/build/libs/*.jar
zip -j -9 LauncherModules.zip ../modules/*_lmodule/build/libs/*.jar
cd ../LaunchServer/build/libs
zip -r -9 ../../../artifacts/LauncherBase.zip * -x "LaunchServer-clean.jar"
2020-04-05 10:27:04 +03:00
- name: Create release
id: create_release
2022-01-06 20:14:04 +03:00
uses: softprops/action-gh-release@v1
if: startsWith(github.event.ref, 'refs/tags')
2020-04-05 10:27:04 +03:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-01-06 20:14:04 +03:00
# Список настроек тута: https://github.com/softprops/action-gh-release#-customizing
# Можно сделать пуш описания релиза из файла
2020-04-05 10:27:04 +03:00
with:
2022-01-06 20:14:04 +03:00
name: GravitLauncher ${{ env.LAUNCHER_VERSION }}
2020-04-05 10:27:04 +03:00
draft: false
prerelease: false
2022-01-06 20:14:04 +03:00
files: |
artifacts/*