diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f567c1d..81bfd11b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -126,5 +126,6 @@ jobs: working-directory: hangar-uploader/target/ run: mv HangarUploader.jar ../../ - name: Execute HangarUploader.jar - run: java -jar HangarUploader.jar ${{ secrets.HANGAR_TOKEN }} ${{ needs.buildJars.outputs.plugin_release }} ${{ github.event.release.prerelease }} ${{ github.event.release.body }} - \ No newline at end of file + run: java -jar HangarUploader.jar ${{ secrets.HANGAR_TOKEN }} ${{ needs.buildJars.outputs.plugin_release }} ${{ github.event.release.prerelease }} + env: + GITHUB_RELEASE_BODY: ${{ github.event.release.body }} \ No newline at end of file diff --git a/hangar-uploader/src/main/java/ch/andre601/advancedserverlist/hangaruploader/GitHubRelease.java b/hangar-uploader/src/main/java/ch/andre601/advancedserverlist/hangaruploader/GitHubRelease.java deleted file mode 100644 index 51a05a2c..00000000 --- a/hangar-uploader/src/main/java/ch/andre601/advancedserverlist/hangaruploader/GitHubRelease.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * MIT License - * - * Copyright (c) 2022-2023 Andre_601 - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -package ch.andre601.advancedserverlist.hangaruploader; - -import com.google.gson.annotations.SerializedName; - -public record GitHubRelease(@SerializedName("tag_name") String tagName, String body, boolean prerelease){ -} diff --git a/hangar-uploader/src/main/java/ch/andre601/advancedserverlist/hangaruploader/HangarUploader.java b/hangar-uploader/src/main/java/ch/andre601/advancedserverlist/hangaruploader/HangarUploader.java index 6b57a3ec..d4609365 100644 --- a/hangar-uploader/src/main/java/ch/andre601/advancedserverlist/hangaruploader/HangarUploader.java +++ b/hangar-uploader/src/main/java/ch/andre601/advancedserverlist/hangaruploader/HangarUploader.java @@ -46,7 +46,6 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Path; -import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; @@ -76,9 +75,10 @@ public static void main(String[] args) throws IOException{ String apiToken = args[0]; String version = args[1].startsWith("v") ? args[1].substring(1) : args[1]; boolean isPreRelease = args[2].equalsIgnoreCase("true"); - String body = String.join(" ", Arrays.copyOfRange(args, 3, args.length)); + String body = System.getenv("GITHUB_RELEASE_BODY"); LOGGER.info("Version: {}", version); + LOGGER.info("Is Prerelease: {}", isPreRelease); LOGGER.info("Release Message: {}", body); final List filePaths = List.of(