Skip to content

Commit 68e3756

Browse files
committed
Build the phar with the correct version on version bump
1 parent 0d719f5 commit 68e3756

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

scripts/build.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ set -e
55
# Move into the agent directory
66
cd agent
77

8-
# Force the root version to allow for reproducible builds (we use 0.0.0 so it's clear this is not a real version)
9-
export COMPOSER_ROOT_VERSION=0.0.0
8+
# Check if we have a version argument
9+
if [ -z "$1" ]; then
10+
# Set a default version if none is provided (we use 0.0.0 so it's clear this is not a real version)
11+
VERSION="0.0.0"
12+
else
13+
VERSION="$1"
14+
fi
15+
16+
# Force the root version to allow for reproducible builds
17+
export COMPOSER_ROOT_VERSION=$VERSION
1018

1119
# Install composer dependencies (without dev dependencies since they are not needed in a production build)
1220
composer install --prefer-dist --no-interaction --no-progress --no-dev

scripts/bump-version.sh

100644100755
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@ if [ "$(uname -s)" != "Linux" ]; then
55
echo "Please use the GitHub Action."
66
exit 1
77
fi
8+
9+
# Ensure we are in the root directory of the project
10+
SCRIPT_DIR="$( dirname "$0" )"
11+
cd $SCRIPT_DIR/..
12+
13+
# Get the old and new version from the command line arguments
14+
OLD_VERSION="${1}"
15+
NEW_VERSION="${2}"
16+
17+
# Run a new phar build with the tagged version
18+
./scripts/build.sh $NEW_VERSION

0 commit comments

Comments
 (0)