mirror of
https://codeberg.org/moonleay/Gimbal.git
synced 2025-04-11 08:54:15 +02:00
ci: updated release ci/cd
Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
parent
e7d0e35bcf
commit
a6c6bed5be
2 changed files with 14 additions and 2 deletions
|
@ -17,6 +17,10 @@ jobs:
|
||||||
id: vars
|
id: vars
|
||||||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Set git tag description
|
||||||
|
id: vars2
|
||||||
|
run: echo "tag_desc=$(git for-each-ref --format='%(contents)' $GITHUB_REF)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Check outputs
|
- name: Check outputs
|
||||||
run: echo
|
run: echo
|
||||||
|
|
||||||
|
@ -30,25 +34,30 @@ jobs:
|
||||||
name: Setup Gradle
|
name: Setup Gradle
|
||||||
env:
|
env:
|
||||||
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
|
GIT_TAG: ${{ steps.vars2.outputs.tag_desc }}
|
||||||
|
|
||||||
- run: ./gradlew runDatagen
|
- run: ./gradlew runDatagen
|
||||||
name: Generate assets
|
name: Generate assets
|
||||||
env:
|
env:
|
||||||
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
|
GIT_TAG: ${{ steps.vars2.outputs.tag_desc }}
|
||||||
|
|
||||||
- run: ./gradlew build
|
- run: ./gradlew build
|
||||||
name: Build project
|
name: Build project
|
||||||
env:
|
env:
|
||||||
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
|
GIT_TAG: ${{ steps.vars2.outputs.tag_desc }}
|
||||||
|
|
||||||
- run: ./gradlew publish
|
- run: ./gradlew publish
|
||||||
name: Upload
|
name: Upload
|
||||||
env:
|
env:
|
||||||
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
|
GIT_TAG: ${{ steps.vars2.outputs.tag_desc }}
|
||||||
PACKAGE_REPO_KEY: ${{ secrets.PACKAGE_REPO_KEY }}
|
PACKAGE_REPO_KEY: ${{ secrets.PACKAGE_REPO_KEY }}
|
||||||
|
|
||||||
- run: ./gradlew modrinth
|
- run: ./gradlew modrinth
|
||||||
name: Publish to Modrinth
|
name: Publish to Modrinth
|
||||||
env:
|
env:
|
||||||
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
|
GIT_TAG: ${{ steps.vars2.outputs.tag_desc }}
|
||||||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
||||||
|
|
|
@ -30,10 +30,12 @@ plugins {
|
||||||
id("com.modrinth.minotaur") version "2.+"
|
id("com.modrinth.minotaur") version "2.+"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val git_ref = System.getenv("GITHUB_REF_NAME") ?: "Not found"
|
||||||
|
|
||||||
val ver = if ((System.getenv("GITHUB_REF") ?: "local").startsWith("refs/tags/"))
|
val ver = if ((System.getenv("GITHUB_REF") ?: "local").startsWith("refs/tags/"))
|
||||||
System.getenv("GITHUB_REF_NAME") ?: "err" else System.getenv("GIT_SHA_SHORT") ?: "0.0.0"
|
System.getenv("GITHUB_REF_NAME") ?: "err" else System.getenv("GIT_SHA_SHORT") ?: "0.0.0"
|
||||||
|
|
||||||
val mavenVersion = "$ver-${project.ext["minecraft.version"] as String}"
|
val mavenVersion = ver
|
||||||
val modId: String by project
|
val modId: String by project
|
||||||
val modName: String by project
|
val modName: String by project
|
||||||
|
|
||||||
|
@ -211,11 +213,12 @@ publishing {
|
||||||
modrinth {
|
modrinth {
|
||||||
token.set(System.getenv("MODRINTH_TOKEN")) // Remember to have the MODRINTH_TOKEN environment variable set or else this will fail - just make sure it stays private!
|
token.set(System.getenv("MODRINTH_TOKEN")) // Remember to have the MODRINTH_TOKEN environment variable set or else this will fail - just make sure it stays private!
|
||||||
projectId.set(modId) // This can be the project ID or the slug. Either will work!
|
projectId.set(modId) // This can be the project ID or the slug. Either will work!
|
||||||
versionNumber.set(System.getenv(mavenVersion)) // You don't need to set this manually. Will fail if Modrinth has this version already
|
versionNumber.set("$modName ${System.getenv(mavenVersion)} for $minecraftVersion") // You don't need to set this manually. Will fail if Modrinth has this version already
|
||||||
versionType.set("alpha") // This is the default -- can also be `beta` or `alpha`
|
versionType.set("alpha") // This is the default -- can also be `beta` or `alpha`
|
||||||
uploadFile.set(tasks.remapJar) // With Loom, this MUST be set to `remapJar` instead of `jar`!
|
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
|
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
|
loaders.add("fabric") // Must also be an array - no need to specify this if you're using Loom or ForgeGradle
|
||||||
|
description = System.getenv("GIT_TAG") ?: "Could not get tag description"
|
||||||
dependencies { // A special DSL for creating dependencies
|
dependencies { // A special DSL for creating dependencies
|
||||||
// scope.type
|
// scope.type
|
||||||
// The scope can be `required`, `optional`, `incompatible`, or `embedded`
|
// The scope can be `required`, `optional`, `incompatible`, or `embedded`
|
||||||
|
|
Loading…
Add table
Reference in a new issue