From 5ffbfb426ec15d4e8ca49be4ab860c01baf1ffda Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:01:00 +0200 Subject: [PATCH] CI update --- .github/workflows/ci_fabric-snapshot.yml | 41 ++++++++++++++++++++++++ .github/workflows/ci_forge.yml | 41 ++++++++++++++++++++++++ .github/workflows/renaming.sh | 12 +++++++ gradle.properties | 8 ++--- renaming.sh | 29 ----------------- 5 files changed, 98 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/ci_fabric-snapshot.yml create mode 100644 .github/workflows/ci_forge.yml create mode 100644 .github/workflows/renaming.sh delete mode 100644 renaming.sh diff --git a/.github/workflows/ci_fabric-snapshot.yml b/.github/workflows/ci_fabric-snapshot.yml new file mode 100644 index 0000000..a9fe4e8 --- /dev/null +++ b/.github/workflows/ci_fabric-snapshot.yml @@ -0,0 +1,41 @@ +# This workflow will build a Java project with Gradle +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Fabric Snapshot CI + +on: + push: + branches: fabric-snapshot + pull_request: + branches: fabric-snapshot + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + name: Fetching branches + with: + ref: 'fabric-snapshot' # Branch to build from + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build + - name: Execute permission for renaming script + run: chmod +x renaming.sh + - name: Running renaming script + run: ./renaming.sh + + # Artifact upload + - name: Uploading artifacts + uses: actions/upload-artifact@v2 + with: + #name: ${{ env.BUILDNAME }}.jar + name: UNZIP_ME_${{ env.BUILDNAME }}.zip + path: build/libs/${{ env.BUILDNAME }}.jar diff --git a/.github/workflows/ci_forge.yml b/.github/workflows/ci_forge.yml new file mode 100644 index 0000000..9240587 --- /dev/null +++ b/.github/workflows/ci_forge.yml @@ -0,0 +1,41 @@ +# This workflow will build a Java project with Gradle +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Forge CI + +on: + push: + branches: froge + pull_request: + branches: froge + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + name: Fetching branches + with: + ref: 'froge' # Branch to build from + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build with Gradle + run: ./gradlew build + - name: Execute permission for renaming script + run: chmod +x renaming.sh + - name: Running renaming script + run: ./renaming.sh + + # Artifact upload + - name: Uploading artifacts + uses: actions/upload-artifact@v2 + with: + #name: ${{ env.BUILDNAME }}.jar + name: UNZIP_ME_${{ env.BUILDNAME }}.zip + path: build/libs/${{ env.BUILDNAME }}.jar diff --git a/.github/workflows/renaming.sh b/.github/workflows/renaming.sh new file mode 100644 index 0000000..f54ff96 --- /dev/null +++ b/.github/workflows/renaming.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Setting the variables +projectId="$(grep 'archives_base_name' | sed 's/archives_base_name = //g;s/ //g;s/,//g;s/"//g')" +version="$(grep 'mod_version' gradle.properties | grep -o '[0-9]*\.[0-9]*\.[0-9]*')" +mcVersion="$(grep 'minecraft_version' gradle.properties | sed 's/minecraft_version=//g;s/ //g;s/,//g;s/"//g')" + +cd ./build/libs || exit + +echo "Build is going to be renamed: $projectId-$version-devbuild_$GITHUB_RUN_NUMBER-MC_$mcVersion.jar" +# Renaming the dev build +mv "$projectId-$version.jar" "$projectId-$version-devbuild_$GITHUB_RUN_NUMBER-MC_$mcVersion.jar" diff --git a/gradle.properties b/gradle.properties index 6534cd6..b734330 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,11 +14,11 @@ mod_version = 1.5.1 maven_group = org.samo_lego archives_base_name = simpleauth -# Carpet for debugging -carpet_core_version = 1.4.0+v200623 -carpet_branch = 1.16 - # Hashing argon2_version = 2.7 bcrypt_version = 0.9.0 bytes_version = 1.3.0 + +# Carpet for debugging +carpet_core_version = 1.4.0+v200623 +carpet_branch = 1.16 \ No newline at end of file diff --git a/renaming.sh b/renaming.sh deleted file mode 100644 index 6af4440..0000000 --- a/renaming.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -cd ./build/libs - -# Deleting the development and sources files -echo "Deleting dev jars." -rm *sources* -rm *dev* - -cd ../../ - -# Moving older builds to the build/libs folder (from dev-builds branch) -git checkout origin/dev-builds *.jar -mv *.jar ./build/libs - -# Cleaning up old dev builds, if there are more than 10 -echo "Cleaning old dev builds" -ls ./build/libs -1tr | tail -n +10 | xargs rm -f - -# Setting the variables -projectId="$(grep '"id":' src/main/resources/fabric.mod.json | sed 's/"id"://g;s/ //g;s/,//g;s/"//g')" -version="$(grep 'mod_version' gradle.properties | grep -o '[0-9]*\.[0-9]*\.[0-9]*')" -mcVersion="$(grep 'minecraft_version' gradle.properties | sed 's/minecraft_version=//g;s/ //g;s/,//g;s/"//g')" - -cd ./build/libs - -echo "Build is going to be renamed: $projectId-$version-devbuild_$GITHUB_RUN_NUMBER-MC_$mcVersion.jar" -# Renaming the dev build -mv "$projectId-$version.jar" "$projectId-$version-devbuild_$GITHUB_RUN_NUMBER-MC_$mcVersion.jar"