File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ validate_version () {
4+ local version=" $1 "
5+ if [[ ! " $version " =~ ^[0-9]+\. [0-9]+\. [0-9]+ (-pre.* )? $ ]]; then
6+ echo " ::error::Invalid version format in VERSION file. Expected: X.Y.Z or X.Y.Z-pre*"
7+ return 1
8+ fi
9+ return 0
10+ }
11+
12+ version=$( cat VERSION 2> /dev/null)
13+ if [ -z " $version " ]; then
14+ echo " ::error::VERSION file not found or empty"
15+ exit 1
16+ fi
17+
18+ if validate_version " $version " ; then
19+ echo " Version validation successful: $version "
20+ if [[ -n " ${GITHUB_ENV:- } " ]]; then
21+ echo " version=$version " >> " $GITHUB_ENV "
22+ fi
23+ fi
Original file line number Diff line number Diff line change 6666 submodules : recursive
6767 fetch-depth : 0
6868
69+ - name : Validate VERSION
70+ run : ../../.github/scripts/validate-version.sh
71+ working-directory : platform/android
72+
6973 - run : echo "cmake.dir=$(dirname "$(dirname "$(command -v cmake)")")" >> local.properties
7074
7175 - uses : actions/setup-java@v4
Original file line number Diff line number Diff line change 4242 - name : Android nitpick
4343 run : make run-android-nitpick
4444
45- - name : Set version name
45+ - name : Validate and set version
46+ working-directory : platform/android
4647 run : |
47- echo version="$(cat VERSION)" > "$GITHUB_ENV"
48+ ../../.github/scripts/validate- version.sh
4849
4950 - name : Build package
5051 run : |
You can’t perform that action at this time.
0 commit comments