Merge branch 'fabric' into fabric-snapshot

This commit is contained in:
samo_lego 2020-08-11 11:12:16 +02:00
commit 75c9908c62
7 changed files with 144 additions and 77 deletions

View File

@ -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 }}

View File

@ -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

41
.github/workflows/ci_fabric-stable.yml vendored Normal file
View File

@ -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

41
.github/workflows/ci_forge.yml vendored Normal file
View File

@ -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

17
.github/workflows/renaming.sh vendored Normal file
View File

@ -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"

View File

@ -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

View File

@ -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"