diff --git a/.github/workflows/building.yml b/.github/workflows/building.yml deleted file mode 100644 index 238b3db..0000000 --- a/.github/workflows/building.yml +++ /dev/null @@ -1,44 +0,0 @@ -# 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 - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Fetching branches - run: | - git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* - - 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 - - # Publishing to dev-builds branch - - name: GitHub Pages - if: success() - uses: crazy-max/ghaction-github-pages@v1.4.0 - with: - build_dir: build/libs - target_branch: dev-builds - keep_history: false - env: - GITHUB_PAT: ${{ secrets.pat }} diff --git a/.github/workflows/ci_fabric-snapshot.yml b/.github/workflows/ci_fabric-snapshot.yml new file mode 100644 index 0000000..1190ccc --- /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 ./.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 }} + path: build/libs/${{ env.BUILDNAME }}.jar diff --git a/.github/workflows/ci_fabric-stable.yml b/.github/workflows/ci_fabric-stable.yml new file mode 100644 index 0000000..00737b7 --- /dev/null +++ b/.github/workflows/ci_fabric-stable.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 CI + +on: + push: + branches: fabric + pull_request: + branches: fabric + +jobs: + build: + + 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 + + # Artifact upload + - name: Uploading artifacts + uses: actions/upload-artifact@v2 + with: + #name: ${{ env.BUILDNAME }}.jar + 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 new file mode 100644 index 0000000..78eeb7a --- /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 ./.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 }} + path: build/libs/${{ env.BUILDNAME }}.jar diff --git a/.github/workflows/renaming.sh b/.github/workflows/renaming.sh new file mode 100644 index 0000000..b928194 --- /dev/null +++ b/.github/workflows/renaming.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Setting the variables +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')" + +cd ./build/libs || exit + +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" "$buildName.jar" + +#Setting the buildname for GH actions +echo "::set-env name=BUILDNAME::$buildName" diff --git a/gradle.properties b/gradle.properties index a18c1fa..3e6f28f 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"