Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ludamad committed Feb 13, 2025
1 parent d34c05f commit a4cfc4b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
12 changes: 8 additions & 4 deletions aztec-up/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ function test {

function release {
echo_header "aztec-up release"
local version=$REF_NAME
local version=${REF_NAME#v}

# Function to compare versions.
version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; }

# Read the current version from S3.
local current_version=$(aws s3 cp s3://install.aztec.network/VERSION - 2>/dev/null || echo "0.0.0")

if [ $(dist_tag) != latest ]; then
exit
fi

# Validate that version is a valid semver.
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Warning: $version is not a valid semver version. Skipping version comparison."
Expand All @@ -39,17 +43,17 @@ function release {
echo "Uploading new version: $version"

# Upload new version to root.
aws s3 sync ./bin s3://install.aztec.network/
do_or_dryrun aws s3 sync ./bin s3://install.aztec.network/

# Update VERSION file.
echo "$version" | aws s3 cp - s3://install.aztec.network/VERSION
echo "$version" | do_or_dryrun aws s3 cp - s3://install.aztec.network/VERSION
else
echo "New version $version is not greater than current version $current_version. Skipping root upload."
fi
fi

# Always create a version directory and upload files there.
aws s3 sync ./bin s3://install.aztec.network/$version/
do_or_dryrun aws s3 sync ./bin s3://install.aztec.network/$version/
}

case "$cmd" in
Expand Down
6 changes: 5 additions & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ function release {
done
}

function release_dryrun {
DRY_RUN=1 release
}

function release_commit {
export REF_NAME="commit-$COMMIT_HASH"

Expand Down Expand Up @@ -303,7 +307,7 @@ case "$cmd" in
bench
release
;;
bench|release|release_commit)
bench|release|release_dryrun|release_commit)
$cmd
;;
*)
Expand Down
6 changes: 5 additions & 1 deletion ci3/dist_tag
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ if [ -n "${DIST_TAG:-}" ]; then
echo "$DIST_TAG"
return
fi
if ! semver check $version; then
echo_stderr "$version is not a valid semver."
exit 1
fi
dist=$(semver prerelease $version | sed 's/\..*//')
if [ -n $dist ]; then
if [ -n "$dist" ]; then
echo $dist
else
echo latest
Expand Down

0 comments on commit a4cfc4b

Please sign in to comment.