add branch and PR number to uploaded build filenames
This commit is contained in:
parent
b2c32cf42f
commit
0bd2a377b3
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@ -84,6 +84,7 @@ jobs:
|
|||||||
run: python3 -u ci_set_matrix.py
|
run: python3 -u ci_set_matrix.py
|
||||||
working-directory: tools
|
working-directory: tools
|
||||||
env:
|
env:
|
||||||
|
PULL: ${{ github.event.number }}
|
||||||
LAST_FAILED_JOBS: ${{ steps.get-last-commit-with-checks.outputs.check_runs }}
|
LAST_FAILED_JOBS: ${{ steps.get-last-commit-with-checks.outputs.check_runs }}
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
@ -294,3 +295,5 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
boards: ${{ toJSON(fromJSON(needs.scheduler.outputs.ports)[matrix.port]) }}
|
boards: ${{ toJSON(fromJSON(needs.scheduler.outputs.ports)[matrix.port]) }}
|
||||||
cp-version: ${{ needs.scheduler.outputs.cp-version }}
|
cp-version: ${{ needs.scheduler.outputs.cp-version }}
|
||||||
|
env:
|
||||||
|
PULL: ${{ github.event.number }}
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user