From 6dea2f81c0bcef78bde8a9825675a020973f39c9 Mon Sep 17 00:00:00 2001 From: Egor Koleda Date: Tue, 31 Mar 2020 17:38:46 +0300 Subject: [PATCH 1/6] [ANY] change submodule link type --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index f70ed106..e491e098 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "modules"] path = modules - url = git@github.com:GravitLauncher/LauncherModules.git + url = https://github.com/GravitLauncher/LauncherModules.git From 6125d1c32311440ae8a1f1bc2fe424d19dca083c Mon Sep 17 00:00:00 2001 From: Egor Koleda Date: Tue, 31 Mar 2020 17:43:36 +0300 Subject: [PATCH 2/6] [ANY] added actions workflow --- .github/workflows/push.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 00000000..8aa217aa --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,26 @@ +name: push +on: push +jobs: + launcher: + name: Launcher + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Cache Gradle + uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: gravit-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-mods-1_7_10 + + - 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 + run: ./gradlew build \ No newline at end of file From 12583aec89228f8e3fc53e49fcab2f98fbd4bb9e Mon Sep 17 00:00:00 2001 From: Egor Koleda Date: Tue, 31 Mar 2020 17:49:53 +0300 Subject: [PATCH 3/6] [ANY] added recursive submodule fetching to actions --- .github/workflows/push.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 8aa217aa..2fa7e3de 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -7,6 +7,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + submodules: recursive - name: Cache Gradle uses: actions/cache@v1 From 1587369ec531b9145ecf8b3c13667c7ae8636e28 Mon Sep 17 00:00:00 2001 From: Egor Koleda Date: Tue, 31 Mar 2020 18:00:15 +0300 Subject: [PATCH 4/6] [ANY] added artifacts creation & uploading --- .github/workflows/push.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2fa7e3de..f331394a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -25,4 +25,25 @@ jobs: run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build \ No newline at end of file + 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 From d3c14be4b18309a272b0d2b9365cf0e9ea83c249 Mon Sep 17 00:00:00 2001 From: Egor Koleda Date: Tue, 31 Mar 2020 18:19:52 +0300 Subject: [PATCH 5/6] [ANY] remove all other CI's :) --- .gitlab-ci.yml | 90 -------------------------------------------------- .travis.yml | 22 ------------ 2 files changed, 112 deletions(-) delete mode 100644 .gitlab-ci.yml delete mode 100644 .travis.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 794e62e6..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,90 +0,0 @@ -image: gradle:jdk11 - -stages: - - build - - test - - deploy -variables: - GRADLE_OPTS: "-Dorg.gradle.daemon=false" - -before_script: - - apt-get -y update - - 'which zip || ( apt-get -y install zip )' - - 'which git || ( apt-get -y install git )' - - export GRADLE_USER_HOME=`pwd`/.gradle - - chmod +x gradlew - - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - - eval $(ssh-agent -s) - - echo "$SSH_PRIVATE_KEY" | base64 -d | ssh-add - > /dev/null - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - - git submodule sync - - mv modules modules_cache || true - - git submodule update --init --recursive --force - - cp -a modules_cache/* modules/ || true -build: - stage: build - script: - - gradle assemble - after_script: - - 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 - cache: - key: "$CI_COMMIT_REF_NAME" - paths: - - .gradle - - LaunchServer/build - - Launcher/build - - LauncherCore/build - - LauncherAPI/build - - LauncherAuthlib/build - - modules/*_*module/build - artifacts: - expire_in: 6 week - paths: - - artifacts - -test: - stage: test - script: - - gradle check - cache: - key: "$CI_COMMIT_REF_NAME" - policy: pull - paths: - - .gradle - - LaunchServer/build - - Launcher/build - - LauncherCore/build - - LauncherAPI/build - - LauncherAuthlib/build - - modules/*_*module/build - -deploy-demo: - stage: deploy - only: [dev] - script: - - gradle build - - eval $(ssh $SSH_USER@$SSH_HOST 'cd $SSH_DIR && cat deploy.sh') - cache: - key: "$CI_COMMIT_REF_NAME" - policy: pull - paths: - - .gradle - - LaunchServer/build - - Launcher/build - - LauncherCore/build - - LauncherAPI/build - - LauncherAuthlib/build - - modules/*_*module/build \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5822178d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: java -dist: trusty -jdk: - - openjdk11 -# Use https (public access) instead of git for git-submodules. This modifies only Travis-CI behavior! -# disable the default submodule logic -git: - submodules: false -# use sed to replace the SSH URL with the public URL, then init and update submodules -before_install: - - sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules - - git submodule update --init --recursive -# gradle -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ -script: - - ./gradlew build From d2ef0b3aff8244cf63916477a6519bf2ddf31143 Mon Sep 17 00:00:00 2001 From: Egor Koleda Date: Tue, 31 Mar 2020 18:55:02 +0300 Subject: [PATCH 6/6] [ANY] change cache key suffix (oops) and publish to releases --- .github/workflows/push.yml | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index f331394a..001df928 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,5 +1,9 @@ name: push -on: push +on: + push: + create: + tags: + - v* jobs: launcher: name: Launcher @@ -14,7 +18,7 @@ jobs: uses: actions/cache@v1 with: path: ~/.gradle/caches - key: gravit-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-mods-1_7_10 + key: gravit-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-launcher - name: Set up JDK 11 uses: actions/setup-java@v1 @@ -47,3 +51,32 @@ jobs: with: name: Launcher path: artifacts + + - 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