-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Release process fix & major/minor/rev macro addition #8126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
d877cff
3a4dbe0
878c02c
95bc21b
5973e13
212470f
2562def
7f679e1
2c75651
498d385
823dfb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,23 +20,40 @@ | |
import argparse | ||
import os | ||
import subprocess | ||
import re | ||
|
||
|
||
def generate(path, platform_path, git_ver="ffffffff", git_desc="unspecified"): | ||
def generate(path, platform_path, git_ver="ffffffff", platform_version="unspecified"): | ||
def git(*args): | ||
cmd = ["git", "-C", platform_path] | ||
cmd.extend(args) | ||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True, stderr=subprocess.DEVNULL) | ||
return proc.stdout.readlines()[0].strip() | ||
|
||
git_desc = platform_version; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following the above, should this have additional param to skip git-describe? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tagging works OK including when used by github-action. Releases are based on tagging. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. broken == checkout doing my only problem with that is that version string depends on too much stuff, where we already know it from the tag name anyway; and commit sha comes from rev-parse regardless, shallow copy or not. |
||
try: | ||
git_ver = git("rev-parse", "--short=8", "HEAD") | ||
git_desc = git("describe", "--tags") | ||
except Exception: | ||
pass | ||
|
||
text = "#define ARDUINO_ESP8266_GIT_VER 0x{}\n".format(git_ver) | ||
text += "#define ARDUINO_ESP8266_GIT_DESC {}\n".format(git_desc) | ||
text = "#define ARDUINO_ESP8266_GIT_VER 0x{}\n".format(git_ver) | ||
text += "#define ARDUINO_ESP8266_GIT_DESC {}\n".format(git_desc) | ||
text += "\n" | ||
|
||
version = re.split("\.", platform_version) | ||
# major: if present, skip "unix-" in "unix-3" | ||
text += "#define ARDUINO_ESP8266_MAJOR {}\n".format(re.split("-", version[0])[-1]) | ||
text += "#define ARDUINO_ESP8266_MINOR {}\n".format(version[1]) | ||
# revision can be ".n" or ".n-dev" | ||
revision = re.split("-", version[2]) | ||
text += "#define ARDUINO_ESP8266_REVISION {}\n".format(revision[0]) | ||
text += "\n" | ||
if len(revision) > 1: | ||
text += "#define ARDUINO_ESP8266_DEV 1 // developpment version\n" | ||
else: | ||
text += "#define ARDUINO_ESP8266_RELEASE \"{}\"\n".format(git_desc) | ||
text += "#define ARDUINO_ESP8266_RELEASE_{}\n".format(re.sub("[-\.]", "_", git_desc)) | ||
d-a-v marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
try: | ||
with open(path, "r") as inp: | ||
|
@@ -79,5 +96,5 @@ def git(*args): | |
generate( | ||
os.path.join(include_dir, "core_version.h"), | ||
args.platform_path, | ||
git_desc=args.version, | ||
platform_version=args.version, | ||
) |
Uh oh!
There was an error while loading. Please reload this page.