Skip to content

Commit 9476438

Browse files
committed
[android] move NDK version to workflow input
There are several jobs in the swift-toolchain workflow that build against the Android NDK, and they all specify the same r26b version. This change extracts the NDK version to workflow input so that it needs only be specified in one place.
1 parent fa05cd2 commit 9476438

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.github/workflows/build-toolchain.yml

+3
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ jobs:
139139
ANDROID_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
140140
ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}
141141
ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}
142+
ANDROID_NDK_VERSION: ${{ steps.context.outputs.ANDROID_NDK_VERSION }}
142143
CMAKE_Swift_FLAGS: ${{ steps.context.outputs.CMAKE_Swift_FLAGS }}
143144
debug_info: ${{ steps.context.outputs.debug_info }}
144145
signed: ${{ steps.context.outputs.signed }}
@@ -261,6 +262,7 @@ jobs:
261262
echo compilers_build_runner=${{ inputs.windows_compilers_runner || inputs.windows_default_runner || vars.COMPILERS_BUILD_RUNNER || vars.WINDOWS_BUILD_RUNNER || 'windows-latest' }} >> ${GITHUB_OUTPUT}
262263
263264
echo ANDROID_API_LEVEL=${{ inputs.android_api_level }} >> ${GITHUB_OUTPUT}
265+
echo ANDROID_NDK_VERSION=r26b >> ${GITHUB_OUTPUT}
264266
265267
- uses: actions/upload-artifact@v4
266268
with:
@@ -316,6 +318,7 @@ jobs:
316318
ANDROID_CMAKE_CXX_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
317319
ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}
318320
ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}
321+
ANDROID_NDK_VERSION: ${{ steps.context.outputs.ANDROID_NDK_VERSION }}
319322
CMAKE_Swift_FLAGS: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}
320323
debug_info: ${{ needs.context.outputs.debug_info }}
321324
signed: ${{ needs.context.outputs.signed }}

.github/workflows/swift-toolchain.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ on:
143143
required: true
144144
type: string
145145

146+
ANDROID_NDK_VERSION:
147+
required: true
148+
type: string
149+
146150
WINDOWS_CMAKE_C_FLAGS:
147151
required: true
148152
type: string
@@ -419,7 +423,7 @@ jobs:
419423
- uses: nttld/setup-ndk@v1
420424
id: setup-ndk
421425
with:
422-
ndk-version: r26b
426+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
423427

424428
- name: Configure DS2
425429
run: |
@@ -740,7 +744,7 @@ jobs:
740744
- uses: nttld/setup-ndk@v1
741745
id: setup-ndk
742746
with:
743-
ndk-version: r26b
747+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
744748

745749
- name: Compute workspace hash
746750
id: workspace_hash
@@ -1008,7 +1012,7 @@ jobs:
10081012
- uses: nttld/setup-ndk@v1
10091013
id: setup-ndk
10101014
with:
1011-
ndk-version: r26b
1015+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
10121016

10131017
- name: Configure zlib
10141018
run: |
@@ -1148,7 +1152,7 @@ jobs:
11481152
- uses: nttld/setup-ndk@v1
11491153
id: setup-ndk
11501154
with:
1151-
ndk-version: r26b
1155+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
11521156

11531157
- name: Configure curl
11541158
run: |
@@ -1359,7 +1363,7 @@ jobs:
13591363
- uses: nttld/setup-ndk@v1
13601364
id: setup-ndk
13611365
with:
1362-
ndk-version: r26b
1366+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
13631367

13641368
- name: Configure libxml2
13651369
run: |
@@ -1568,7 +1572,7 @@ jobs:
15681572
- uses: nttld/setup-ndk@v1
15691573
id: setup-ndk
15701574
with:
1571-
ndk-version: r26b
1575+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
15721576

15731577
- name: Configure LLVM
15741578
run: |
@@ -2074,7 +2078,7 @@ jobs:
20742078
- uses: nttld/setup-ndk@v1
20752079
id: setup-ndk
20762080
with:
2077-
ndk-version: r26b
2081+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
20782082

20792083
- name: Configure libdispatch
20802084
run: |

0 commit comments

Comments
 (0)