From 7c524b4254486229a3431e21d9a6ae1aec3b6d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?der=5Ffr=C3=BChling?= Date: Tue, 21 May 2024 20:02:44 -0700 Subject: [PATCH 1/7] workflow: update publish.yml --- .github/workflows/gradle-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index b726910..f1b4c00 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -138,7 +138,7 @@ jobs: # The USERNAME and TOKEN need to correspond to the credentials environment variables used in # the publishing section of your build.gradle - - name: Publish to GitHub Packages + - name: Publish to Modrinth run: ./gradlew :${{ matrix.loader }}:modrinth env: MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} \ No newline at end of file From 7b0dec52d1ac7a6c21436f6e26b4461dbdb8c059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?der=5Ffr=C3=BChling?= Date: Tue, 21 May 2024 20:13:48 -0700 Subject: [PATCH 2/7] workflow: don't create 4 jobs to publish to modrinth --- .github/workflows/gradle-publish.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index f1b4c00..d1b2a61 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -113,15 +113,7 @@ jobs: needs: build strategy: matrix: - include: - - branch: ${{ inputs.master-ref }} - loader: forge - - branch: ${{ inputs.master-ref }} - loader: fabric - - branch: ${{ inputs.port-19-ref }} - loader: forge - - branch: ${{ inputs.port-19-ref }} - loader: fabric + branch: [${{ inputs.master-ref }}, ${{ inputs.port-19-ref }}] steps: - uses: actions/checkout@v4 with: @@ -139,6 +131,6 @@ jobs: # The USERNAME and TOKEN need to correspond to the credentials environment variables used in # the publishing section of your build.gradle - name: Publish to Modrinth - run: ./gradlew :${{ matrix.loader }}:modrinth + run: ./gradlew modrinth env: MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} \ No newline at end of file From 387c5160aea950ad0569837d1d3ff0a8ac12f911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?der=5Ffr=C3=BChling?= Date: Tue, 21 May 2024 20:19:10 -0700 Subject: [PATCH 3/7] gradle: use root project version instead of properties --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index cd3af5e..4756441 100644 --- a/build.gradle +++ b/build.gradle @@ -54,8 +54,8 @@ allprojects { archivesName = rootProject.archives_base_name } - version = rootProject.mod_version - group = rootProject.maven_group + version = rootProject.version + group = rootProject.group repositories { maven { url = 'https://maven.tterrag.com/' } From 7f97c88b273b0ed72d14e5d93c8c720291f7e402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?der=5Ffr=C3=BChling?= Date: Tue, 21 May 2024 20:23:11 -0700 Subject: [PATCH 4/7] workflow: publish conditionally --- .github/workflows/gradle-publish.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index d1b2a61..342ba3f 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -21,6 +21,20 @@ on: default: "port-1.19.2" description: The 1.19.2 version of the mod required: true + publish-ghp: + default: "true" + description: Publish to GitHub packages + required: true + options: + - "true" + - "false" + publish-modrinth: + default: "true" + description: Publish to Modrinth + required: true + options: + - "true" + - "false" jobs: build: @@ -74,6 +88,7 @@ jobs: contents: read packages: write needs: build + if: inputs.publish-ghp == 'true' strategy: matrix: include: @@ -111,6 +126,7 @@ jobs: permissions: contents: read needs: build + if: inputs.publish-modrinth == 'true' strategy: matrix: branch: [${{ inputs.master-ref }}, ${{ inputs.port-19-ref }}] From 9cc58561479c281855b5c35b92976d8f1f60406e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?der=5Ffr=C3=BChling?= Date: Tue, 21 May 2024 20:25:03 -0700 Subject: [PATCH 5/7] workflow: update publish.yml --- .github/workflows/gradle-publish.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index 342ba3f..3daca68 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -129,7 +129,9 @@ jobs: if: inputs.publish-modrinth == 'true' strategy: matrix: - branch: [${{ inputs.master-ref }}, ${{ inputs.port-19-ref }}] + branch: + - ${{ inputs.master-ref }} + - ${{ inputs.port-19-ref }} steps: - uses: actions/checkout@v4 with: @@ -149,4 +151,4 @@ jobs: - name: Publish to Modrinth run: ./gradlew modrinth env: - MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} \ No newline at end of file + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} From c665c0515e6bdd043f9aa102509e1da64b2e139b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?der=5Ffr=C3=BChling?= Date: Tue, 21 May 2024 20:26:21 -0700 Subject: [PATCH 6/7] workflow: aha perfect --- .github/workflows/gradle-publish.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index 3daca68..7f93806 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -22,19 +22,15 @@ on: description: The 1.19.2 version of the mod required: true publish-ghp: - default: "true" + default: true description: Publish to GitHub packages required: true - options: - - "true" - - "false" + type: boolean publish-modrinth: - default: "true" + default: true description: Publish to Modrinth required: true - options: - - "true" - - "false" + type: boolean jobs: build: @@ -88,7 +84,7 @@ jobs: contents: read packages: write needs: build - if: inputs.publish-ghp == 'true' + if: inputs.publish-ghp strategy: matrix: include: @@ -126,7 +122,7 @@ jobs: permissions: contents: read needs: build - if: inputs.publish-modrinth == 'true' + if: inputs.publish-modrinth strategy: matrix: branch: From 358578afed87bfa01a6d049430577add1dfdbf25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?der=5Ffr=C3=BChling?= Date: Tue, 21 May 2024 20:29:39 -0700 Subject: [PATCH 7/7] workflow: don't upload artifact with publishing, it's really pointless --- .github/workflows/gradle-publish.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index 7f93806..1103d57 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -61,22 +61,6 @@ jobs: uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 - name: Build with Gradle run: ./gradlew build - - name: Upload Forge artifact - uses: actions/upload-artifact@v4 - with: - name: create-train-perspective-${{ inputs.version }}-forge${{ matrix.version }}.jar - path: forge/build/libs/create-train-perspective-0.4.0.jar - if-no-files-found: error - compression: 0 - overwrite: true - - name: Upload Fabric artifact - uses: actions/upload-artifact@v4 - with: - name: create-train-perspective-${{ inputs.version }}-fabric${{ matrix.version }}.jar - path: fabric/build/libs/create-train-perspective-0.4.0.jar - if-no-files-found: error - compression: 0 - overwrite: true publish-ghp: runs-on: ubuntu-latest