mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-13 00:46:38 +02:00
* try to rename artifact
This commit is contained in:
parent
70beca3a93
commit
fa926d2ad3
2 changed files with 28 additions and 2 deletions
5
.github/workflows/compile_esp8266.yml
vendored
5
.github/workflows/compile_esp8266.yml
vendored
|
@ -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
Normal file
25
tools/esp8266/helpers/getVersion.py
Normal file
|
@ -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…
Add table
Add a link
Reference in a new issue