ci: use a better way of getting branch from tagged builds for CirrusCI (#948)
* ci: use a better way of getting branch from tagged builds for CirrusCI * add a bit more logging
This commit is contained in:
parent
543fd6c047
commit
0adefababf
|
@ -267,7 +267,7 @@ jobs:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Create release directory
|
- name: Create release directory
|
||||||
run: |
|
run: |
|
||||||
|
@ -277,7 +277,13 @@ jobs:
|
||||||
env:
|
env:
|
||||||
CIRRUS_KEY: ${{ secrets.CIRRUS_TOKEN }}
|
CIRRUS_KEY: ${{ secrets.CIRRUS_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
python ./scripts/cirrus/build.py "${{ github.ref_name }}" "${{ github.ref_type }}" "release/" "${{ inputs.caller }}"
|
if [[ "${{ github.ref_type }}" == "branch" ]]; then
|
||||||
|
BRANCH="${{ github.ref_name }}";
|
||||||
|
else
|
||||||
|
raw=$(git branch -r --contains '${{ github.ref_name }}');
|
||||||
|
BRANCH=${raw##*/};
|
||||||
|
fi
|
||||||
|
python ./scripts/cirrus/build.py "$BRANCH" "release/" "${{ inputs.caller }}"
|
||||||
|
|
||||||
- name: Save release as artifact
|
- name: Save release as artifact
|
||||||
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
|
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
|
||||||
|
|
|
@ -107,16 +107,12 @@ def main():
|
||||||
|
|
||||||
key = env["CIRRUS_KEY"]
|
key = env["CIRRUS_KEY"]
|
||||||
branch = args[1]
|
branch = args[1]
|
||||||
branch_type = args[2]
|
dl_path = args[2] if len(args) >= 3 else ""
|
||||||
|
|
||||||
# TODO: This is a bit of a hack, sorry. You want to properly handle this I suppose with the endpoint you hit.
|
|
||||||
if branch_type == "tag":
|
|
||||||
branch = "master"
|
|
||||||
|
|
||||||
dl_path = args[3] if len(args) >= 4 else ""
|
|
||||||
dl_path = Path(dl_path)
|
dl_path = Path(dl_path)
|
||||||
build_type = args[4] if len(args) >= 5 else "build"
|
build_type = args[3] if len(args) >= 4 else "build"
|
||||||
build_id = args[5] if len(args) >= 6 else None
|
build_id = args[4] if len(args) >= 5 else None
|
||||||
|
|
||||||
|
print(f"Running Cirrus script with branch '{branch}'")
|
||||||
|
|
||||||
# Check if this build has already been completed before.
|
# Check if this build has already been completed before.
|
||||||
if build_id is not None:
|
if build_id is not None:
|
||||||
|
|
Loading…
Reference in New Issue