wooohoo more actions

This commit is contained in:
Daniella / Tove 2024-06-08 22:45:07 +02:00
parent 38d1f25234
commit fa1ff87a22
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
5 changed files with 144 additions and 22 deletions

View file

@ -1,4 +1,9 @@
on: [push] on:
push:
paths:
- "Client/"
jobs: jobs:
make: make:
name: Build BaseBand DSM & Broadway name: Build BaseBand DSM & Broadway
@ -16,9 +21,7 @@ jobs:
- name: Initialize Gradle - name: Initialize Gradle
uses: https://github.com/gradle/actions/setup-gradle@v3 uses: https://github.com/gradle/actions/setup-gradle@v3
- name: Build - name: Build
run: ./gradlew --no-daemon Client:build run: ./gradlew --no-daemon Client:build Client:proguard Client:proguardRelease
- name: Obfuscate
run: ./gradlew --no-daemon Client:proguard
- name: Upload DSM - name: Upload DSM
uses: forgejo/upload-artifact@v4 uses: forgejo/upload-artifact@v4
with: with:
@ -29,3 +32,8 @@ jobs:
with: with:
name: BaseBand-Standalone.jar name: BaseBand-Standalone.jar
path: Client/build/proguard/BaseBand-DSM.jar path: Client/build/proguard/BaseBand-DSM.jar
- name: Upload Broadway
uses: forgejo/upload-artifact@v4
with:
name: BaseBand-Broadway.jar
path: Client/build/proguard/BaseBand-Broadway.jar

View file

@ -0,0 +1,35 @@
on:
push:
paths:
- "Loader/"
#- "Installer/"
jobs:
make:
name: Build BaseBand Loader #& Installer
runs-on: 'docker'
steps:
- name: Setup Java
uses: https://github.com/actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 8
- name: Checkout
uses: actions/checkout@v4
- name: Initialize Gradle
uses: https://github.com/gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew --no-daemon Loader:build Loader:proguard
- name: Upload Loader
uses: forgejo/upload-artifact@v4
with:
name: BaseBand-open.jar
path: Client/build/libs/BaseBand-Loader.jar
- name: Upload Obfuscated Loader
uses: forgejo/upload-artifact@v4
with:
name: BaseBand.jar
path: Client/build/proguard/BaseBand-Loader.jar

View file

@ -0,0 +1,29 @@
on:
push:
paths:
- "Server/"
jobs:
make:
name: Build BaseBand Server
runs-on: 'docker'
steps:
- name: Setup Java
uses: https://github.com/actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 8
- name: Checkout
uses: actions/checkout@v4
- name: Initialize Gradle
uses: https://github.com/gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew --no-daemon Server:build
- name: Upload Server
uses: forgejo/upload-artifact@v4
with:
name: BaseBand-Server.jar
path: Client/build/libs/BaseBand-Server.jar

View file

@ -1,3 +1,11 @@
String devName = "DSM"
String releaseName = "Broadway"
import proguard.gradle.ProGuardTask
buildscript { buildscript {
repositories { repositories {
maven { url = 'https://maven.minecraftforge.net' } maven { url = 'https://maven.minecraftforge.net' }
@ -133,36 +141,57 @@ jar {
baseName = '' baseName = ''
version = '' version = ''
classifier = 'BaseBand-DSM' classifier = "BaseBand-$devName"
} }
def proguardBuildDir = "${buildDir}/proguard" tasks.register('releaseJar', Jar) {
def proguardDir = "proguard"
task proguard(type: proguard.gradle.ProGuardTask, dependsOn: jar) { dependsOn jar
configuration "${proguardDir}/proguard.cfg"
injars jar.archiveFile
outjars "${proguardBuildDir}/BaseBand-DSM.jar"
libraryjars "${proguardDir}/rt.jar"
libraryjars configurations.jarLibs
dump "${proguardBuildDir}/dump.txt"
printmapping "${proguardBuildDir}/mapping.txt"
printconfiguration "${proguardBuildDir}/configuration.txt"
}
task releaseJar(type: Jar, dependsOn: jar) {
from(zipTree(jar.archivePath)) { from(zipTree(jar.archivePath)) {
exclude 'com/baseband/client/DevStub.class' exclude 'com/baseband/client/DevStub.class'
exclude 'com/baseband/client/DevStub.java' exclude 'com/baseband/client/DevStub.java'
exclude 'org/' exclude 'org/spongepowered'
} }
manifest.attributes ( manifest.attributes(
'ReleaseJar': 'true' 'ReleaseJar': 'true'
) )
baseName = '' baseName = ''
version = '' version = ''
classifier = 'BaseBand-Broadway' classifier = "BaseBand-$releaseName"
}
releaseJar.dependsOn(jar)
build.dependsOn(releaseJar)
def proguardBuildDir = "${buildDir}/proguard"
def proguardDir = "proguard"
tasks.register('proguard', ProGuardTask) {
dependsOn jar
configuration "${proguardDir}/proguard.cfg"
injars jar.archiveFile
outjars "${proguardBuildDir}/BaseBand-${devName}.jar"
libraryjars "${proguardDir}/rt.jar"
libraryjars configurations.jarLibs
dump "${proguardBuildDir}/dump-${devName}.txt"
printmapping "${proguardBuildDir}/mapping-${devName}.txt"
printconfiguration "${proguardBuildDir}/configuration.txt"
} }
build.dependsOn(releaseJar) tasks.register('proguardRelease', ProGuardTask) {
dependsOn tasks.releaseJar
configuration "${proguardDir}/proguard.cfg"
injars tasks.releaseJar.archiveFile
outjars "${proguardBuildDir}/BaseBand-${releaseName}.jar"
libraryjars "${proguardDir}/rt.jar"
libraryjars configurations.jarLibs
dump "${proguardBuildDir}/dump-${releaseName}.txt"
printmapping "${proguardBuildDir}/mapping-${releaseName}.txt"
printconfiguration "${proguardBuildDir}/configuration.txt"
}

View file

@ -1,3 +1,6 @@
import proguard.gradle.ProGuardTask
buildscript { buildscript {
repositories { repositories {
maven { url = 'https://maven.minecraftforge.net' } maven { url = 'https://maven.minecraftforge.net' }
@ -7,6 +10,7 @@ buildscript {
dependencies { dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.1', changing: true classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.1', changing: true
classpath "org.spongepowered:mixingradle:0.7.+" classpath "org.spongepowered:mixingradle:0.7.+"
classpath 'com.guardsquare:proguard-gradle:7.1.0'
} }
} }
@ -122,4 +126,21 @@ jar {
} { } {
exclude("mcmod.info") exclude("mcmod.info")
} }
}
def proguardBuildDir = "${buildDir}/proguard"
def proguardDir = "proguard"
tasks.register('proguard', ProGuardTask) {
dependsOn jar
configuration "${proguardDir}/proguard.cfg"
injars jar.archiveFile
outjars "${proguardBuildDir}/BaseBand-Loader.jar"
libraryjars "${proguardDir}/rt.jar"
libraryjars configurations.jarLibs
dump "${proguardBuildDir}/dump-Loader.txt"
printmapping "${proguardBuildDir}/mapping-Loader.txt"
printconfiguration "${proguardBuildDir}/configuration.txt"
} }