From d86b3729110c4b0bb92386d785887053fce396c6 Mon Sep 17 00:00:00 2001 From: Octavia Togami Date: Mon, 29 Jul 2024 21:43:48 -0700 Subject: [PATCH] Only publish a version per branch/tag --- .github/workflows/gradle.yml | 2 +- gui/build.gradle.kts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index b972c10..ba58241 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -62,7 +62,7 @@ jobs: B2_APPLICATION_KEY_ID: ${{ secrets.B2_KEY_ID }} B2_APPLICATION_KEY: ${{ secrets.B2_APPLICATION_KEY }} B2_BUCKET_NAME: octy-enginehub - B2_PREFIX: ${{ github.ref_name == github.event.repository.default_branch && 'lin-bus-distributions' || format('lin-bus-distributions/{0}', github.ref_name) }} + B2_PREFIX: ${{ github.ref_type == 'tag' && 'lin-bus-distributions/@APP_VERSION@' || format('lin-bus-distributions/{0}', github.ref_name) }} run: ./gradlew :gui:uploadDistributions -s - name: "Kill Daemons Because Apparently GitHub Won't Do It For You" diff --git a/gui/build.gradle.kts b/gui/build.gradle.kts index 4a3eb20..cc8b6d9 100644 --- a/gui/build.gradle.kts +++ b/gui/build.gradle.kts @@ -127,5 +127,7 @@ tasks.register("uploadDistributions") { dependsOn(tasks.jpackage) inputDir = tasks.jpackage.map { it.jpackageData.installerOutputDir } bucketName = providers.environmentVariable("B2_BUCKET_NAME") - prefix = providers.environmentVariable("B2_PREFIX").map { "$it/$appVersionValue/$classifierValue" } + prefix = providers.environmentVariable("B2_PREFIX").map { + "${it.replace("@APP_VERSION@", appVersionValue)}/$classifierValue" + } }