Unverified Commit 5460a3f3 authored by Marcin Serwin's avatar Marcin Serwin Committed by GitHub
Browse files

ieda: add update script for r-ryantm (#475512)

parents 65fbfd4d 1d250dd1
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
let
  rootSrc = stdenv.mkDerivation {
    pname = "iEDA-src";
    version = "2025-12-16";
    version = "0.1.0-unstable-2025-12-16";
    src = fetchgit {
      url = "https://gitee.com/oscc-project/iEDA";
      rev = "b73be0f1909294b56b2dbb27dba04b6cd9e0070d";
@@ -57,7 +57,7 @@ let
in
stdenv.mkDerivation {
  pname = "iEDA";
  version = "0.1.0-unstable-2025-12-16";
  version = rootSrc.version;

  src = rootSrc;

@@ -126,6 +126,8 @@ stdenv.mkDerivation {

  enableParallelBuild = true;

  passthru.updateScript = ./update.sh;

  meta = {
    description = "Open-source EDA infracstructure and tools from Netlist to GDS for ASIC design";
    homepage = "https://gitee.com/oscc-project/iEDA";
+20 −0
Original line number Diff line number Diff line
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts

set -eu -o pipefail

latestCommit="$(curl -fs https://gitee.com/api/v5/repos/oscc-project/iEDA/commits?sha=master | jq -r '.[0].sha')"
commitDate="$(curl -fs https://gitee.com/api/v5/repos/oscc-project/iEDA/commits/"$latestCommit" | jq -r '.commit.committer.date[:10]')"
latestReleaseTag="$(curl -fs https://gitee.com/api/v5/repos/oscc-project/iEDA/releases/latest | jq -r '.tag_name | ltrimstr("v")')"

[ "$latestCommit" != "null" ] && [ -n "$latestCommit" ] || { echo "Failed to fetch latest commit"; exit 1; }
[ "$commitDate" != "null" ] && [ -n "$commitDate" ] || { echo "Failed to fetch commit date"; exit 1; }
[ "$latestReleaseTag" != "null" ] && [ -n "$latestReleaseTag" ] || { echo "Failed to fetch release tag"; exit 1; }

newVersion="$latestReleaseTag-unstable-$commitDate"

update-source-version \
  "$UPDATE_NIX_ATTR_PATH" \
  "$newVersion" \
  --rev="$latestCommit" \
  --source-key="src.src"