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 01/10] 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" From eeadddfff6286ef62c435671d511027f522d83f2 Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:03:42 +0200 Subject: [PATCH 02/10] CI update --- .github/workflows/ci_fabric-snapshot.yml | 6 ++-- .../{building.yml => ci_fabric-stable.yml} | 29 +++++++++---------- 2 files changed, 16 insertions(+), 19 deletions(-) rename .github/workflows/{building.yml => ci_fabric-stable.yml} (58%) diff --git a/.github/workflows/ci_fabric-snapshot.yml b/.github/workflows/ci_fabric-snapshot.yml index a9fe4e8..54e6290 100644 --- a/.github/workflows/ci_fabric-snapshot.yml +++ b/.github/workflows/ci_fabric-snapshot.yml @@ -16,9 +16,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Fetching branches - with: - ref: 'fabric-snapshot' # Branch to build from + name: Fetching branches + with: + ref: 'fabric-snapshot' # Branch to build from - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: diff --git a/.github/workflows/building.yml b/.github/workflows/ci_fabric-stable.yml similarity index 58% rename from .github/workflows/building.yml rename to .github/workflows/ci_fabric-stable.yml index 238b3db..35005b6 100644 --- a/.github/workflows/building.yml +++ b/.github/workflows/ci_fabric-stable.yml @@ -1,13 +1,13 @@ # 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: Gradle Build +name: Fabric CI on: push: - branches: [ master ] + branches: fabric pull_request: - branches: [ master ] + branches: fabric jobs: build: @@ -16,9 +16,9 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Fetching branches - run: | - git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + name: Fetching branches + with: + ref: ${{ on.push.branches }} - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: @@ -31,14 +31,11 @@ jobs: run: chmod +x renaming.sh - name: Running renaming script run: ./renaming.sh - - # Publishing to dev-builds branch - - name: GitHub Pages - if: success() - uses: crazy-max/ghaction-github-pages@v1.4.0 + + # Artifact upload + - name: Uploading artifacts + uses: actions/upload-artifact@v2 with: - build_dir: build/libs - target_branch: dev-builds - keep_history: false - env: - GITHUB_PAT: ${{ secrets.pat }} + #name: ${{ env.BUILDNAME }}.jar + name: UNZIP_ME_${{ env.BUILDNAME }}.zip + path: build/libs/${{ env.BUILDNAME }}.jar From b233d41639a3904cdaf0b98d9d7e61b5b8aa541c Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:06:32 +0200 Subject: [PATCH 03/10] Fix path --- .github/workflows/ci_fabric-snapshot.yml | 2 +- .github/workflows/ci_fabric-stable.yml | 2 +- .github/workflows/ci_forge.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_fabric-snapshot.yml b/.github/workflows/ci_fabric-snapshot.yml index 54e6290..37b5772 100644 --- a/.github/workflows/ci_fabric-snapshot.yml +++ b/.github/workflows/ci_fabric-snapshot.yml @@ -30,7 +30,7 @@ jobs: - name: Execute permission for renaming script run: chmod +x renaming.sh - name: Running renaming script - run: ./renaming.sh + run: ./.github/workflows/renaming.sh # Artifact upload - name: Uploading artifacts diff --git a/.github/workflows/ci_fabric-stable.yml b/.github/workflows/ci_fabric-stable.yml index 35005b6..1d7a290 100644 --- a/.github/workflows/ci_fabric-stable.yml +++ b/.github/workflows/ci_fabric-stable.yml @@ -30,7 +30,7 @@ jobs: - name: Execute permission for renaming script run: chmod +x renaming.sh - name: Running renaming script - run: ./renaming.sh + run: ./.github/workflows/renaming.sh # Artifact upload - name: Uploading artifacts diff --git a/.github/workflows/ci_forge.yml b/.github/workflows/ci_forge.yml index 9240587..899ac90 100644 --- a/.github/workflows/ci_forge.yml +++ b/.github/workflows/ci_forge.yml @@ -30,7 +30,7 @@ jobs: - name: Execute permission for renaming script run: chmod +x renaming.sh - name: Running renaming script - run: ./renaming.sh + run: ./.github/workflows/renaming.sh # Artifact upload - name: Uploading artifacts From 517f73517cb8734dca49266f1963d90d42539bc0 Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Mon, 10 Aug 2020 17:10:01 +0200 Subject: [PATCH 04/10] Name fix --- .github/workflows/ci_fabric-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_fabric-stable.yml b/.github/workflows/ci_fabric-stable.yml index 1d7a290..c0b2580 100644 --- a/.github/workflows/ci_fabric-stable.yml +++ b/.github/workflows/ci_fabric-stable.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v2 name: Fetching branches with: - ref: ${{ on.push.branches }} + ref: 'fabric' - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: From d0244c6002799425d25ebc2a3e7d6c06c46ea0e5 Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Tue, 11 Aug 2020 10:39:32 +0200 Subject: [PATCH 05/10] renaming perms path fix --- .github/workflows/ci_fabric-snapshot.yml | 2 +- .github/workflows/ci_fabric-stable.yml | 2 +- .github/workflows/ci_forge.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_fabric-snapshot.yml b/.github/workflows/ci_fabric-snapshot.yml index 37b5772..51888f7 100644 --- a/.github/workflows/ci_fabric-snapshot.yml +++ b/.github/workflows/ci_fabric-snapshot.yml @@ -28,7 +28,7 @@ jobs: - name: Build with Gradle run: ./gradlew build - name: Execute permission for renaming script - run: chmod +x renaming.sh + run: chmod +x ./.github/workflows/renaming.sh - name: Running renaming script run: ./.github/workflows/renaming.sh diff --git a/.github/workflows/ci_fabric-stable.yml b/.github/workflows/ci_fabric-stable.yml index c0b2580..5b828f7 100644 --- a/.github/workflows/ci_fabric-stable.yml +++ b/.github/workflows/ci_fabric-stable.yml @@ -28,7 +28,7 @@ jobs: - name: Build with Gradle run: ./gradlew build - name: Execute permission for renaming script - run: chmod +x renaming.sh + run: chmod +x ./.github/workflows/renaming.sh - name: Running renaming script run: ./.github/workflows/renaming.sh diff --git a/.github/workflows/ci_forge.yml b/.github/workflows/ci_forge.yml index 899ac90..7dd5103 100644 --- a/.github/workflows/ci_forge.yml +++ b/.github/workflows/ci_forge.yml @@ -28,7 +28,7 @@ jobs: - name: Build with Gradle run: ./gradlew build - name: Execute permission for renaming script - run: chmod +x renaming.sh + run: chmod +x ./.github/workflows/renaming.sh - name: Running renaming script run: ./.github/workflows/renaming.sh From cf5ebd39dfc0d81f88481b64f1c9a348ca026aba Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Tue, 11 Aug 2020 10:43:59 +0200 Subject: [PATCH 06/10] fix parsing yml on snapshot --- .github/workflows/ci_fabric-snapshot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_fabric-snapshot.yml b/.github/workflows/ci_fabric-snapshot.yml index 51888f7..74215e1 100644 --- a/.github/workflows/ci_fabric-snapshot.yml +++ b/.github/workflows/ci_fabric-snapshot.yml @@ -28,7 +28,7 @@ jobs: - name: Build with Gradle run: ./gradlew build - name: Execute permission for renaming script - run: chmod +x ./.github/workflows/renaming.sh + run: chmod +x ./.github/workflows/renaming.sh - name: Running renaming script run: ./.github/workflows/renaming.sh From 392c9c9dfe4d8ca5e6430edfc8a29d04419c95bc Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Tue, 11 Aug 2020 10:49:35 +0200 Subject: [PATCH 07/10] fixing name parsing --- .github/workflows/renaming.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/renaming.sh b/.github/workflows/renaming.sh index f54ff96..adabe26 100644 --- a/.github/workflows/renaming.sh +++ b/.github/workflows/renaming.sh @@ -1,7 +1,7 @@ #!/bin/bash # Setting the variables -projectId="$(grep 'archives_base_name' | sed 's/archives_base_name = //g;s/ //g;s/,//g;s/"//g')" +projectId="$(grep 'archives_base_name' gradle.properties | 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')" From 94fb2901faa71461ebf80d4bf0c07159285a76eb Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Tue, 11 Aug 2020 10:53:17 +0200 Subject: [PATCH 08/10] forge CI parsing --- .github/workflows/ci_forge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_forge.yml b/.github/workflows/ci_forge.yml index 7dd5103..fa7de67 100644 --- a/.github/workflows/ci_forge.yml +++ b/.github/workflows/ci_forge.yml @@ -28,7 +28,7 @@ jobs: - name: Build with Gradle run: ./gradlew build - name: Execute permission for renaming script - run: chmod +x ./.github/workflows/renaming.sh + run: chmod +x ./.github/workflows/renaming.sh - name: Running renaming script run: ./.github/workflows/renaming.sh From a86fddded9fc0d7d3c09597f2c1a7086546cc584 Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Tue, 11 Aug 2020 11:01:53 +0200 Subject: [PATCH 09/10] artifact uploading --- .github/workflows/ci_fabric-stable.yml | 46 +++++++++++++------------- .github/workflows/renaming.sh | 9 +++-- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci_fabric-stable.yml b/.github/workflows/ci_fabric-stable.yml index 5b828f7..9223d14 100644 --- a/.github/workflows/ci_fabric-stable.yml +++ b/.github/workflows/ci_fabric-stable.yml @@ -15,27 +15,27 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - name: Fetching branches - with: - ref: 'fabric' - - 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 ./.github/workflows/renaming.sh - - name: Running renaming script - run: ./.github/workflows/renaming.sh + - uses: actions/checkout@v2 + name: Fetching branches + with: + ref: 'fabric' + - 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 ./.github/workflows/renaming.sh + - name: Running renaming script + run: ./.github/workflows/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 + # 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 index adabe26..b928194 100644 --- a/.github/workflows/renaming.sh +++ b/.github/workflows/renaming.sh @@ -7,6 +7,11 @@ mcVersion="$(grep 'minecraft_version' gradle.properties | sed 's/minecraft_versi cd ./build/libs || exit -echo "Build is going to be renamed: $projectId-$version-devbuild_$GITHUB_RUN_NUMBER-MC_$mcVersion.jar" +buildName="$projectId-$version-devbuild_$GITHUB_RUN_NUMBER-MC_$mcVersion" + +echo "Build is going to be renamed: $buildName.jar" # Renaming the dev build -mv "$projectId-$version.jar" "$projectId-$version-devbuild_$GITHUB_RUN_NUMBER-MC_$mcVersion.jar" +mv "$projectId-$version.jar" "$buildName.jar" + +#Setting the buildname for GH actions +echo "::set-env name=BUILDNAME::$buildName" From cdd66e35e130b629f4957d2bb619abd75d852bd4 Mon Sep 17 00:00:00 2001 From: samo_lego <34912839+samolego@users.noreply.github.com> Date: Tue, 11 Aug 2020 11:07:34 +0200 Subject: [PATCH 10/10] double zip name fixed --- .github/workflows/ci_fabric-snapshot.yml | 2 +- .github/workflows/ci_fabric-stable.yml | 2 +- .github/workflows/ci_forge.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_fabric-snapshot.yml b/.github/workflows/ci_fabric-snapshot.yml index 74215e1..1190ccc 100644 --- a/.github/workflows/ci_fabric-snapshot.yml +++ b/.github/workflows/ci_fabric-snapshot.yml @@ -37,5 +37,5 @@ jobs: uses: actions/upload-artifact@v2 with: #name: ${{ env.BUILDNAME }}.jar - name: UNZIP_ME_${{ env.BUILDNAME }}.zip + name: UNZIP_ME_${{ env.BUILDNAME }} path: build/libs/${{ env.BUILDNAME }}.jar diff --git a/.github/workflows/ci_fabric-stable.yml b/.github/workflows/ci_fabric-stable.yml index 9223d14..00737b7 100644 --- a/.github/workflows/ci_fabric-stable.yml +++ b/.github/workflows/ci_fabric-stable.yml @@ -37,5 +37,5 @@ jobs: uses: actions/upload-artifact@v2 with: #name: ${{ env.BUILDNAME }}.jar - name: UNZIP_ME_${{ env.BUILDNAME }}.zip + name: UNZIP_ME_${{ env.BUILDNAME }} path: build/libs/${{ env.BUILDNAME }}.jar diff --git a/.github/workflows/ci_forge.yml b/.github/workflows/ci_forge.yml index fa7de67..78eeb7a 100644 --- a/.github/workflows/ci_forge.yml +++ b/.github/workflows/ci_forge.yml @@ -37,5 +37,5 @@ jobs: uses: actions/upload-artifact@v2 with: #name: ${{ env.BUILDNAME }}.jar - name: UNZIP_ME_${{ env.BUILDNAME }}.zip + name: UNZIP_ME_${{ env.BUILDNAME }} path: build/libs/${{ env.BUILDNAME }}.jar