Skip to content

Commit

Permalink
include SHA in snapshot version
Browse files Browse the repository at this point in the history
  • Loading branch information
finn-block committed Mar 13, 2024
1 parent 3e1c487 commit f2bba6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f2bba6a

Please sign in to comment.