Skip to content
Snippets Groups Projects
Commit 42bf765d authored by q3k's avatar q3k
Browse files

ci: fix versioning for dist script

parent c5957610
Branches
Tags
No related merge requests found
Pipeline #6599 passed
...@@ -11,7 +11,21 @@ if [ ! -f sdkconfig.defaults ] || [ ! -f recovery/sdkconfig.defaults ]; then ...@@ -11,7 +11,21 @@ if [ ! -f sdkconfig.defaults ] || [ ! -f recovery/sdkconfig.defaults ]; then
exit 1 exit 1
fi fi
if [ ! -z "${CI}" ]; then
if [ ! -z "${CI_COMMIT_TAG}" ]; then
# If we're building a tag, just use that as a version.
version="v${CI_COMMIT_TAG}"
else
# Otherwise, let normal version machinery run, but fetch all changes
# and check out the correct branch. Otherwise we'll get weird version
# strings.
git fetch origin "$CI_COMMIT_REF_NAME"
git checkout "$CI_COMMIT_REF_NAME"
version="$(python3 components/st3m/host-tools/version.py)" version="$(python3 components/st3m/host-tools/version.py)"
fi
else
version="$(python3 components/st3m/host-tools/version.py)"
fi
rm -rf sdkconfig build rm -rf sdkconfig build
rm -rf recovery/sdkconfig recovery/build rm -rf recovery/sdkconfig recovery/build
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment