From 5629befb5390939dc3119800e810b4a9ef701558 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Wed, 25 Mar 2026 17:44:24 +0800 Subject: [PATCH] hmcl: 3.11.2 -> 3.12.2 --- pkgs/by-name/hm/hmcl/package.nix | 4 ++-- pkgs/by-name/hm/hmcl/update.nix | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/hm/hmcl/package.nix b/pkgs/by-name/hm/hmcl/package.nix index 66280fd8c2fe..3e605a1959df 100644 --- a/pkgs/by-name/hm/hmcl/package.nix +++ b/pkgs/by-name/hm/hmcl/package.nix @@ -49,13 +49,13 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "hmcl"; - version = "3.11.2"; + version = "3.12.2"; src = fetchurl { # HMCL has built-in keys, such as the Microsoft OAuth secret and the CurseForge API key. # See https://github.com/HMCL-dev/HMCL/blob/refs/tags/release-3.6.12/.github/workflows/gradle.yml#L26-L28 url = "https://github.com/HMCL-dev/HMCL/releases/download/v${finalAttrs.version}/HMCL-${finalAttrs.version}.jar"; - hash = "sha256-Db9ly87xt6+S6dgQ0bkVvKwY9t4pMPfnebMKPFrcbhc="; + hash = "sha256-CuWueXEq77Nr6aVbXo3BJVsYU+UWwBZRz//zBToLwN0="; }; # - HMCL prompts users to download prebuilt Terracotta binary for diff --git a/pkgs/by-name/hm/hmcl/update.nix b/pkgs/by-name/hm/hmcl/update.nix index 351702bae382..4a77cb0826e9 100644 --- a/pkgs/by-name/hm/hmcl/update.nix +++ b/pkgs/by-name/hm/hmcl/update.nix @@ -18,22 +18,25 @@ writeShellApplication { ]; text = '' - # get old info - oldVersion=$(nix-instantiate --eval --strict -A "hmcl.version" | jq -e -r) - get_latest_release() { - curl --fail ''${GITHUB_TOKEN:+ -H "Authorization: bearer $GITHUB_TOKEN"} \ - -s "https://api.github.com/repos/HMCL-dev/HMCL/releases/latest" | jq -r ".tag_name" + curl -fsSL ''${GITHUB_TOKEN:+ -H "Authorization: bearer $GITHUB_TOKEN"} \ + "https://api.github.com/repos/HMCL-dev/HMCL/releases" | \ + jq -r 'map(select(.tag_name | test("^v\\d+\\.\\d+\\.\\d+$")))[0].tag_name' } version=$(get_latest_release) - version="''${version#v-}" + version="''${version#v}" - if [[ "$oldVersion" == "$version" ]]; then + if [[ "$UPDATE_NIX_OLD_VERSION" == "$version" ]]; then echo "Already up to date!" exit 0 fi + if ! curl -fsSL "https://docs.hmcl.net/changelog/stable.html" | grep -q "HMCL $version"; then + echo "Version $version found on GitHub but not yet listed in stable changelog. Skipping." + exit 0 + fi + nix-update hmcl --version="$version" update-source-version hmcl --source-key=terracottaBundleJava --ignore-same-version update-source-version hmcl --source-key=macOSProviderJava --ignore-same-version