diff --git a/.github/updateversion.py b/.github/updateversion.py new file mode 100644 index 0000000..6a0d955 --- /dev/null +++ b/.github/updateversion.py @@ -0,0 +1,19 @@ +import re +import sys + +if len(sys.argv) < 2: + print("Usage: python3 updateversion.py ") + sys.exit(1) + +tag = sys.argv[1] + +content_new = '' +with open ('./src/PixelIt.ino', 'r' ) as f: + content = f.read() + content_new = re.sub('(#define\s+VERSION\s+\")(.*)(\")', r'\g<1>'+ tag + r'\g<3>', content, flags = re.M) + f.close() + +if content_new != "": + with open ('./src/PixelIt.ino', 'w' ) as f: + f.write(content_new) + f.close() diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index b6f87a6..5c82254 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -68,6 +68,10 @@ jobs: run: | python .github/webui.py + - name: Update version in PixelIt.ino 🔧 + run: | + python .github/updateversion.py ${{ github.ref_name }} + - name: Install pio and its dependencies 🔧 run: | python -m pip install --upgrade pip diff --git a/src/PixelIt.ino b/src/PixelIt.ino index 88c15d9..db54568 100644 --- a/src/PixelIt.ino +++ b/src/PixelIt.ino @@ -52,7 +52,7 @@ #define CHECKUPDATESCREEN_INTERVAL 1000 * 60 * 5 // 5 Minutes #define CHECKUPDATESCREEN_DURATION 1000 * 5 // 5 Seconds -#define VERSION "2.2.0" +#define VERSION "2.3.0-beta" void FadeOut(int = 10, int = 0); void FadeIn(int = 10, int = 0);