1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-13 05:53:06 +01:00

handle build version for ci builds

This commit is contained in:
andreas
2023-10-06 19:57:32 +02:00
parent 1da9fea9a4
commit 10058cfeec
5 changed files with 58 additions and 17 deletions

12
post.py
View File

@@ -63,17 +63,17 @@ def post(source,target,env):
for f in glob.glob(os.path.join(outdir,base+"*.bin")):
print("removing old file %s"%f)
os.unlink(f)
ofversion=''
if not version.startswith('dev'):
ofversion="-"+version
versionedFile=os.path.join(outdir,"%s%s-update.bin"%(base,ofversion))
shutil.copyfile(firmware,versionedFile)
outfile=os.path.join(outdir,"%s%s-all.bin"%(base,ofversion))
outfile=os.path.join(outdir,"%s-all.bin"%(base))
cmd=[python,esptool,"--chip",chip,"merge_bin","--target-offset",offset,"-o",outfile]
cmd+=uploadfiles
cmd+=[appoffset,firmware]
print("running %s"%" ".join(cmd))
env.Execute(" ".join(cmd),"#testpost")
ofversion="-"+version
versionedFile=os.path.join(outdir,"%s%s-update.bin"%(base,ofversion))
shutil.copyfile(firmware,versionedFile)
versioneOutFile=os.path.join(outdir,"%s%s-all.bin"%(base,ofversion))
shutil.copyfile(outfile,versioneOutFile)
env.AddPostAction(
"$BUILD_DIR/${PROGNAME}.bin",
post