CI update

This commit is contained in:
samo_lego 2020-08-10 17:01:00 +02:00
parent 885fd99723
commit 5ffbfb426e
5 changed files with 98 additions and 33 deletions

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

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

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

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

View File

@ -14,11 +14,11 @@ mod_version = 1.5.1
maven_group = org.samo_lego maven_group = org.samo_lego
archives_base_name = simpleauth archives_base_name = simpleauth
# Carpet for debugging
carpet_core_version = 1.4.0+v200623
carpet_branch = 1.16
# Hashing # Hashing
argon2_version = 2.7 argon2_version = 2.7
bcrypt_version = 0.9.0 bcrypt_version = 0.9.0
bytes_version = 1.3.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"