Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
640 B

  1. import os
  2. import shutil
  3. def copy_release(target, source, env):
  4. # target filename and subdir for release files
  5. name = env["ESPURNA_RELEASE_NAME"]
  6. version = env["ESPURNA_RELEASE_VERSION"]
  7. destdir = env["ESPURNA_RELEASE_DESTINATION"]
  8. if not name or not version or not destdir:
  9. raise ValueError("Cannot set up release without release variables present")
  10. if not os.path.exists(destdir):
  11. os.makedirs(destdir)
  12. dest = os.path.join(
  13. destdir, "espurna-{version}-{name}.bin".format(version=version, name=name)
  14. )
  15. src = env.subst("$BUILD_DIR/${PROGNAME}.bin")
  16. shutil.copy(src, dest)