20w18a and workflow update

This commit is contained in:
samo_lego 2020-04-30 10:28:48 +02:00
parent eb927bbf37
commit b726b65e9e
4 changed files with 77 additions and 30 deletions

44
.github/workflows/building.yml vendored Normal file
View File

@ -0,0 +1,44 @@
# 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

@ -1,26 +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: Java CI with Gradle
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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

View File

@ -2,12 +2,12 @@
org.gradle.jvmargs=-Xmx1G
# Fabric properties
minecraft_version=20w17a
yarn_mappings=20w17a+build.2
minecraft_version=20w18a
yarn_mappings=20w18a+build.1
loader_version=0.8.2+build.194
#Fabric api
fabric_version=0.6.2+build.327-1.16
fabric_version=0.7.0+build.330-1.16
# Mod Properties
mod_version = 1.4.1
@ -15,4 +15,4 @@ fabric_version=0.6.2+build.327-1.16
archives_base_name = simpleauth
# Carpet for debugging
carpet_core_version = 1.3.20+v200422
carpet_core_version = 1.3.21+v200429

29
renaming.sh Normal file
View File

@ -0,0 +1,29 @@
#!/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
projectName="`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 | grep -o '[0-9]*\.[0-9]*\.[0-9]*'`"
cd ./build/libs
echo "Build is going to be renamed: $projectName-$version-devbuild_$GITHUB_RUN_NUMBER-MC_$mcVersion.jar"
# Renaming the dev build
mv "$projectName-$version.jar" "$projectName-$version-devbuild_$GITHUB_RUN_NUMBER-MC_$mcVersion.jar"