Skip to content

Commit

Permalink
Fix publishing
Browse files Browse the repository at this point in the history
[ci publish]
  • Loading branch information
Cadiboo committed Jun 14, 2024
1 parent 792d6cf commit e6472ef
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 25 deletions.
41 changes: 24 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Build
on: [push, workflow_dispatch]
on:
push:
branches: ['*']
workflow_dispatch: {}
jobs:
build-fabric:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -13,40 +18,42 @@ jobs:
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build and check (fabric)
- name: Build and check
run: ./gradlew :fabric:build --stacktrace
- name: Archive development jars (fabric)
- name: Archive development jars
uses: actions/upload-artifact@v4
with:
name: Development jars inside (fabric)
path: |
fabric/build/devlibs/*.jar
if-no-files-found: error
- name: Archive playable jar (fabric)
- name: Archive playable jar
uses: actions/upload-artifact@v4
with:
name: Playable mod jar inside (fabric)
path: |
fabric/build/libs/*.jar
if-no-files-found: error
- name: Integration tests (forge)
- name: Integration tests
run: ./gradlew :fabric:runGameTestServer --stacktrace
- name: Publish
uses: Kir-Antipov/[email protected]
if: "contains(github.event.head_commit.message, '[ci publish]')"
with:
version-type: beta
files: fabric/build/libs/*.jar
files: fabric/build/libs/!(*-@(sources|dev|dev-shadow|javadoc).jar)
github-token: ${{ secrets.GITHUB_TOKEN }}
github-commitish: ${{ env.GITHUB_SHA }}
github-files-primary: fabric/build/libs/*.jar
github-files-secondary: fabric/build/devlibs/*.jar
github-commitish: ${{ github.sha }}
github-generate-changelog: true
changelog: https://github.com/Cadiboo/NoCubes/releases
curseforge-id: 309664
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
modrinth-id: w3bbwFYU
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
build-forge:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -57,9 +64,9 @@ jobs:
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build and check (forge)
- name: Build and check
run: ./gradlew :forge:build --stacktrace
- name: Archive development jars (forge)
- name: Archive development jars
uses: actions/upload-artifact@v4
with:
name: Development jars inside (forge)
Expand All @@ -68,7 +75,7 @@ jobs:
forge/build/libs/*-sources.jar
forge/build/libs/*-javadoc.jar
if-no-files-found: error
- name: Archive playable jar (forge)
- name: Archive playable jar
uses: actions/upload-artifact@v4
with:
name: Playable mod jar inside (forge)
Expand All @@ -78,18 +85,18 @@ jobs:
!forge/build/libs/*-sources.jar
!forge/build/libs/*-javadoc.jar
if-no-files-found: error
- name: Integration tests (forge)
- name: Integration tests
run: ./gradlew :forge:runGameTestServer --stacktrace
- name: Publish
uses: Kir-Antipov/[email protected]
if: "contains(github.event.head_commit.message, '[ci publish]')"
with:
version-type: beta
files: forge/build/libs/!(*-@(dev|sources|javadoc)).jar
files: forge/build/libs/!(*-@(sources|dev|dev-shadow|javadoc).jar)
github-token: ${{ secrets.GITHUB_TOKEN }}
github-commitish: ${{ env.GITHUB_SHA }}
github-files-primary: forge/build/libs/!(*-@(dev|sources|javadoc)).jar
github-files-secondary: forge/build/libs/*-@(dev|sources|javadoc).jar
github-commitish: ${{ github.sha }}
github-generate-changelog: true
changelog: https://github.com/Cadiboo/NoCubes/releases
curseforge-id: 309664
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
modrinth-id: w3bbwFYU
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ String execCmd(List<String> params, String fallback) {
return result.getExitValue() != 0 ? fallback : stdout.toString().trim()
}

// We use the version format MAJOR.MINOR.PATCH-COMMIT
version = "${mod_version}-${execCmd(['git', 'rev-parse', '--short', 'HEAD'], 'nogit')}"
// We use the version format MCVERSION-MAJOR.MINOR.PATCH-COMMIT
version = "${minecraft_version}-${mod_version}-${execCmd(['git', 'rev-parse', '--short', 'HEAD'], 'nogit')}"
group = mod_group

ext {
Expand Down
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id 'org.spongepowered.gradle.vanilla'
}
base {
archivesName = "${mod_name}-common-${minecraft_version}"
archivesName = "${mod_name}-common"
}
minecraft {
version(minecraft_version)
Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
base {
archivesName = "${mod_name}-fabric-${minecraft_version}"
archivesName = "${mod_name}-fabric"
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
Expand Down
2 changes: 1 addition & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
base {
archivesName = "${mod_name}-forge-${minecraft_version}"
archivesName = "${mod_name}-forge"
}
mixin {
add(sourceSets.main, "${mod_id}.refmap.json")
Expand Down
2 changes: 1 addition & 1 deletion forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ displayURL="${mod_homepage_url}"
logoFile="${mod_id}.png"
credits="${mod_credits}"
authors="${mod_authors}"
description='''${mod_description}'''
description="${mod_description}"
# Disable Sodium/Rubidium's chunk rendering optimisations because they break our chunk rendering
[mods."sodium:options"]
"features.chunk_rendering"=false
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ minecraft_version=1.20.1
forge_version=47.2.30
forge_loader_version_range=[47,)
forge_version_range=[47,)
minecraft_version_range=[1.20.1, 1.21)
minecraft_version_range=[1.20.1,)

# Fabric
fabric_loader_version=0.15.10
Expand All @@ -21,7 +21,8 @@ mod_issue_tracker_url=https://github.com/Cadiboo/NoCubes/issues
mod_update_json_url=https://cadiboo.github.io/projects/nocubes/update.json
mod_homepage_url=https://cadiboo.github.io/projects/nocubes
mod_credits=Thanks to Click_Me for the original mod, ComsicDan for reverse-engineering it and Cadiboo for making & maintaining the mod for 1.12.2+
mod_description=NoCubes is a mod by Cadiboo for 1.12.2+ that creates smooth terrain in Minecraft.\nIt is the spiritual successor of the NoCubes mod by Click_Me for 1.7.10.
# Newlines need to be double escaped!
mod_description=NoCubes is a mod by Cadiboo for 1.12.2+ that creates smooth terrain in Minecraft.\\nIt is the spiritual successor of the NoCubes mod by Click_Me for 1.7.10.

# Gradle
org.gradle.jvmargs=-Xmx3G
Expand Down

0 comments on commit e6472ef

Please sign in to comment.