Merge pull request #8648 from dhalbert/branch-name-in-build-filename
add branch and PR number to uploaded build filenames
This commit is contained in:
commit
3aac226d53
1
.github/workflows/build-boards.yml
vendored
1
.github/workflows/build-boards.yml
vendored
@ -72,6 +72,7 @@ jobs:
|
|||||||
working-directory: tools
|
working-directory: tools
|
||||||
env:
|
env:
|
||||||
BOARDS: ${{ matrix.board }}
|
BOARDS: ${{ matrix.board }}
|
||||||
|
PULL: ${{ github.event.number }}
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
@ -75,7 +75,20 @@ def get_version_info():
|
|||||||
sha = os.environ["GITHUB_SHA"]
|
sha = os.environ["GITHUB_SHA"]
|
||||||
|
|
||||||
if not version:
|
if not version:
|
||||||
version = "{}-{}".format(date.today().strftime("%Y%m%d"), sha[:7])
|
# Get branch we are PR'ing into, if any.
|
||||||
|
branch = os.environ.get("GITHUB_BASE_REF", "").strip().replace("/", "_")
|
||||||
|
if not branch:
|
||||||
|
branch = "no-branch"
|
||||||
|
|
||||||
|
# Get PR number, if any
|
||||||
|
pull_request_maybe = os.environ.get("PULL", "")
|
||||||
|
if pull_request_maybe:
|
||||||
|
pull_request_maybe = f"-PR{pull_request_maybe}"
|
||||||
|
|
||||||
|
date_stamp = date.today().strftime("%Y%m%d")
|
||||||
|
short_sha = sha[:7]
|
||||||
|
# Example: 20231121-8.2.x-PR9876-123abcd
|
||||||
|
version = f"{date_stamp}-{branch}{pull_request_maybe}-{short_sha}"
|
||||||
|
|
||||||
return sha, version
|
return sha, version
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 1421ca7fe72a2b173b08be05f9042b79409e783a
|
Subproject commit 27e322fcdcc6eee0642242638d4f2557efb32559
|
Loading…
Reference in New Issue
Block a user