From 2a3596cbcf5b59112638f72cb29c649a29deb5b3 Mon Sep 17 00:00:00 2001 From: hyper Date: Thu, 28 Dec 2023 15:06:53 -0500 Subject: [PATCH] Add auto publish. --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++------------ build.gradle | 2 +- gradle.properties | 2 +- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5adf394..a4da51a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,21 +1,23 @@ -# Automatically build the project and run any configured tests for every push -# and submitted pull request. This can help catch issues that only occur on -# certain platforms or Java versions, and provides a first line of defence -# against bad commits. - name: build -on: [pull_request, push] +on: [push] + +permissions: + contents: write + +env: + MINECRAFT_VERSION: 1.20.4 + JAVA_VERSION: 17 + VERSION: 0.5.0+1.20.4 + RELEASE_NAME: PotatoesPlus-BETA jobs: build: strategy: matrix: - # Use these Java versions java: [ - 17, # Current Java LTS & minimum supported by Minecraft - 21, # Current Java LTS + 17, + 21, ] - # and run on both Linux and Windows os: [ubuntu-22.04, windows-2022] runs-on: ${{ matrix.os }} steps: @@ -34,8 +36,18 @@ jobs: - name: build run: ./gradlew build - name: capture build artifacts - if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS + if: ${{ runner.os == 'Linux' && matrix.java == '21' }} uses: actions/upload-artifact@v3 with: name: Artifacts - path: build/libs/ \ No newline at end of file + path: build/libs/ + - name: mc-publish + uses: Kir-Antipov/mc-publish@v3.2 + with: + name: "${{env.RELEASE_NAME}}" + version: "${{env.VERSION}}" + version-type: beta + github-token: ${{ secrets.TOKEN }} + loaders: fabric + game-versions: "${{env.MINECRAFT_VERSION}}" + java: "${{env.JAVA_VERSION}}" diff --git a/build.gradle b/build.gradle index 5403517..40fc251 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ loom { splitEnvironmentSourceSets() mods { - "modid" { + "potatoesplus" { sourceSet sourceSets.main sourceSet sourceSets.client } diff --git a/gradle.properties b/gradle.properties index a42c769..b33bdca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ loader_version=0.15.0 mod_version=1.0.0 modid=potatoes maven_group=me.hyper -archives_base_name=modid +archives_base_name=potatoesplus # Dependencies fabric_version=0.91.1+1.20.4 \ No newline at end of file