mirror of
https://codeberg.org/moonleay/Gimbal.git
synced 2025-04-11 08:54:15 +02:00
ci: added release ci
Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
parent
0d775f1252
commit
8d8e8bec1c
3 changed files with 53 additions and 6 deletions
|
@ -41,8 +41,3 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
PACKAGE_REPO_KEY: ${{ secrets.PACKAGE_REPO_KEY }}
|
PACKAGE_REPO_KEY: ${{ secrets.PACKAGE_REPO_KEY }}
|
||||||
- run: ./gradlew modrinth
|
|
||||||
name: Publish to Modrinth
|
|
||||||
env:
|
|
||||||
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
|
||||||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
|
||||||
|
|
51
.forgejo/workflows/build-release.yml
Normal file
51
.forgejo/workflows/build-release.yml
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- created
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dev:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
name: Checkout
|
||||||
|
|
||||||
|
- name: Set short git commit reference
|
||||||
|
id: vars
|
||||||
|
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Check outputs
|
||||||
|
run: echo
|
||||||
|
|
||||||
|
- uses: https://github.com/actions/setup-java@v4
|
||||||
|
name: Setup Java
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
|
||||||
|
- uses: https://github.com/gradle/actions/setup-gradle@v3
|
||||||
|
name: Setup Gradle
|
||||||
|
env:
|
||||||
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
|
|
||||||
|
- run: ./gradlew runDatagen
|
||||||
|
name: Generate assets
|
||||||
|
env:
|
||||||
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
|
|
||||||
|
- run: ./gradlew build
|
||||||
|
name: Build project
|
||||||
|
env:
|
||||||
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
|
|
||||||
|
- run: ./gradlew publish
|
||||||
|
name: Upload
|
||||||
|
env:
|
||||||
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
|
PACKAGE_REPO_KEY: ${{ secrets.PACKAGE_REPO_KEY }}
|
||||||
|
|
||||||
|
- run: ./gradlew modrinth
|
||||||
|
name: Publish to Modrinth
|
||||||
|
env:
|
||||||
|
GIT_SHA_SHORT: ${{ steps.vars.outputs.sha_short }}
|
||||||
|
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
|
@ -30,7 +30,8 @@ plugins {
|
||||||
id("com.modrinth.minotaur") version "2.+"
|
id("com.modrinth.minotaur") version "2.+"
|
||||||
}
|
}
|
||||||
|
|
||||||
val ver = System.getenv("GIT_SHA_SHORT") ?: "0.0.0"
|
val ver = if ((System.getenv("GITHUB_EVENT_NAME") ?: "local") == "release") 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-${project.ext["minecraft.version"] as String}"
|
||||||
val modId: String by project
|
val modId: String by project
|
||||||
|
|
Loading…
Add table
Reference in a new issue