Skip to content

Commit

Permalink
PISS
Browse files Browse the repository at this point in the history
  • Loading branch information
62832 committed Dec 21, 2022
1 parent bdfdb05 commit 339a975
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
release:
types: [published]

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -22,10 +25,10 @@ jobs:
env:
MEGA_VERSION: ${{ github.event.release.tag_name }}
run: ./gradlew build --max-workers 1
- name: Upload Release Artifact
- name: Upload release artifacts
uses: softprops/action-gh-release@v1
with:
files: build/libs/megacells-*.jar
files: 'build/libs/megacells-*.jar'
tag_name: ${{ github.event.release.tag_name }}
- name: Upload to mod repositories
env:
Expand Down
22 changes: 17 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ subprojects {
}
}

tasks.register('collectJars', Copy) {
def tasks = [project("fabric").tasks.remapJar, project(":forge").tasks.remapJar]
dependsOn tasks

from tasks
into file("${buildDir}/libs").absolutePath
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
Expand Down Expand Up @@ -147,6 +155,10 @@ allprojects {
options.release = 17
}

assemble {
dependsOn collectJars
}

java {
withSourcesJar()
}
Expand All @@ -162,7 +174,7 @@ allprojects {
project {
gameVersions = [minecraft_version]
gameLoaders = [project.name]
version = project.name + "-" + project.version + "-" + minecraft_version
version = project.name + "-" + project.version

def loader = project.name.substring(0, 1).toUpperCase() + project.name.substring(1)
def releaseChannel = "release"
Expand All @@ -177,7 +189,7 @@ allprojects {

releaseType = releaseChannel
changelog = changes
displayName = String.format("%s (%s %s)", project.version, loader, minecraft_version)
displayName = String.format("%s (%s %s)", project.version.substring(0, project.version.indexOf("-")), loader, minecraft_version)

mainPublication remapJar // Declares the publicated jar

Expand All @@ -188,12 +200,12 @@ allprojects {
}
optional {
curseforge = "applied-energistics-2-wireless-terminals"
curseforge = "applied-botanics-addon"
modrinth = "applied-energistics-2-wireless-terminals"
}
if (project.name == "forge") {
optional {
curseforge = "applied-mekanistics"
curseforge = "applied-botanics-addon"
modrinth = "applied-mekanistics"
}
}
Expand All @@ -203,15 +215,15 @@ allprojects {
if (cfToken != null) {
curseforge {
token = cfToken
id = "622112" // Required, must be a string, ID of CurseForge project
id = "622112"
}
}

var mrToken = System.getenv("MODRINTH_TOKEN")
if (mrToken != null) {
modrinth {
token = mrToken
id = "7QZJE3uU" // Required, must be a string, ID of Modrinth project
id = "7QZJE3uU"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 339a975

Please sign in to comment.