Skip to content

Commit

Permalink
Add: GitHub Action
Browse files Browse the repository at this point in the history
  • Loading branch information
xfl03 committed Feb 2, 2023
1 parent 0eaee33 commit 393f768
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 15 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Beta
on:
push:
branches:
- 'main'

jobs:
build-beta:
name: Build Beta
uses: ./.github/workflows/common.yml
with:
type: Beta
secrets: inherit
14 changes: 5 additions & 9 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
type:
required: true
type: string
publish-task:
required: false
type: string
is-snapshot:
required: false
type: boolean
Expand All @@ -34,18 +31,17 @@ jobs:
env:
IS_SNAPSHOT: ${{ inputs.is-snapshot }}
run: |
./gradlew clean build --stacktrace
./gradlew clean shadowJar --info --stacktrace
-
name: Publish
if: ${{ inputs.publish-task }}
if: ${{ !inputs.is-snapshot }}
env:
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
CURSE_TOKEN: ${{ secrets.CURSE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: |
export GIT_COMMIT_DESC=$(git log --format=%B -n 1 $GITHUB_SHA)
./gradlew ${{ inputs.publish-task }} --info --stacktrace
./gradlew curseforge modrinth --info --stacktrace
-
uses: actions/upload-artifact@v3
with:
name: CustomSkinLoader-${{ inputs.type }}-${{ github.run_number }}
name: I18nUpdateMod-${{ inputs.type }}-${{ github.run_number }}
path: build/libs
16 changes: 16 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Pull Request
on:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- 'main'

jobs:
build-pull-request:
name: Build Pull Request
uses: ./.github/workflows/common.yml
with:
type: PullRequest
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Release
on:
push:
tags:
- '*'

jobs:
build-release:
name: Build Release
uses: ./.github/workflows/common.yml
with:
type: Release
is-snapshot: false
secrets: inherit
17 changes: 11 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ plugins {
id("com.github.johnrengelman.shadow") version ("7.1.2")
id("java")
id("com.modrinth.minotaur") version "2.6.0"
id("net.galacticraft.publish.curseforge") version "1.0.1"
id("io.github.CDAGaming.cursegradle") version "1.6.0"
}

group = "i18nupdatemod"
version = "3.4.0"
version = "3.4.0" + if ("false" == System.getenv("IS_SNAPSHOT")) "" else "-SNAPSHOT"

java {
toolchain {
Expand Down Expand Up @@ -99,8 +99,13 @@ modrinth {
}

curseforge {
mainFile.set(tasks["shadowJar"])
projectId.set("297404")
releaseType.set("release")
gameVersions.set(supportMinecraftVersions)
apiKey = if (System.getenv("CURSE_TOKEN") != null) System.getenv("CURSE_TOKEN") else "dummy"
project {
id = "297404"
releaseType = "release"
mainArtifact(tasks["shadowJar"]) {
this.displayName = "I18nUpdateMod ${project.version}"
}
gameVersionStrings = supportMinecraftVersions
}
}

0 comments on commit 393f768

Please sign in to comment.