gysmo38 / mitsubishi2MQTT

Mitsubishi to MQTT with ESP8266 module
GNU Lesser General Public License v2.1
413 stars 141 forks source link

use version from git #264

Closed ggrandou closed 2 months ago

ggrandou commented 6 months ago

This patch automates the version string in the firmware by using the most recent available git tag.

python script is automatically called by platformio upon build which appends a GIT_VERSION define to build flags.

version string is built from the output of git describe --tags --always --dirty command

Some version examples:

GIT_VERSION is gracefully ignored when the build is not run inside a git repository or if git fails for whatever reason.

For safety I have kept the original code if GIT_VERSION is not defined, but it could make sense to have a generic "unknown" version string or similar.

It has been tested on a linux platform. It should work on windows as well, but it's untested.

ggrandou commented 3 months ago

I tried it and it works great

on linux or on windows ?

pzbitskiy commented 3 months ago

Linux.

gysmo38 commented 2 months ago

Thank you for your PR

ggrandou commented 2 months ago

Hello, @gysmo38 looks like you have forgotten to actually do the merge in your master branch ;)