Skip to content

Commit 579e04d

Browse files
update to new rel format
1 parent e6108ef commit 579e04d

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "icp-cli-network-launcher"
3-
version = "12.0.0+dec22505"
3+
version = "12.0.0-2026-01-29-23-28"
44
edition = "2024"
55
authors = ["DFINITY Stiftung <sdk@dfinity.org>"]
66
license = "Apache-2.0"

package.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ fi
3030

3131
v=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name=="icp-cli-network-launcher") | .version')
3232
source=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name=="icp-cli-network-launcher") | .dependencies[] | select(.name=="pocket-ic") | .source')
33-
if [[ "$v" = *"+"* ]]; then
33+
reg='([0-9.]+)(-((r[0-9]+$)|([0-9-]+(\.(r[0-9]+)))))?'
34+
if [[ "$v" =~ $reg ]]; then
35+
pkgver=${BASH_REMATCH[1]}
36+
icdate=${BASH_REMATCH[5]:-}
37+
patchrel=${BASH_REMATCH[4]:-${BASH_REMATCH[7]:-}}
38+
else
39+
die "could not parse package version $v - should be 1.2.3[-r1] or 1.2.3-2026-01-29-16-08[.r1]"
40+
fi
41+
if [[ "$v" = *"-"* ]]; then
3442
[[ "$source" = "git+"* ]] || die "package.version is patch but pocket-ic dependency is not git"
35-
revstr=${source#"git+https://github.com/dfinity/ic?"}
36-
[[ "$revstr" =~ 'rev='[0-9a-f]{40} ]] || die "use the full hash in the pocket-ic version"
37-
sha=${revstr#"rev="}
3843
else
3944
[[ "$source" != "git+"* ]] || die "package.version is not patch but pocket-ic dependency is git"
4045
fi
@@ -44,10 +49,11 @@ outdir="${1-"dist/${name}"}"
4449
cargo build --release
4550
mkdir -p "${outdir}"
4651
cp "target/release/icp-cli-network-launcher" "${outdir}/"
47-
if [[ -z "$sha" ]]; then
48-
curl --proto '=https' -sSfL --tlsv1.2 "https://github.com/dfinity/pocketic/releases/download/${v}/pocket-ic-${arch}-${os}.gz" -o "${outdir}/pocket-ic.gz" ${GITHUB_TOKEN:+ -H "Authorization: Bearer ${GITHUB_TOKEN}" }
52+
if [[ -z "$icdate" ]]; then
53+
icver=$(sed 's/-/_/3' <<<"${icdate}")
54+
curl --proto '=https' -sSfL --tlsv1.2 "https://github.com/dfinity/pocketic/releases/download/${pkgver}/pocket-ic-${arch}-${os}.gz" -o "${outdir}/pocket-ic.gz" ${GITHUB_TOKEN:+ -H "Authorization: Bearer ${GITHUB_TOKEN}" }
4955
else
50-
curl --proto '=https' -sSfL --tlsv1.2 "https://download.dfinity.systems/ic/${sha}/binaries/${arch}-${os}/pocket-ic.gz" -o "${outdir}/pocket-ic.gz"
56+
curl --proto '=https' -sSfL --tlsv1.2 "https://github.com/dfinity/ic/releases/download/release-${icver}-base/pocket-ic-${arch}-${os}.gz" -o "${outdir}/pocket-ic.gz" ${GITHUB_TOKEN:+ -H "Authorization: Bearer ${GITHUB_TOKEN}" }
5157
fi
5258
gunzip -f "${outdir}/pocket-ic.gz"
5359
chmod a+x "${outdir}/pocket-ic"

0 commit comments

Comments
 (0)