Skip to content

Commit 9633e75

Browse files
committed
github: Use dawidd6/action-download-artifact with the new ref: option
This allows specifying either a commit or a branch in the same field, allowing simplifying both the workflow inputs, and the expressions for passing commit/branch to both dawidd6/action-download-artifact and actions/checkout. This new option is available since dawidd6/action-download-artifact#329.
1 parent 5110f3d commit 9633e75

File tree

5 files changed

+34
-58
lines changed

5 files changed

+34
-58
lines changed

.github/workflows/docker.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ name: Build docker images
22
on:
33
workflow_dispatch:
44
inputs:
5-
commit:
6-
description: 'Commit to extract from'
7-
type: string
8-
branch:
9-
description: 'Branch to extract from'
5+
ref:
6+
description: 'Ref to extract from'
107
type: string
118
default: 'master'
129
login:
@@ -25,12 +22,11 @@ jobs:
2522
TAG: ${{steps.get-parameters.outputs.TAG}}
2623
steps:
2724
- name: Download build parameters
28-
uses: dawidd6/action-download-artifact@v6
25+
uses: dawidd6/action-download-artifact@v10
2926
with:
3027
workflow: build.yml
3128
workflow_conclusion: success
32-
commit: ${{inputs.commit}}
33-
branch: ${{inputs.commit == '' && inputs.branch || ''}}
29+
ref: ${{inputs.ref}}
3430
event: push
3531
name: parameters
3632
- name: Get build parameters
@@ -45,7 +41,7 @@ jobs:
4541
steps:
4642
- uses: actions/checkout@v4
4743
with:
48-
ref: ${{ (inputs.commit != '' && inputs.commit) || inputs.branch }}
44+
ref: ${{inputs.ref}}
4945
- name: Log in to Docker Hub
5046
if: ${{inputs.login}}
5147
uses: docker/login-action@v3
@@ -77,15 +73,14 @@ jobs:
7773
steps:
7874
- uses: actions/checkout@v4
7975
with:
80-
ref: ${{ (inputs.commit != '' && inputs.commit) || inputs.branch }}
76+
ref: ${{inputs.ref}}
8177
- name: Download toolchain
8278
if: ${{matrix.file == 'Dockerfile.toolchain'}}
83-
uses: dawidd6/action-download-artifact@v6
79+
uses: dawidd6/action-download-artifact@v10
8480
with:
8581
workflow: build.yml
8682
workflow_conclusion: success
87-
commit: ${{inputs.commit}}
88-
branch: ${{inputs.commit == '' && inputs.branch || ''}}
83+
ref: ${{inputs.ref}}
8984
event: push
9085
name: linux-ucrt-.*
9186
name_is_regexp: true

.github/workflows/msvcrt.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ name: Build msvcrt toolchains
22
on:
33
workflow_dispatch:
44
inputs:
5-
commit:
6-
description: 'Commit to extract from'
7-
type: string
8-
branch:
9-
description: 'Branch to extract from'
5+
ref:
6+
description: 'Ref to extract from'
107
type: string
118
default: 'master'
129
upload:
@@ -30,12 +27,11 @@ jobs:
3027
BUILD_DATE_UNIX: ${{steps.get-parameters.outputs.BUILD_DATE_UNIX}}
3128
steps:
3229
- name: Download build parameters
33-
uses: dawidd6/action-download-artifact@v6
30+
uses: dawidd6/action-download-artifact@v10
3431
with:
3532
workflow: build.yml
3633
workflow_conclusion: success
37-
commit: ${{inputs.commit}}
38-
branch: ${{inputs.commit == '' && inputs.branch || ''}}
34+
ref: ${{inputs.ref}}
3935
event: push
4036
name: parameters
4137
- name: Get build parameters
@@ -51,14 +47,13 @@ jobs:
5147
steps:
5248
- uses: actions/checkout@v4
5349
with:
54-
ref: ${{ (inputs.commit != '' && inputs.commit) || inputs.branch }}
50+
ref: ${{inputs.ref}}
5551
- name: Download toolchain
56-
uses: dawidd6/action-download-artifact@v6
52+
uses: dawidd6/action-download-artifact@v10
5753
with:
5854
workflow: build.yml
5955
workflow_conclusion: success
60-
commit: ${{inputs.commit}}
61-
branch: ${{inputs.commit == '' && inputs.branch || ''}}
56+
ref: ${{inputs.ref}}
6257
event: push
6358
name: linux-ucrt-x86_64-toolchain
6459
- name: Unpack original toolchain
@@ -110,7 +105,7 @@ jobs:
110105
echo /opt/llvm-mingw/bin >> $GITHUB_PATH
111106
- uses: actions/checkout@v4
112107
with:
113-
ref: ${{ (inputs.commit != '' && inputs.commit) || inputs.branch }}
108+
ref: ${{inputs.ref}}
114109
- name: Build
115110
env:
116111
LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}}
@@ -164,7 +159,7 @@ jobs:
164159
echo /llvm-mingw/bin >> $GITHUB_PATH
165160
- uses: actions/checkout@v4
166161
with:
167-
ref: ${{ (inputs.commit != '' && inputs.commit) || inputs.branch }}
162+
ref: ${{inputs.ref}}
168163
- name: Run tests
169164
run: |
170165
./run-tests.sh /llvm-mingw

