From 0efc19ed72cb1bd5727a2c5bdb0001892fb13dff Mon Sep 17 00:00:00 2001 From: moonleay Date: Fri, 10 May 2024 17:06:03 +0200 Subject: [PATCH] ci: updated release publish Signed-off-by: moonleay --- .forgejo/workflows/build-release.yml | 19 ------------------- build.gradle.kts | 8 +++++++- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/.forgejo/workflows/build-release.yml b/.forgejo/workflows/build-release.yml index cb86ab2..01b60ea 100644 --- a/.forgejo/workflows/build-release.yml +++ b/.forgejo/workflows/build-release.yml @@ -20,20 +20,6 @@ jobs: id: vars run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - name: Get latest git tag - id: gitvar - run: echo "tag=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT - - - name: Set git tag description - id: vars2 - run: echo "tag_desc=$(git tag -l --format='%(contents)' ${{ steps.gitvar.outputs.tag }})" >> $GITHUB_OUTPUT - - - name: Check outputs - run: echo "short ${{ steps.vars.outputs.sha_short }}, ref $GITHUB_REF, tag ${{ steps.gitvar.outputs.tag }}, tag_desc ${{ steps.vars2.outputs.tag_desc }}" - - - name: Tag descriptions - run: git tag -l --format='%(contents)' | cat - - uses: https://github.com/actions/setup-java@v4 name: Setup Java with: @@ -44,30 +30,25 @@ jobs: name: Setup Gradle env: GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }} - GIT_TAG: ${{ steps.vars2.outputs.tag_desc }} - run: ./gradlew runDatagen name: Generate assets env: GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }} - GIT_TAG: ${{ steps.vars2.outputs.tag_desc }} - run: ./gradlew build name: Build project env: GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }} - GIT_TAG: ${{ steps.vars2.outputs.tag_desc }} - run: ./gradlew publish name: Upload env: GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }} - GIT_TAG: ${{ steps.vars2.outputs.tag_desc }} PACKAGE_REPO_KEY: ${{ secrets.PACKAGE_REPO_KEY }} - run: ./gradlew modrinth name: Publish to Modrinth env: GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }} - GIT_TAG: ${{ steps.vars2.outputs.tag_desc }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index b193b86..097af80 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -217,7 +217,13 @@ modrinth { uploadFile.set(tasks.remapJar) // With Loom, this MUST be set to `remapJar` instead of `jar`! gameVersions.addAll(listOf(project.ext["minecraft.version"] as String)) // Must be an array, even with only one version loaders.add("fabric") // Must also be an array - no need to specify this if you're using Loom or ForgeGradle - changelog.set(System.getenv("GIT_TAG") ?: "Can't find git tag") + changelog.set( + "Changelog v$mavenVersion\nCheckout the changelog [here](${System.getenv("GITHUB_SERVER_URL") ?: ""}/${ + System.getenv( + "GITHUB_REPOSITORY" + ) ?: "" + }/releases/tag/${System.getenv("GITHUB_REF_NAME") ?: ""})" + ) dependencies { // A special DSL for creating dependencies // scope.type // The scope can be `required`, `optional`, `incompatible`, or `embedded`