mirror of
https://github.com/SlimeVR/SlimeVR-Tracker-ESP.git
synced 2026-04-06 02:01:57 +02:00
CI: Actually working firmware version detection (#365)
* Fix firmware version detection * Fix ci * remove release workflow
This commit is contained in:
23
.github/workflows/actions.yml
vendored
23
.github/workflows/actions.yml
vendored
@@ -4,6 +4,8 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- "*"
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
create:
|
||||
@@ -17,15 +19,15 @@ jobs:
|
||||
with:
|
||||
clang-format-version: "17"
|
||||
fallback-style: google
|
||||
# Disable clang-tidy for now
|
||||
# - name: Get clang-tidy
|
||||
# run: |
|
||||
# apt-get update
|
||||
# apt-get install -y clang-tidy
|
||||
# - uses: ZehMatt/clang-tidy-annotations@v1.0.0
|
||||
# with:
|
||||
# build_dir: 'build'
|
||||
# cmake_args: '-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++'
|
||||
# Disable clang-tidy for now
|
||||
# - name: Get clang-tidy
|
||||
# run: |
|
||||
# apt-get update
|
||||
# apt-get install -y clang-tidy
|
||||
# - uses: ZehMatt/clang-tidy-annotations@v1.0.0
|
||||
# with:
|
||||
# build_dir: 'build'
|
||||
# cmake_args: '-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++'
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
@@ -39,6 +41,9 @@ jobs:
|
||||
~/.platformio/.cache
|
||||
key: ${{ runner.os }}-pio
|
||||
|
||||
- name: Get tags
|
||||
run: git fetch --tags origin --recurse-submodules=no --force
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
|
||||
20
.github/workflows/release.yml
vendored
20
.github/workflows/release.yml
vendored
@@ -1,20 +0,0 @@
|
||||
name: Releases
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
artifacts: "./build/*.bin"
|
||||
draft: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -18,13 +18,7 @@ else:
|
||||
|
||||
tag = ""
|
||||
try:
|
||||
tag = (
|
||||
subprocess.check_output(["git", "--no-pager", "tag", "--sort", "-taggerdate", "--points-at" , "HEAD"])
|
||||
.split("\n")[0]
|
||||
.strip()
|
||||
.decode("utf-8")
|
||||
)
|
||||
|
||||
tag = subprocess.check_output(["git", "--no-pager", "tag", "--sort", "-taggerdate", "--points-at" , "HEAD"]).strip().decode("utf-8")
|
||||
if tag.startswith("v"):
|
||||
tag = tag[1:]
|
||||
except Exception:
|
||||
@@ -40,13 +34,13 @@ try:
|
||||
except Exception:
|
||||
branch = ""
|
||||
|
||||
output = f"'-DGIT_REV=\"{revision}\"'"
|
||||
output = f"-DGIT_REV='\"{revision}\"'"
|
||||
|
||||
if tag != "":
|
||||
output += f" '-DFIRMWARE_VERSION=\"{tag}\"'"
|
||||
output += f" -DFIRMWARE_VERSION='\"{tag}\"'"
|
||||
elif branch != "":
|
||||
output += f" '-DFIRMWARE_VERSION=\"{branch}\"'"
|
||||
output += f" -DFIRMWARE_VERSION='\"{branch}\"'"
|
||||
else:
|
||||
output += f" '-DFIRMWARE_VERSION=\"git-{revision}\"'"
|
||||
output += f" -DFIRMWARE_VERSION='\"git-{revision}\"'"
|
||||
|
||||
print(output)
|
||||
|
||||
Reference in New Issue
Block a user