From ccb6431db838b6754ec8d8ce15225ec97ebdeace Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 24 Jun 2021 19:19:35 +0200 Subject: [PATCH] Switch to using reckon and github actions --- .github/workflows/gradle-build.yml | 17 +++++++----- .github/workflows/gradle-check.yml | 19 ++++++++++++++ .github/workflows/gradle-publish.yml | 24 +++++++++++++++++ .travis.yml | 17 ------------ build.gradle | 39 +++++++--------------------- gradle.properties | 6 ++--- settings.gradle | 4 +-- 7 files changed, 66 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/gradle-check.yml create mode 100644 .github/workflows/gradle-publish.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 90be5c1e..2bcd661f 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -1,16 +1,19 @@ -name: Run Gradle on push and pull request -on: +name: Build on Push +on: - push - - pull_request jobs: gradle: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - 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 - - uses: eskatos/gradle-command-action@v1 + - name: Build Gradle + uses: eskatos/gradle-command-action@v1 with: arguments: check - diff --git a/.github/workflows/gradle-check.yml b/.github/workflows/gradle-check.yml new file mode 100644 index 00000000..b0100a06 --- /dev/null +++ b/.github/workflows/gradle-check.yml @@ -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 diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml new file mode 100644 index 00000000..7122b2aa --- /dev/null +++ b/.github/workflows/gradle-publish.yml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64c0d7c4..00000000 --- a/.travis.yml +++ /dev/null @@ -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) - diff --git a/build.gradle b/build.gradle index 207d2cc3..cee1afe7 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java-library' id 'fabric-loom' version '0.8-SNAPSHOT' id 'maven-publish' + id 'org.ajoberstar.reckon' version '0.13.0' } 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 description = project.displayname archivesBaseName = project.name @@ -42,6 +20,11 @@ minecraft { accessWidener 'src/main/resources/minelp.aw' } +reckon { + scopeFromProp() + stageFromProp('beta', 'rc', 'final') +} + repositories { mavenLocal() maven { @@ -68,13 +51,13 @@ dependencies { modApi fabricApi.module("fabric-resource-loader-v0", project.fabric_version) modApi fabricApi.module("fabric-networking-v0", project.fabric_version) - modApi "com.minelittlepony:Kirin:${project.kirin_version}" - include "com.minelittlepony:Kirin:${project.kirin_version}" + modApi "com.minelittlepony:kirin:${project.kirin_version}" + include "com.minelittlepony:kirin:${project.kirin_version}" modApi "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}") } @@ -161,9 +144,7 @@ publishing { repositories { maven { name = "MineLittlePony" - def mvn = 's3://repo.minelittlepony-mod.com/maven' - url = release == 'SNAPSHOT' ? "$mvn/snapshot" : "$mvn/release" - + url = "s3://repo.minelittlepony-mod.com/maven/${version.version.stage.value.name == 'beta' ? 'snapshot' : 'release'}" credentials(AwsCredentials) { accessKey = System.env.ACCESS_KEY secretKey = System.env.SECRET_KEY diff --git a/gradle.properties b/gradle.properties index e3fa8d45..f04f5d3d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,11 +13,9 @@ org.gradle.daemon=false displayname=Mine Little Pony authors=Verdana, Rene_Z, Mumfrey, Killjoy1221, Sollace description=Mine Little Pony turns players and mobs into ponies. Press F9 ingame to access settings. - version=4.3.3 - release=SNAPSHOT # Dependencies modmenu_version=2.0.0-beta.7 - kirin_version=1.8.7-1.17 - hd_skins_version=6.4.6-1.17-rc1 + kirin_version=1.9.0-beta.2 + hd_skins_version=6.4.7-beta.1 mson_version=1.4.0-beta.4 diff --git a/settings.gradle b/settings.gradle index b65613d6..42c336a6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,6 +8,4 @@ pluginManagement { gradlePluginPortal() } } -rootProject.name = 'MineLittlePony' -//includeBuild '../Kirin' -//includeBuild '../HDSkins' \ No newline at end of file +rootProject.name = 'minelittlepony'