From fb626cc082d1865857b6fa53213ccb7b90fdedf8 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sun, 9 Jun 2024 01:03:11 +0200 Subject: [PATCH] fix release pushing and some artifacts --- .forgejo/workflows/build-client.yml | 10 ++++++++-- .forgejo/workflows/build-loader.yml | 10 ++++++++-- .forgejo/workflows/build-server.yml | 8 +++++++- Loader/build.gradle | 3 +++ Server/baseband_receiver.sh | 11 +++++++++-- Server/build.gradle | 2 ++ push_broadway.sh => push_file.sh | 6 ++++-- 7 files changed, 41 insertions(+), 9 deletions(-) rename push_broadway.sh => push_file.sh (59%) diff --git a/.forgejo/workflows/build-client.yml b/.forgejo/workflows/build-client.yml index e57adc3..6f1999c 100644 --- a/.forgejo/workflows/build-client.yml +++ b/.forgejo/workflows/build-client.yml @@ -2,6 +2,7 @@ on: workflow_dispatch: push: paths: + - ".forgejo/workflows/build-client.yml" - "Client/**" @@ -22,7 +23,10 @@ jobs: - name: Initialize Gradle uses: https://github.com/gradle/actions/setup-gradle@v3 - name: Build - run: ./gradlew --no-daemon Client:build Client:proguard Client:proguardRelease + run: ./gradlew Client:build Client:proguard + - name: Build Broadway + if: github.ref == 'refs/heads/release' + run: ./gradlew Client:proguardRelease - name: Upload DSM uses: forgejo/upload-artifact@v4 with: @@ -33,7 +37,9 @@ jobs: with: name: BaseBand-DSM-Standalone.jar path: Client/build/proguard/BaseBand-DSM.jar + - name: Upload Broadway + if: github.ref == 'refs/heads/release' uses: forgejo/upload-artifact@v4 with: name: BaseBand-Broadway.jar @@ -42,5 +48,5 @@ jobs: if: github.ref == 'refs/heads/release' env: GPG_PRIVATEKEY: ${{ secrets.GPG_PRIVATEKEY }} - run: bash push_broadway.sh + run: bash push_file.sh Client/build/proguard/BaseBand-Broadway.jar 3849 diff --git a/.forgejo/workflows/build-loader.yml b/.forgejo/workflows/build-loader.yml index 42aa9ff..016dc2a 100644 --- a/.forgejo/workflows/build-loader.yml +++ b/.forgejo/workflows/build-loader.yml @@ -2,6 +2,7 @@ on: workflow_dispatch: push: paths: + - ".forgejo/workflows/build-loader.yml" - "Loader/**" #- "Installer/**" @@ -28,9 +29,14 @@ jobs: uses: forgejo/upload-artifact@v4 with: name: BaseBand-open.jar - path: Client/build/libs/BaseBand-Loader.jar + path: Loader/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 + path: Loader/build/proguard/BaseBand-Loader.jar + - name: Release to server + if: github.ref == 'refs/heads/release' + env: + GPG_PRIVATEKEY: ${{ secrets.GPG_PRIVATEKEY }} + run: bash push_file.sh Loader/build/proguard/BaseBand-Loader.jar 3848 diff --git a/.forgejo/workflows/build-server.yml b/.forgejo/workflows/build-server.yml index 47e97f4..f626dc2 100644 --- a/.forgejo/workflows/build-server.yml +++ b/.forgejo/workflows/build-server.yml @@ -2,6 +2,7 @@ on: workflow_dispatch: push: paths: + - ".forgejo/workflows/build-loader.yml" - "Server/**" @@ -27,4 +28,9 @@ jobs: uses: forgejo/upload-artifact@v4 with: name: BaseBand-Server.jar - path: Client/build/libs/BaseBand-Server.jar + path: Server/build/libs/BaseBand-Server.jar + - name: Release to server + if: github.ref == 'refs/heads/release' + env: + GPG_PRIVATEKEY: ${{ secrets.GPG_PRIVATEKEY }} + run: bash push_file.sh Server/build/proguard/BaseBand-Server.jar 3847 diff --git a/Loader/build.gradle b/Loader/build.gradle index 5fb5ac8..eca4661 100644 --- a/Loader/build.gradle +++ b/Loader/build.gradle @@ -126,6 +126,9 @@ jar { } { exclude("mcmod.info") } + + baseName = 'BaseBand' + version = 'Loader' } def proguardBuildDir = "${buildDir}/proguard" diff --git a/Server/baseband_receiver.sh b/Server/baseband_receiver.sh index 52c7b95..2ef0426 100644 --- a/Server/baseband_receiver.sh +++ b/Server/baseband_receiver.sh @@ -1,9 +1,16 @@ #!/bin/bash while true ; do - nc -lp 3849 | gpg -d --assert-signer B0F943A1A93444BFA8C030CCC36DCC0986B8748F > BaseBand-Broadway.jar.tmp 2> /dev/stdout \ + nc -lp 3849 | gpg -d --assert-signer B0F943A1A93444BFA8C030CCC36DCC0986B8748F > BaseBand-Broadway.jar.tmp 2>> baseband_receiver.log \ || continue mv BaseBand-Broadway.jar.tmp BaseBand-Broadway.jar sleep 5 -done \ No newline at end of file +done & disown +while true ; do + nc -lp 3848 | gpg -d --assert-signer B0F943A1A93444BFA8C030CCC36DCC0986B8748F > BaseBand-Loader.jar.tmp 2> baseband_receiver.log \ + || continue + + mv BaseBand-Loader.jar.tmp BaseBand-Loader.jar + sleep 5 +done & disown \ No newline at end of file diff --git a/Server/build.gradle b/Server/build.gradle index 878d8e1..3836b13 100644 --- a/Server/build.gradle +++ b/Server/build.gradle @@ -34,4 +34,6 @@ jar { 'Main-Class': 'dev.baseband.server.Main' ) } + baseName = 'BaseBand' + version = 'Server' } \ No newline at end of file diff --git a/push_broadway.sh b/push_file.sh similarity index 59% rename from push_broadway.sh rename to push_file.sh index 4efb5fa..9d87e57 100644 --- a/push_broadway.sh +++ b/push_file.sh @@ -2,8 +2,10 @@ # DO NOT RUN THIS MANUALLY. PUSH TO RELEASE INSTEAD. ( <- unless there is an emergency.) +wget https://data.tudbut.de/nc +chmod a+rx nc echo "$GPG_PRIVATEKEY" | gpg --import ( - gpg -sear BaseBand -u BaseBand < Client/build/proguard/BaseBand-Broadway.jar + gpg -sear BaseBand -u BaseBand < $1 sleep 1 -) | nc -c $BB_HOST 3849 \ No newline at end of file +) | ./nc -c $BB_HOST $2 \ No newline at end of file