Skip to content

Commit c85e56a

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 ba5a0cd commit c85e56a

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
@@ -142,6 +142,7 @@ jobs:
142142
ANDROID_CMAKE_CXX_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
143143
ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}
144144
ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ steps.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}
145+
ANDROID_NDK_VERSION: ${{ steps.context.outputs.ANDROID_NDK_VERSION }}
145146
CMAKE_Swift_FLAGS: ${{ steps.context.outputs.CMAKE_Swift_FLAGS }}
146147
debug_info: ${{ steps.context.outputs.debug_info }}
147148
signed: ${{ steps.context.outputs.signed }}
@@ -274,6 +275,7 @@ jobs:
274275
echo mac_build_runner=macos-latest >> ${GITHUB_OUTPUT}
275276
276277
echo ANDROID_API_LEVEL=${{ inputs.android_api_level }} >> ${GITHUB_OUTPUT}
278+
echo ANDROID_NDK_VERSION=r26b >> ${GITHUB_OUTPUT}
277279
278280
- uses: actions/upload-artifact@v4
279281
with:
@@ -381,6 +383,7 @@ jobs:
381383
ANDROID_CMAKE_CXX_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_CXX_FLAGS }}
382384
ANDROID_CMAKE_EXE_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_EXE_LINKER_FLAGS }}
383385
ANDROID_CMAKE_SHARED_LINKER_FLAGS: ${{ needs.context.outputs.ANDROID_CMAKE_SHARED_LINKER_FLAGS }}
386+
ANDROID_NDK_VERSION: ${{ needs.context.outputs.ANDROID_NDK_VERSION }}
384387
CMAKE_Swift_FLAGS: ${{ needs.context.outputs.CMAKE_Swift_FLAGS }}
385388
debug_info: ${{ needs.context.outputs.debug_info }}
386389
signed: ${{ needs.context.outputs.signed }}

.github/workflows/swift-toolchain.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ on:
159159
required: true
160160
type: string
161161

162+
ANDROID_NDK_VERSION:
163+
required: true
164+
type: string
165+
162166
WINDOWS_CMAKE_C_FLAGS:
163167
required: true
164168
type: string
@@ -428,7 +432,7 @@ jobs:
428432
- uses: nttld/setup-ndk@v1
429433
id: setup-ndk
430434
with:
431-
ndk-version: r26b
435+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
432436

433437
- name: Configure DS2
434438
run: |
@@ -756,7 +760,7 @@ jobs:
756760
- uses: nttld/setup-ndk@v1
757761
id: setup-ndk
758762
with:
759-
ndk-version: r26b
763+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
760764

761765
- name: Compute workspace hash
762766
id: workspace_hash
@@ -1026,7 +1030,7 @@ jobs:
10261030
- uses: nttld/setup-ndk@v1
10271031
id: setup-ndk
10281032
with:
1029-
ndk-version: r26b
1033+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
10301034

10311035
- name: Configure zlib
10321036
run: |
@@ -1168,7 +1172,7 @@ jobs:
11681172
- uses: nttld/setup-ndk@v1
11691173
id: setup-ndk
11701174
with:
1171-
ndk-version: r26b
1175+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
11721176

11731177
- name: Configure curl
11741178
run: |
@@ -1381,7 +1385,7 @@ jobs:
13811385
- uses: nttld/setup-ndk@v1
13821386
id: setup-ndk
13831387
with:
1384-
ndk-version: r26b
1388+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
13851389

13861390
- name: Configure libxml2
13871391
run: |
@@ -1592,7 +1596,7 @@ jobs:
15921596
- uses: nttld/setup-ndk@v1
15931597
id: setup-ndk
15941598
with:
1595-
ndk-version: r26b
1599+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
15961600

15971601
- name: Configure LLVM
15981602
run: |
@@ -2085,7 +2089,7 @@ jobs:
20852089
- uses: nttld/setup-ndk@v1
20862090
id: setup-ndk
20872091
with:
2088-
ndk-version: r26b
2092+
ndk-version: ${{ inputs.ANDROID_NDK_VERSION }}
20892093

20902094
- name: Configure libdispatch
20912095
run: |

0 commit comments

Comments
 (0)