From af701b21d82b735fdd03f9c561091dd6b4b482e7 Mon Sep 17 00:00:00 2001 From: soloturn Date: Mon, 3 Jan 2022 08:31:29 +0100 Subject: [PATCH] not build on tags, release already built in future currently 2 builds happen, one for the main branch, one for the tag. this should not be necessary, one build is sufficient, producing a verison including the git hash. this can be converted to a release later on, and ripme.json updated to this build. the release procedure is thus: first commit, and let it build, second, create a tag like '2.0.4' and mark the release as official, then push an updated ripme.json with the version 2.0.4-12-487e38cc to trigger clients prompting to updating ifself when it is run. --- .github/workflows/gradle.yml | 8 +++++++- src/main/java/com/rarchives/ripme/ui/UpdateUtils.java | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index b83caa07..c6aaec51 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,6 +1,12 @@ name: CI + release -on: [push, pull_request] +on: + pull_request: + push: + branches: + - '**' + tags: + - '!**' jobs: build: diff --git a/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java b/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java index b593d6ec..2fb9246c 100644 --- a/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java +++ b/src/main/java/com/rarchives/ripme/ui/UpdateUtils.java @@ -45,7 +45,14 @@ public class UpdateUtils { } private static String getUpdateJarURL(String latestVersion) { - return "https://github.com/" + REPO_NAME + "/releases/download/" + latestVersion + "/ripme-" + latestVersion + ".jar"; + // this works with a tag created in github, and thus download URLs like: + // https://github.com/ripmeapp2/ripme/releases/download/2.0.4/ripme-2.0.4-12-487e38cc.jar + return "https://github.com/" + + REPO_NAME + + "/releases/download/" + + latestVersion.substring(0, latestVersion.indexOf("-")) + + "/ripme-" + + latestVersion + ".jar"; } public static String getThisJarVersion() {