Skip to content

Commit

Permalink
Build fix and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurocosh committed Jun 9, 2024
1 parent 6b992c0 commit c414fab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 54 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:

runs-on: ubuntu-latest
permissions:
# contents: read
contents: write

steps:
Expand Down Expand Up @@ -52,29 +51,24 @@ jobs:
uses: Kir-Antipov/[email protected]
with:
loaders: forge
# version-type: beta
version: ${{ steps.build.outputs.version }}
version-type: ${{ steps.build.outputs.release_type }}
game-versions: 1.12.2
java: Java 1.8
changelog: ${{ github.event.head_commit.message }}

# Only include this section if you wish to publish
# your assets on Modrinth.
# Modrinth publishing
# modrinth-id: AANobbMI
# modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

# Only include this section if you wish to publish
# your assets on CurseForge.
# CurseForge publishing
curseforge-id: 322571
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

# Only include this section if you wish to publish
# your assets on GitHub.
# github-token: ${{ secrets.GITHUB_TOKEN }}

# GitHub publishing
github-tag: ${{ steps.build.outputs.github_tag }}
github-generate-changelog: true
github-prerelease: false
github-token: ${{ secrets.GITHUB_TOKEN }}

files: build/libs/!(*-@(dev|sources|all)).jar
Expand All @@ -99,7 +93,7 @@ jobs:
# run: gradle build

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: divine-favor
path: build/libs
43 changes: 0 additions & 43 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ def localDependencies = getEnvVar('LOCAL_DEPENDENCIES').toBoolean()

println "Mod version: $version"
println "Release type: $release_type"
println "Local dependencies: $localDependencies"
//println generateChangeLog('release')

group = mod_group
archivesBaseName = mod_archives_base_name
Expand Down Expand Up @@ -117,9 +115,6 @@ dependencies {

// Patchouli
implementation rfg.deobf("vazkii.patchouli:Patchouli:${p_version}")

// if (!localDependencies)
// implementation "aurocosh.autonetworklib:autonetworklib-${mc_sub_version}:${auto_network_version}"
}

processResources {
Expand All @@ -141,25 +136,6 @@ static def generateVersionCode() {
return shExec("git rev-list HEAD --count").toInteger()
}

//static def getReleaseType() {
// def tags = shExec("git notes show", true, true)
// def isRelease = tags.contains('release')
// (isRelease) ? "release" : "beta"
//}

static def generateChangeLog(releaseType) {
def currentChange = shExec("git log --format=%B -n 1 HEAD")
if (releaseType == 'beta')
return currentChange

def logWithNotes = shExec("git log origin/master --format=%H_%N")
def matches = logWithNotes =~ '([0-9a-f]{5,40})_.*release'
def lastReleaseHash = matches[1][1]

def logFromPreviousBetas = shExec("git log --format=%s $lastReleaseHash..HEAD~1", true)
return "Last change:\n$currentChange\n\nChangelog from previous beta versions:\n$logFromPreviousBetas"
}

static def shExec(command, ignoreEmptyResult = false, ignoreErrors = false) {
if (OperatingSystem.current().isLinux())
command = command.replaceAll('"', '\\\\"')
Expand All @@ -181,24 +157,6 @@ static def getEnvVar(varName,fallback = '') {
return value ? value : fallback
}

curseforge {
apiKey = getEnvVar('CURSEFORGE_API_KEY')
project {
id = curse_project_id
changelog = generateChangeLog(release_type)
releaseType = release_type
relations {
requiredDependency 'forgelin_continuous'
requiredDependency 'patchouli'
optionalDependency 'jei'
optionalDependency 'crafttweaker'
optionalDependency 'mtlib'
optionalDependency 'max-potion-id-extender'
}
}
}


idea {
module {
inheritOutputDirs true
Expand Down Expand Up @@ -246,7 +204,6 @@ tasks.named("processIdeaSettings").configure {
tasks.register('printToGitHubActions') {
onlyIf { System.getenv().GITHUB_OUTPUT }
doLast {
// same as those in mc-publish
FileWriter fw = new FileWriter(System.getenv().GITHUB_OUTPUT)
fw.write("version=${project.version}\n")
fw.write("game_versions=${project.minecraft.version}\n")
Expand Down

0 comments on commit c414fab

Please sign in to comment.