From f2bba6a99e9a953593f12db6cbffa63fd4c233c9 Mon Sep 17 00:00:00 2001 From: finn Date: Wed, 13 Mar 2024 16:23:14 -0700 Subject: [PATCH] include SHA in snapshot version --- .github/workflows/release-snapshot.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-snapshot.yml b/.github/workflows/release-snapshot.yml index af2e3141f..ebe44d4fc 100644 --- a/.github/workflows/release-snapshot.yml +++ b/.github/workflows/release-snapshot.yml @@ -71,9 +71,10 @@ jobs: version_line=$(grep -n "\"version\": \"${base_version}\"" package.json | cut -d: -f1) # determine which line in package.json specifies the version version_bump_commit=$(git blame --porcelain -L "${version_line},${version_line}" -- package.json | head -n1 | awk '{ print $1 }') # ask git when the last commit to that line was commits_since_version_bump=$(git rev-list HEAD ${version_bump_commit} --count -- .) # count the number of commits that changed this package since the version change commit + last_commit_to_package=$(git log -1 --pretty=format:%H -- .) - snapshot_version="${base_version}-SNAPSHOT.${commits_since_version_bump}" + snapshot_version="${base_version}-SNAPSHOT.${commits_since_version_bump}-${last_commit_to_package:0:7}" # check if that snapshot version has already been published if curl -f --silent "https://blockxyz.jfrog.io/artifactory/tbd-oss-snapshots-npm/@web5/${package_name}/-/${package_name}-${snapshot_version}.tgz" > /dev/null; then