.github/workflows/release.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ name: Make a release, upload artifacts
22
on:
33
workflow_dispatch:
44
inputs:
5-
commit:
6-
description: 'Commit to extract from'
7-
type: string
8-
branch:
9-
description: 'Branch to extract from'
5+
ref:
6+
description: 'Ref to extract from'
107
type: string
118
default: 'master'
129
tag:
@@ -39,12 +36,11 @@ jobs:
3936
runs-on: ubuntu-latest
4037
steps:
4138
- name: Download artifacts
42-
uses: dawidd6/action-download-artifact@v6
39+
uses: dawidd6/action-download-artifact@v10
4340
with:
4441
workflow: build.yml
4542
workflow_conclusion: success
46-
commit: ${{inputs.commit}}
47-
branch: ${{inputs.commit == '' && inputs.branch || ''}}
43+
ref: ${{inputs.ref}}
4844
event: push
4945
- name: Rearrange files
5046
run: |
@@ -56,7 +52,7 @@ jobs:
5652
cat parameters/parameters.txt >> $GITHUB_ENV
5753
- uses: actions/checkout@v4
5854
with:
59-
ref: ${{ (inputs.commit != '' && inputs.commit) || inputs.branch }}
55+
ref: ${{inputs.ref}}
6056
path: repo
6157
- name: Make a tag
6258
if: ${{inputs.make_tag}}

.github/workflows/test-libcxx.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ name: Run libcxx/libcxxabi/libunwind tests
22
on:
33
workflow_dispatch:
44
inputs:
5-
commit:
6-
description: 'Commit to extract from'
7-
type: string
8-
branch:
9-
description: 'Branch to extract from'
5+
ref:
6+
description: 'Ref to extract from'
107
type: string
118
default: 'master'
129
pipeline_type:
@@ -28,12 +25,11 @@ jobs:
2825
LLVM_VERSION: ${{steps.get-parameters.outputs.LLVM_VERSION}}
2926
steps:
3027
- name: Download build parameters
31-
uses: dawidd6/action-download-artifact@v6
28+
uses: dawidd6/action-download-artifact@v10
3229
with:
3330
workflow: build.yml
3431
workflow_conclusion: success
35-
commit: ${{github.event_name != 'schedule' && inputs.commit || ''}}
36-
branch: ${{github.event_name == 'schedule' && 'master' || (inputs.commit == '' && inputs.branch || '')}}
32+
ref: ${{github.event_name == 'schedule' && 'master' || inputs.ref}}
3733
event: ${{github.event_name == 'schedule' && 'schedule' || inputs.pipeline_type}}
3834
name: parameters
3935
- name: Get build parameters
@@ -59,12 +55,11 @@ jobs:
5955
run: |
6056
choco install ninja
6157
- name: Download toolchain
62-
uses: dawidd6/action-download-artifact@v6
58+
uses: dawidd6/action-download-artifact@v10
6359
with:
6460
workflow: build.yml
6561
workflow_conclusion: success
66-
commit: ${{github.event_name != 'schedule' && inputs.commit || ''}}
67-
branch: ${{github.event_name == 'schedule' && 'master' || (inputs.commit == '' && inputs.branch || '')}}
62+
ref: ${{github.event_name == 'schedule' && 'master' || inputs.ref}}
6863
event: ${{github.event_name == 'schedule' && 'schedule' || inputs.pipeline_type}}
6964
name: windows-ucrt-${{matrix.arch}}-toolchain
7065
- name: Unpack toolchain

.github/workflows/test-llvm.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ name: Run LLVM tests
22
on:
33
workflow_dispatch:
44
inputs:
5-
commit:
6-
description: 'Commit to extract from'
7-
type: string
8-
branch:
9-
description: 'Branch to extract from'
5+
ref:
6+
description: 'Ref to extract from'
107
type: string
118
default: 'master'
129
pipeline_type:
@@ -28,12 +25,11 @@ jobs:
2825
LLVM_VERSION: ${{steps.get-parameters.outputs.LLVM_VERSION}}
2926
steps:
3027
- name: Download build parameters
31-
uses: dawidd6/action-download-artifact@v6
28+
uses: dawidd6/action-download-artifact@v10
3229
with:
3330
workflow: build.yml
3431
workflow_conclusion: success
35-
commit: ${{github.event_name != 'schedule' && inputs.commit || ''}}
36-
branch: ${{github.event_name == 'schedule' && 'master' || (inputs.commit == '' && inputs.branch || '')}}
32+
ref: ${{github.event_name == 'schedule' && 'master' || inputs.ref}}
3733
event: ${{github.event_name == 'schedule' && 'schedule' || inputs.pipeline_type}}
3834
name: parameters
3935
- name: Get build parameters
@@ -57,12 +53,11 @@ jobs:
5753
run: |
5854
choco install ninja
5955
- name: Download toolchain
60-
uses: dawidd6/action-download-artifact@v6
56+
uses: dawidd6/action-download-artifact@v10
6157
with:
6258
workflow: build.yml
6359
workflow_conclusion: success
64-
commit: ${{github.event_name != 'schedule' && inputs.commit || ''}}
65-
branch: ${{github.event_name == 'schedule' && 'master' || (inputs.commit == '' && inputs.branch || '')}}
60+
ref: ${{github.event_name == 'schedule' && 'master' || inputs.ref}}
6661
event: ${{github.event_name == 'schedule' && 'schedule' || inputs.pipeline_type}}
6762
name: windows-ucrt-${{matrix.arch}}-toolchain
6863
- name: Unpack toolchain

0 commit comments

Comments
 (0)