mirror of
https://github.com/status-im/status-react.git
synced 2025-01-09 18:46:19 +00:00
5dbac2b1d9
Fixes #8635 by adding VERSION and BUILD_NUMBER files in the correct nix template and updating bash script in order to prevent it from failing, due to the git repository being not initialized in the nix environment. Move scripts/build_no.sh and scripts/gen_build_no.sh to scripts/version/build_no.sh to prevent Nix from rebuilding when unrelated scripts are touched. Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
28 lines
823 B
Bash
Executable File
28 lines
823 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
#####################################################################
|
|
#
|
|
# Save the timestamp-based build number for builds
|
|
# that get uploaded to places like:
|
|
# Apple Store, Play Store, or TestFlight
|
|
#
|
|
# The result of this script is used by scripts/version/build_no.sh
|
|
# when being run in Jenkins build context.
|
|
#
|
|
#####################################################################
|
|
|
|
# Fail on first error
|
|
set -e
|
|
|
|
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
|
BUILD_NUMBER_FILE="${GIT_ROOT}/BUILD_NUMBER"
|
|
|
|
if [[ -f "${BUILD_NUMBER_FILE}" ]]; then
|
|
cat "${BUILD_NUMBER_FILE}"
|
|
else
|
|
# Format: Year(4 digit) + Month + Day + Hour
|
|
# Example: 2018120118
|
|
# We limited precision to hours to avoid of mismatched numbers.
|
|
date '+%Y%m%d%H' | tee "${BUILD_NUMBER_FILE}"
|
|
fi
|