v5.1.2 #60
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Validation | |
on: | |
release: | |
types: | |
- released | |
- prereleased | |
- edited | |
jobs: | |
gui_validation: | |
name: Pre-built GUI Validation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
### Check the pre-built GUI files are up-to-date | |
- name: Cache pip | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Cache PlatformIO | |
uses: actions/cache@v4 | |
with: | |
path: ~/.platformio | |
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install PlatformIO | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade platformio | |
- name: Set up Node JS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: | | |
cd gui-v2 | |
npm install | |
- name: Build GUI | |
run: | | |
cd gui-v2 | |
npm run build | |
- name: Run PlatformIO | |
run: | |
pio run | |
- name: Check the pre-built GUI files are up-to-date | |
run: | | |
set +e | |
git status -s | grep " M " | |
if [ $? -eq 0 ]; then | |
echo "ERROR: The pre-built GUI files are not up-to-date" | |
exit 1 | |
fi | |
release_number: | |
name: Release Number Validation | |
runs-on: ubuntu-latest | |
if: github.ref_name != 'latest' | |
steps: | |
### Check the version number in the code matches the tag number | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Retrieve the version number(s) | |
run: | | |
TAG_VERSION=$GITHUB_REF_NAME | |
CODE_VERSION=$(python3 scripts/auto_fw_version.py | grep -E 'BUILD_TAG=([^ ]+)' -o | cut -d= -f2) | |
echo TAG_VERSION=$TAG_VERSION >> $GITHUB_ENV | |
echo CODE_VERSION=$CODE_VERSION >> $GITHUB_ENV | |
- name: Check the version number is semver compliant | |
run: | | |
if ! [[ $TAG_VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-z]*[0-9]+)?$ ]]; then | |
echo "ERROR: The version number is not semver compliant" | |
exit 1 | |
fi | |
- name: Check the version number in the code matches the tag number | |
run: | | |
if [ "$TAG_VERSION" != "$CODE_VERSION" ]; then | |
echo "ERROR: The version number in the code ($CODE_VERSION) does not match the tag number ($TAG_VERSION)" | |
exit 1 | |
fi | |