Switch to using reckon and github actions

This commit is contained in:
Sollace 2021-06-24 19:19:35 +02:00
parent 775b140561
commit ccb6431db8
7 changed files with 66 additions and 60 deletions

View file

@ -1,16 +1,19 @@
name: Run Gradle on push and pull request name: Build on Push
on: on:
- push - push
- pull_request
jobs: jobs:
gradle: gradle:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - name: Checkout Commit
- uses: actions/setup-java@v1 uses: actions/checkout@v2
- name: Fetch Tags
run: git fetch --unshallow --tags -f
- name: Set up JDK
uses: actions/setup-java@v1
with: with:
java-version: 16 java-version: 16
- uses: eskatos/gradle-command-action@v1 - name: Build Gradle
uses: eskatos/gradle-command-action@v1
with: with:
arguments: check arguments: check

19
.github/workflows/gradle-check.yml vendored Normal file
View file

@ -0,0 +1,19 @@
name: Build on Pull Request
on:
- pull_request
jobs:
gradle:
runs-on: ubuntu-latest
steps:
- name: Checkout Commit
uses: actions/checkout@v2
- name: Fetch Tags
run: git fetch --unshallow --tags -f
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 16
- name: Build Gradle
uses: eskatos/gradle-command-action@v1
with:
arguments: check

24
.github/workflows/gradle-publish.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Publish To Maven
on:
release:
types: [created]
jobs:
gradle:
runs-on: ubuntu-latest
steps:
- name: Checkout Commit
uses: actions/checkout@v2
- name: Fetch Tags
run: git fetch --unshallow --tags -f
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 16
- name: Publish Maven Jar
env:
ACCESS_KEY: ${{ secrets.ACCESS_KEY }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: eskatos/gradle-command-action@v1
with:
arguments: build publish

View file

@ -1,17 +0,0 @@
language: java
jdk:
- openjdk16
jobs:
include:
- stage: check
script: ./gradlew check
- stage: publish
script: ./gradlew build publish
stages:
- name: check
if: type IN (pull_request)
- name: publish
if: NOT type IN (pull_request)

View file

@ -2,6 +2,7 @@ plugins {
id 'java-library' id 'java-library'
id 'fabric-loom' version '0.8-SNAPSHOT' id 'fabric-loom' version '0.8-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
id 'org.ajoberstar.reckon' version '0.13.0'
} }
java { java {
@ -10,29 +11,6 @@ java {
} }
} }
def createVersion() {
def parts = []
if (project.release != 'RELEASE') {
parts.push project.release
}
def branch = System.env.TRAVIS_BRANCH
if (branch != null && branch != 'master' && !project.minecraft_version.startsWith(branch)) {
parts.push branch
}
parts.push project.minecraft_version
def ver = project.version
if (parts.size > 0) {
return ver + '-' + parts.join('-')
}
return ver
}
version = createVersion()
group = project.group group = project.group
description = project.displayname description = project.displayname
archivesBaseName = project.name archivesBaseName = project.name
@ -42,6 +20,11 @@ minecraft {
accessWidener 'src/main/resources/minelp.aw' accessWidener 'src/main/resources/minelp.aw'
} }
reckon {
scopeFromProp()
stageFromProp('beta', 'rc', 'final')
}
repositories { repositories {
mavenLocal() mavenLocal()
maven { maven {
@ -68,13 +51,13 @@ dependencies {
modApi fabricApi.module("fabric-resource-loader-v0", project.fabric_version) modApi fabricApi.module("fabric-resource-loader-v0", project.fabric_version)
modApi fabricApi.module("fabric-networking-v0", project.fabric_version) modApi fabricApi.module("fabric-networking-v0", project.fabric_version)
modApi "com.minelittlepony:Kirin:${project.kirin_version}" modApi "com.minelittlepony:kirin:${project.kirin_version}"
include "com.minelittlepony:Kirin:${project.kirin_version}" include "com.minelittlepony:kirin:${project.kirin_version}"
modApi "com.minelittlepony:mson:${project.mson_version}" modApi "com.minelittlepony:mson:${project.mson_version}"
include "com.minelittlepony:mson:${project.mson_version}" include "com.minelittlepony:mson:${project.mson_version}"
modImplementation "com.minelittlepony:HDSkins:${project.hd_skins_version}" modImplementation "com.minelittlepony:hdskins:${project.hd_skins_version}"
modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}") modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")
} }
@ -161,9 +144,7 @@ publishing {
repositories { repositories {
maven { maven {
name = "MineLittlePony" name = "MineLittlePony"
def mvn = 's3://repo.minelittlepony-mod.com/maven' url = "s3://repo.minelittlepony-mod.com/maven/${version.version.stage.value.name == 'beta' ? 'snapshot' : 'release'}"
url = release == 'SNAPSHOT' ? "$mvn/snapshot" : "$mvn/release"
credentials(AwsCredentials) { credentials(AwsCredentials) {
accessKey = System.env.ACCESS_KEY accessKey = System.env.ACCESS_KEY
secretKey = System.env.SECRET_KEY secretKey = System.env.SECRET_KEY

View file

@ -13,11 +13,9 @@ org.gradle.daemon=false
displayname=Mine Little Pony displayname=Mine Little Pony
authors=Verdana, Rene_Z, Mumfrey, Killjoy1221, Sollace authors=Verdana, Rene_Z, Mumfrey, Killjoy1221, Sollace
description=Mine Little Pony turns players and mobs into ponies. Press F9 ingame to access settings. description=Mine Little Pony turns players and mobs into ponies. Press F9 ingame to access settings.
version=4.3.3
release=SNAPSHOT
# Dependencies # Dependencies
modmenu_version=2.0.0-beta.7 modmenu_version=2.0.0-beta.7
kirin_version=1.8.7-1.17 kirin_version=1.9.0-beta.2
hd_skins_version=6.4.6-1.17-rc1 hd_skins_version=6.4.7-beta.1
mson_version=1.4.0-beta.4 mson_version=1.4.0-beta.4

View file

@ -8,6 +8,4 @@ pluginManagement {
gradlePluginPortal() gradlePluginPortal()
} }
} }
rootProject.name = 'MineLittlePony' rootProject.name = 'minelittlepony'
//includeBuild '../Kirin'
//includeBuild '../HDSkins'