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 43cd106
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 25 deletions.
45 changes: 28 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,44 @@ 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/mc-publish@v3.3
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 }}
# Empty name so CurseForge and Modrinth autogenerate it https://github.com/Kir-Antipov/mc-publish/blob/995edadc13559a8b28d0b7e6571229f067ec7659/README.md?plain=1#L377
name: ''
build-forge:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -57,9 +66,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 +77,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,19 +87,21 @@ 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/mc-publish@v3.3
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
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
# Empty name so CurseForge and Modrinth autogenerate it https://github.com/Kir-Antipov/mc-publish/blob/995edadc13559a8b28d0b7e6571229f067ec7659/README.md?plain=1#L377
name: ''
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
14 changes: 12 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,33 @@ 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)
# https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html
minecraft_version_range=[1.20.1]

# Fabric
fabric_loader_version=0.15.10

# Mod
mod_name=NoCubes
mod_id=nocubes
# Taken from https://semver.org
# Given a version number MAJOR.MINOR.PATCH, increment the:
# MAJOR version when you make incompatible API changes,
# MINOR version when you add functionality in a backwards-compatible manner, and
# PATCH version when you make backwards-compatible bug fixes.
# Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
# We use the format MCVERSION-MAJOR.MINOR.PATCH
mod_version=0.5.2-dev
# See "http://maven.apache.org/guides/mini/guide-naming-conventions.html"
mod_group=io.github.cadiboo.nocubes
mod_authors=Cadiboo
mod_license=LGPLv3
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 43cd106

Please sign in to comment.