Browse Source

* try to rename artifact

pull/97/head
lumapu 3 years ago
parent
commit
fa926d2ad3
  1. 5
      .github/workflows/compile_esp8266.yml
  2. 25
      tools/esp8266/helpers/getVersion.py

5
.github/workflows/compile_esp8266.yml

@ -32,8 +32,9 @@ jobs:
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
run: |
pio run -d tools/esp8266
run: pio run -d tools/esp8266
- name: rename
run: python tools/esp8266/helpers/getVersion.py
- uses: actions/upload-artifact@v3
with:
name: esp8266

25
tools/esp8266/helpers/getVersion.py

@ -0,0 +1,25 @@
import os
from datetime import date
def readVersion(infile):
f = open(infile, "r")
lines = f.readlines()
f.close()
today = date.today()
search = ["_MAJOR", "_MINOR", "_PATCH"]
version = today.strftime("%y%m%d") + "_ahoy_"
for line in lines:
if(line.find("VERSION_") != -1):
for s in search:
p = line.find(s)
if(p != -1):
version += line[p+13:].rstrip() + "."
version = version[:-1] + "_esp8266.bin"
src = "../.pio/build/d1_mini/firmware.bin"
dst = "../.pio/build/d1_mini/out/" + version
os.mkdir("../.pio/build/d1_mini/out/")
os.rename(src, dst)
readVersion("../defines.h")
Loading…
Cancel
Save