about summary refs log tree commit diff
path: root/pkgs/development/tools/continuous-integration/woodpecker/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/continuous-integration/woodpecker/update.sh')
-rwxr-xr-xpkgs/development/tools/continuous-integration/woodpecker/update.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/pkgs/development/tools/continuous-integration/woodpecker/update.sh b/pkgs/development/tools/continuous-integration/woodpecker/update.sh
index b53e5b4239361..bfe948e8f5072 100755
--- a/pkgs/development/tools/continuous-integration/woodpecker/update.sh
+++ b/pkgs/development/tools/continuous-integration/woodpecker/update.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env nix-shell
-#!nix-shell -i bash -p nix wget prefetch-yarn-deps nix-prefetch-github jq
+#!nix-shell -i bash -p nix wget prefetch-yarn-deps nix-prefetch-github jq nix-prefetch pnpm-lock-export
 
 # shellcheck shell=bash
 
@@ -30,20 +30,24 @@ version="${version#v}"
 # Woodpecker repository
 src_hash=$(nix-prefetch-github woodpecker-ci woodpecker --rev "v${version}" | jq -r .hash)
 
+# Go modules
+vendorHash=$(nix-prefetch '{ sha256 }: (callPackage (import ./cli.nix) { }).goModules.overrideAttrs (_: { modHash = sha256; })')
+
 # Front-end dependencies
 woodpecker_src="https://raw.githubusercontent.com/woodpecker-ci/woodpecker/v$version"
 wget "${TOKEN_ARGS[@]}" "$woodpecker_src/web/package.json" -O woodpecker-package.json
 
-web_tmpdir=$(mktemp -d)
-trap 'rm -rf "$web_tmpdir"' EXIT
-pushd "$web_tmpdir"
-wget "${TOKEN_ARGS[@]}" "$woodpecker_src/web/yarn.lock"
+trap 'rm -rf pnpm-lock.yaml' EXIT
+wget "${TOKEN_ARGS[@]}" "$woodpecker_src/web/pnpm-lock.yaml"
+pnpm-lock-export --schema yarn.lock@v1
 yarn_hash=$(prefetch-yarn-deps yarn.lock)
-popd
 
 # Use friendlier hashes
+src_hash=$(nix hash to-sri --type sha256 "$src_hash")
+vendorHash=$(nix hash to-sri --type sha256 "$vendorHash")
 yarn_hash=$(nix hash to-sri --type sha256 "$yarn_hash")
 
 sed -i -E -e "s#version = \".*\"#version = \"$version\"#" common.nix
 sed -i -E -e "s#srcHash = \".*\"#srcHash = \"$src_hash\"#" common.nix
+sed -i -E -e "s#vendorHash = \".*\"#vendorHash = \"$vendorHash\"#" common.nix
 sed -i -E -e "s#yarnHash = \".*\"#yarnHash = \"$yarn_hash\"#" common.nix