cockpit-zfs, fzf-zsh-plugin, jmc2obj, melos: add update script and update (#499297)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
{
|
||||
acl,
|
||||
bash,
|
||||
buildPackages,
|
||||
cockpit,
|
||||
coreutils,
|
||||
fetchFromGitHub,
|
||||
@@ -13,6 +14,7 @@
|
||||
makeWrapper,
|
||||
mbuffer,
|
||||
msmtp,
|
||||
nix-update-script,
|
||||
nodejs,
|
||||
openssh,
|
||||
samba,
|
||||
@@ -28,19 +30,20 @@
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "cockpit-zfs";
|
||||
version = "1.2.12-2";
|
||||
version = "1.2.16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "45Drives";
|
||||
repo = "cockpit-zfs";
|
||||
tag = "v${finalAttrs.version}";
|
||||
fetchSubmodules = true;
|
||||
hash = "sha256-oeXSOxogfAazRsKfngq2+DOyo//wRJQSqm7gaCza4WY=";
|
||||
hash = "sha256-d1wurTha4LIe01oogJZHfLdTvBnEsNG9sGO8CfyS+GE=";
|
||||
};
|
||||
|
||||
missingHashes = ./missing-hashes.json;
|
||||
|
||||
offlineCache = yarn-berry.fetchYarnBerryDeps {
|
||||
# Use buildPackages for cross-compilation support
|
||||
offlineCache = buildPackages.yarn-berry.fetchYarnBerryDeps {
|
||||
inherit (finalAttrs) src missingHashes;
|
||||
hash = "sha256-YnR1SqBGnxEQaGUGMNTHHEGcOIhuGbWnqMdr4eRGXcA=";
|
||||
};
|
||||
@@ -50,9 +53,13 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
nodejs
|
||||
jq
|
||||
yarn-berry
|
||||
yarn-berry.yarnBerryConfigHook
|
||||
buildPackages.yarn-berry.yarnBerryConfigHook
|
||||
];
|
||||
|
||||
disallowedRequisites = [ finalAttrs.offlineCache ];
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
passthru.cockpitPath = [
|
||||
acl
|
||||
bash
|
||||
@@ -82,7 +89,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
||||
};
|
||||
|
||||
patchPhase =
|
||||
postPatch =
|
||||
let
|
||||
# houston-common-lib has @types/electron which pulls in electron.
|
||||
# Electron's postinstall downloads binaries, which fails in sandbox.
|
||||
@@ -91,8 +98,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
houstonUiDir = "houston-common/houston-common-ui";
|
||||
in
|
||||
''
|
||||
runHook prePatch
|
||||
|
||||
# Remove electron type dependency
|
||||
substituteInPlace ${houstonLibDir}/package.json \
|
||||
--replace-fail '"@types/electron": "^1.6.12",' ""
|
||||
@@ -116,8 +121,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
--replace-fail "VueDevTools()," "" \
|
||||
--replace-fail "import dts from 'vite-plugin-dts'" ""
|
||||
sed -i '/dts({/,/})/d' ${houstonUiDir}/vite.config.ts
|
||||
|
||||
runHook postPatch
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
|
||||
@@ -3,18 +3,19 @@
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
unstableGitUpdater,
|
||||
zsh,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "fzf-zsh-plugin";
|
||||
version = "1.0.0-unstable-2025-12-15";
|
||||
version = "1.0.0-unstable-2026-03-03";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "unixorn";
|
||||
repo = "fzf-zsh-plugin";
|
||||
rev = "cdd9d5cc3b41a3a390a0fb8605c40de652da6309";
|
||||
hash = "sha256-i6qoaMWVofhD3K6/RaaNatzA2aokiNQ5ilqmahprJFU=";
|
||||
rev = "d56d2387ce376f80e42c46654a9ee1f899a40b46";
|
||||
hash = "sha256-twry9z9gDvRfH3AOWEV/a9HX4pnlMJDSw74Sm/MBwIk=";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
@@ -33,6 +34,8 @@ stdenv.mkDerivation {
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = unstableGitUpdater { tagPrefix = "v"; };
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/unixorn/fzf-zsh-plugin";
|
||||
description = "ZSH plugin to enable fzf searches of a lot more stuff - docker, tmux, homebrew and more";
|
||||
|
||||
@@ -4,20 +4,21 @@
|
||||
jre,
|
||||
makeWrapper,
|
||||
maven,
|
||||
nix-update-script,
|
||||
}:
|
||||
|
||||
maven.buildMavenPackage rec {
|
||||
pname = "j-mc-2-obj";
|
||||
version = "126";
|
||||
version = "128";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jmc2obj";
|
||||
repo = "j-mc-2-obj";
|
||||
rev = version;
|
||||
hash = "sha256-c0qLryv9Gx9BlKXmwSKkK5/v3Wypny841htNfsNNxpg=";
|
||||
tag = version;
|
||||
hash = "sha256-3+vH1pGJ6I4oobb2vk+J5GrOQrSLNoCuBIC9OsWYCj0=";
|
||||
};
|
||||
|
||||
mvnHash = "sha256-ya8E/6tOxyW+AO7v9p0dg72qFpQjWwvntZOw+TEKq0k=";
|
||||
mvnHash = "sha256-ZU/5RGujCdmlBuxtHDaBpF/54e8W/Kca+2jtTudMXWo=";
|
||||
|
||||
mvnParameters = "-Dmaven.gitcommitid.skip=true";
|
||||
|
||||
@@ -33,6 +34,8 @@ maven.buildMavenPackage rec {
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = nix-update-script { };
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/jmc2obj/j-mc-2-obj/releases/tag/${version}";
|
||||
description = "Java-based Minecraft-to-OBJ exporter";
|
||||
|
||||
@@ -3,18 +3,15 @@
|
||||
fetchFromGitHub,
|
||||
buildDartApplication,
|
||||
}:
|
||||
let
|
||||
version = "7.3.0";
|
||||
buildDartApplication (finalAttrs: {
|
||||
pname = "melos";
|
||||
version = "7.4.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "invertase";
|
||||
repo = "melos";
|
||||
tag = "melos-v${version}";
|
||||
hash = "sha256-XTEhH8F54BoXJ1QNhUIZszHQoDwP0Za1LPQ6Dv9sR08=";
|
||||
tag = "melos-v${finalAttrs.version}";
|
||||
hash = "sha256-bsNPZd1euOKF2LlAmBIkr+0iO51iAkcIZYrd5oUJTKo=";
|
||||
};
|
||||
in
|
||||
buildDartApplication {
|
||||
pname = "melos";
|
||||
inherit version src;
|
||||
|
||||
patches = [
|
||||
# Patch melos entrypoint to bypass cli_launcher which throws because it does not find melos in the "classic" folders eg : .dart_tool or pub cache.
|
||||
@@ -34,6 +31,16 @@ buildDartApplication {
|
||||
cp --recursive packages/melos/templates $out/
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
updateScript = {
|
||||
command = [
|
||||
./update.sh
|
||||
./.
|
||||
];
|
||||
supportedFeatures = [ "commit" ];
|
||||
};
|
||||
};
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/invertase/melos";
|
||||
description = "Tool for managing Dart projects with multiple packages";
|
||||
@@ -41,4 +48,4 @@ buildDartApplication {
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = [ lib.maintainers.eymeric ];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "_fe_analyzer_shared",
|
||||
"sha256": "c209688d9f5a5f26b2fb47a188131a6fb9e876ae9e47af3737c0b4f58a93470d",
|
||||
"sha256": "3b19a47f6ea7c2632760777c78174f47f6aec1e05f0cd611380d4593b8af1dbc",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "91.0.0"
|
||||
"version": "96.0.0"
|
||||
},
|
||||
"analyzer": {
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "analyzer",
|
||||
"sha256": "f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08",
|
||||
"sha256": "0c516bc4ad36a1a75759e54d5047cb9d15cded4459df01aa35a0b5ec7db2c2a0",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "8.4.1"
|
||||
"version": "10.2.0"
|
||||
},
|
||||
"ansi_styles": {
|
||||
"dependency": "transitive",
|
||||
@@ -64,11 +64,11 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "build",
|
||||
"sha256": "dfb67ccc9a78c642193e0c2d94cb9e48c2c818b3178a86097d644acdcde6a8d9",
|
||||
"sha256": "275bf6bb2a00a9852c28d4e0b410da1d833a734d57d39d44f94bfc895a484ec3",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "4.0.2"
|
||||
"version": "4.0.4"
|
||||
},
|
||||
"built_collection": {
|
||||
"dependency": "transitive",
|
||||
@@ -84,11 +84,11 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "built_value",
|
||||
"sha256": "a30f0a0e38671e89a492c44d005b5545b830a961575bbd8336d42869ff71066d",
|
||||
"sha256": "6ae8a6435a8c6520c7077b107e77f1fb4ba7009633259a4d49a8afd8e7efc5e9",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "8.12.0"
|
||||
"version": "8.12.4"
|
||||
},
|
||||
"charcode": {
|
||||
"dependency": "transitive",
|
||||
@@ -124,11 +124,11 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "cli_launcher",
|
||||
"sha256": "17d2744fb9a254c49ec8eda582536abe714ea0131533e24389843a4256f82eac",
|
||||
"sha256": "35cf15a3ffaeb9c11849eaa0afba761bb76dceb42d050532bfd3e1299c9748cd",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "0.3.2+1"
|
||||
"version": "0.3.3+1"
|
||||
},
|
||||
"cli_util": {
|
||||
"dependency": "transitive",
|
||||
@@ -144,11 +144,11 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "code_builder",
|
||||
"sha256": "11654819532ba94c34de52ff5feb52bd81cba1de00ef2ed622fd50295f9d4243",
|
||||
"sha256": "6a6cab2ba4680d6423f34a9b972a4c9a94ebe1b62ecec4e1a1f2cba91fd1319d",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "4.11.0"
|
||||
"version": "4.11.1"
|
||||
},
|
||||
"collection": {
|
||||
"dependency": "transitive",
|
||||
@@ -194,11 +194,11 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "dart_style",
|
||||
"sha256": "c87dfe3d56f183ffe9106a18aebc6db431fc7c98c31a54b952a77f3d54a85697",
|
||||
"sha256": "29f7ecc274a86d32920b1d9cfc7502fa87220da41ec60b55f329559d5732e2b2",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "3.1.2"
|
||||
"version": "3.1.7"
|
||||
},
|
||||
"file": {
|
||||
"dependency": "transitive",
|
||||
@@ -254,11 +254,11 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "http",
|
||||
"sha256": "bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007",
|
||||
"sha256": "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "1.5.0"
|
||||
"version": "1.6.0"
|
||||
},
|
||||
"http_multi_server": {
|
||||
"dependency": "transitive",
|
||||
@@ -290,25 +290,15 @@
|
||||
"source": "hosted",
|
||||
"version": "1.0.5"
|
||||
},
|
||||
"js": {
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "js",
|
||||
"sha256": "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "0.7.2"
|
||||
},
|
||||
"json_annotation": {
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "json_annotation",
|
||||
"sha256": "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1",
|
||||
"sha256": "cb09e7dac6210041fad964ed7fbee004f14258b4eca4040f72d1234062ace4c8",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "4.9.0"
|
||||
"version": "4.11.0"
|
||||
},
|
||||
"logging": {
|
||||
"dependency": "transitive",
|
||||
@@ -324,21 +314,21 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "matcher",
|
||||
"sha256": "dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2",
|
||||
"sha256": "dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "0.12.17"
|
||||
"version": "0.12.19"
|
||||
},
|
||||
"meta": {
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "meta",
|
||||
"sha256": "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394",
|
||||
"sha256": "df0c643f44ad098eb37988027a8e2b2b5a031fd3977f06bbfd3a76637e8df739",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "1.17.0"
|
||||
"version": "1.18.2"
|
||||
},
|
||||
"mime": {
|
||||
"dependency": "transitive",
|
||||
@@ -354,21 +344,21 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "mockito",
|
||||
"sha256": "4feb43bc4eb6c03e832f5fcd637d1abb44b98f9cfa245c58e27382f58859f8f6",
|
||||
"sha256": "a45d1aa065b796922db7b9e7e7e45f921aed17adf3a8318a1f47097e7e695566",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "5.5.1"
|
||||
"version": "5.6.3"
|
||||
},
|
||||
"mustache_template": {
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "mustache_template",
|
||||
"sha256": "daa42be75f2ccfb287c24a75e7ac594f2ea0b32bf9ebe7c15154aa45b2dfb2de",
|
||||
"sha256": "4326d0002ff58c74b9486990ccbdab08157fca3c996fe9e197aff9d61badf307",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "2.0.2"
|
||||
"version": "2.0.3"
|
||||
},
|
||||
"node_preamble": {
|
||||
"dependency": "transitive",
|
||||
@@ -404,11 +394,11 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "petitparser",
|
||||
"sha256": "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1",
|
||||
"sha256": "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "7.0.1"
|
||||
"version": "7.0.2"
|
||||
},
|
||||
"platform": {
|
||||
"dependency": "transitive",
|
||||
@@ -524,11 +514,11 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "source_gen",
|
||||
"sha256": "9098ab86015c4f1d8af6486b547b11100e73b193e1899015033cb3e14ad20243",
|
||||
"sha256": "adc962c96fffb2de1728ef396a995aaedcafbe635abdca13d2a987ce17e57751",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "4.0.2"
|
||||
"version": "4.2.1"
|
||||
},
|
||||
"source_map_stack_trace": {
|
||||
"dependency": "transitive",
|
||||
@@ -554,11 +544,11 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "source_span",
|
||||
"sha256": "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c",
|
||||
"sha256": "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "1.10.1"
|
||||
"version": "1.10.2"
|
||||
},
|
||||
"stack_trace": {
|
||||
"dependency": "transitive",
|
||||
@@ -604,31 +594,31 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "test",
|
||||
"sha256": "75906bf273541b676716d1ca7627a17e4c4070a3a16272b7a3dc7da3b9f3f6b7",
|
||||
"sha256": "280d6d890011ca966ad08df7e8a4ddfab0fb3aa49f96ed6de56e3521347a9ae7",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "1.26.3"
|
||||
"version": "1.30.0"
|
||||
},
|
||||
"test_api": {
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "test_api",
|
||||
"sha256": "ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55",
|
||||
"sha256": "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "0.7.7"
|
||||
"version": "0.7.10"
|
||||
},
|
||||
"test_core": {
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "test_core",
|
||||
"sha256": "0cc24b5ff94b38d2ae73e1eb43cc302b77964fbf67abad1e296025b78deb53d0",
|
||||
"sha256": "0381bd1585d1a924763c308100f2138205252fb90c9d4eeaf28489ee65ccde51",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "0.6.12"
|
||||
"version": "0.6.16"
|
||||
},
|
||||
"typed_data": {
|
||||
"dependency": "transitive",
|
||||
@@ -654,11 +644,11 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "watcher",
|
||||
"sha256": "592ab6e2892f67760543fb712ff0177f4ec76c031f02f5b4ff8d3fc5eb9fb61a",
|
||||
"sha256": "1398c9f081a753f9226febe8900fce8f7d0a67163334e1c94a2438339d79d635",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "1.1.4"
|
||||
"version": "1.2.1"
|
||||
},
|
||||
"web": {
|
||||
"dependency": "transitive",
|
||||
@@ -724,14 +714,14 @@
|
||||
"dependency": "transitive",
|
||||
"description": {
|
||||
"name": "yaml_edit",
|
||||
"sha256": "fb38626579fb345ad00e674e2af3a5c9b0cc4b9bfb8fd7f7ff322c7c9e62aef5",
|
||||
"sha256": "07c9e63ba42519745182b88ca12264a7ba2484d8239958778dfe4d44fe760488",
|
||||
"url": "https://pub.dev"
|
||||
},
|
||||
"source": "hosted",
|
||||
"version": "2.2.2"
|
||||
"version": "2.2.4"
|
||||
}
|
||||
},
|
||||
"sdks": {
|
||||
"dart": ">=3.9.0 <4.0.0"
|
||||
"dart": ">=3.10.0 <4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl jq dart yq-go nix
|
||||
|
||||
set -e
|
||||
|
||||
# Get the directory where this script is located
|
||||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# Fetch the latest tags from GitHub
|
||||
echo "Fetching latest tags from GitHub..." >&2
|
||||
tags=$(curl -s ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "https://api.github.com/repos/invertase/melos/tags?per_page=20")
|
||||
|
||||
if [ -z "$tags" ]; then
|
||||
echo "Error: Failed to fetch tags from GitHub" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract the latest stable version tag (skip dev versions)
|
||||
latest_release=$(echo "$tags" | jq -r '.[] | select(.name | test("^melos-v[0-9]+\\.[0-9]+\\.[0-9]+$")) | .name' | head -1)
|
||||
|
||||
if [ -z "$latest_release" ]; then
|
||||
echo "Error: Could not find any stable release tags" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
new_version=${latest_release#melos-v}
|
||||
|
||||
# Get current version from package.nix
|
||||
current_version=$(grep 'version = ' "$script_dir/package.nix" | head -1 | sed 's/.*version = "\(.*\)".*/\1/')
|
||||
|
||||
echo "Current version: $current_version" >&2
|
||||
echo "Latest version: $new_version" >&2
|
||||
|
||||
if [ "$new_version" = "$current_version" ]; then
|
||||
echo "Already at latest version" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Create a temporary directory
|
||||
tmpdir=$(mktemp -d)
|
||||
trap "rm -rf $tmpdir" EXIT
|
||||
|
||||
echo "Downloading melos ${latest_release} from GitHub..." >&2
|
||||
archive_url="https://github.com/invertase/melos/archive/refs/tags/${latest_release}.tar.gz"
|
||||
archive_path="$tmpdir/melos.tar.gz"
|
||||
|
||||
if ! curl -sL -o "$archive_path" "$archive_url"; then
|
||||
echo "Error: Failed to download archive" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Extracting archive..." >&2
|
||||
tar -xzf "$archive_path" -C "$tmpdir"
|
||||
|
||||
extracted_dir=$(tar -tzf "$archive_path" | head -1 | cut -d/ -f1)
|
||||
source_dir="$tmpdir/$extracted_dir"
|
||||
|
||||
echo "Generating pubspec.lock..." >&2
|
||||
cd "$source_dir"
|
||||
dart pub get > /dev/null 2>&1
|
||||
|
||||
echo "Converting to JSON..." >&2
|
||||
yq eval --output-format=json --prettyPrint pubspec.lock > "$tmpdir/pubspec.lock.json"
|
||||
|
||||
# Compute the hash from the downloaded archive
|
||||
echo "Computing source hash..." >&2
|
||||
nix_hash=$(nix-hash --flat --base32 --type sha256 "$archive_path")
|
||||
if [ -z "$nix_hash" ]; then
|
||||
echo "Error: Failed to compute source hash" >&2
|
||||
exit 1
|
||||
fi
|
||||
new_hash="sha256-$(nix-hash --to-sri --type sha256 "$nix_hash")"
|
||||
|
||||
cp "$tmpdir/pubspec.lock.json" "$script_dir/pubspec.lock.json"
|
||||
echo "Updated pubspec.lock.json" >&2
|
||||
|
||||
# Update version in package.nix
|
||||
sed -i "s/version = \"[^\"]*\";/version = \"${new_version}\";/" "$script_dir/package.nix"
|
||||
echo "Updated version to ${new_version}" >&2
|
||||
|
||||
# Update hash in package.nix
|
||||
sed -i "s|hash = \"[^\"]*\";|hash = \"${new_hash}\";|" "$script_dir/package.nix"
|
||||
echo "Updated hash" >&2
|
||||
|
||||
# Output commit message
|
||||
printf '{
|
||||
"attrPath": "melos",
|
||||
"oldVersion": "%s",
|
||||
"newVersion": "%s",
|
||||
"files": ["pubspec.lock.json", "package.nix"],
|
||||
"commitMessage": "melos: %s -> %s"
|
||||
}' "$current_version" "$new_version" "$current_version" "$new_version"
|
||||
Reference in New Issue
Block a user