Skip to content

Commit 5ef48fa

Browse files
committed
Fix ANDROID_NDK_ROOT envrionment to work around swiftlang/swift-driver#1879
1 parent 7527068 commit 5ef48fa

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Swift Android native cross-compiler and test runner action
22

33
This GitHub action will build and run Swift package tests on an Android emulator.
4-
This uses the [swift-android-toolchain](https://github.com/skiptools/swift-android-toolchain)
4+
This uses the [swift-android-toolchain](https://github.com/swift-android-sdk/swift-android-toolchain)
55
project to provide a cross-compiler for building
66
Swift natively for Android on a Linux or macOS host.
77

@@ -41,7 +41,7 @@ jobs:
4141
- name: "Test Swift Package on Linux"
4242
run: swift test
4343
- name: "Test Swift Package on Android"
44-
uses: skiptools/swift-android-action@v2
44+
uses: swift-android-sdk/swift-android-action@v2
4545
```
4646
4747
@@ -58,15 +58,15 @@ jobs:
5858
- name: "Test Swift Package on Linux"
5959
run: swift test
6060
- name: "Test Swift Package on Android"
61-
uses: skiptools/swift-android-action@v2
61+
uses: swift-android-sdk/swift-android-action@v2
6262
with:
6363
swift-version: 6.1
6464
```
6565

6666
### Swift Versions
6767

6868
The `swift-version` input can be set to a specific version number (e.g., "6.0.3" or "6.1.1").
69-
A shortened version like "6.0" or "6.1" will use the latest [release](https://github.com/skiptools/swift-android-toolchain/releases),
69+
A shortened version like "6.0" or "6.1" will use the latest [release](https://github.com/swift-android-sdk/swift-android-toolchain/releases),
7070
which may be a pre-release build.
7171

7272
> [!NOTE]
@@ -120,7 +120,7 @@ jobs:
120120
- name: "Test Swift Package on macOS"
121121
run: swift test
122122
- name: "Build Swift Package on Android"
123-
uses: skiptools/swift-android-action@v2
123+
uses: swift-android-sdk/swift-android-action@v2
124124
with:
125125
run-tests: false
126126
```
@@ -148,7 +148,7 @@ For example:
148148

149149
```yml
150150
- name: Test Android Package
151-
uses: skiptools/swift-android-action@v2
151+
uses: swift-android-sdk/swift-android-action@v2
152152
with:
153153
copy-files: Tests
154154
test-env: TEST_WORKSPACE=1
@@ -170,7 +170,7 @@ For example:
170170
```yml
171171
- name: Setup Toolchain
172172
id: setup-toolchain
173-
uses: skiptools/swift-android-action@v2
173+
uses: swift-android-sdk/swift-android-action@v2
174174
with:
175175
# just set up the toolchain but don't build anything
176176
build-package: false
@@ -221,7 +221,7 @@ jobs:
221221
- name: "Test Swift Package on Linux"
222222
run: swift test
223223
- name: "Test Swift Package on Android"
224-
uses: skiptools/swift-android-action@v2
224+
uses: swift-android-sdk/swift-android-action@v2
225225
macos-ios:
226226
runs-on: macos-latest
227227
steps:
@@ -245,7 +245,7 @@ jobs:
245245
```
246246

247247
For an example of this workflow in action, see a run history
248-
for the [swift-sqlite](https://github.com/skiptools/swift-sqlite/actions) package.
248+
for the [swift-sqlite](https://github.com/swift-android-sdk/swift-sqlite/actions) package.
249249

250250
## Development
251251

action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,7 @@ runs:
225225
echo "swift-branch=${SWIFT_BRANCH}" >> $GITHUB_OUTPUT
226226
227227
NDK_VERSION="${{ inputs.ndk-version }}"
228-
if [[ ${SWIFT_VERSION_ID} == swift-6.1* ]]; then
229-
# 6.1 releases require that ANDROID_NDK_ROOT *not* be set
230-
# see https://github.com/finagolfin/swift-android-sdk/issues/207
231-
echo "ANDROID_NDK_ROOT=" >> $GITHUB_ENV
232-
elif [[ "${NDK_VERSION}" != '' ]]; then
228+
if [[ "${NDK_VERSION}" != '' ]]; then
233229
# we can set ndk-version to "27" or "27.0" or "27.2.12479018"
234230
NDK_BASE=$(dirname "${ANDROID_NDK_ROOT}")
235231
echo "ANDROID_NDK_ROOT=$(ls -rd ${NDK_BASE}/${NDK_VERSION}* | head -n 1)" >> $GITHUB_ENV
@@ -382,6 +378,10 @@ runs:
382378
echo "swiftcmd=TARGET_OS_ANDROID=1 SKIP_BRIDGE=1 ${SWIFT_INSTALLATION}/bin/swift build --swift-sdk ${SWIFT_SDK_TARGET} -Xswiftc -plugin-path -Xswiftc ${SWIFT_INSTALLATION}/lib/swift/host/plugins/testing -Xswiftc -DTARGET_OS_ANDROID -Xswiftc -DSKIP_BRIDGE ${{ inputs.swift-build-flags }}" >> $GITHUB_OUTPUT
383379
echo "swift-sdk=${SWIFT_SDK_TARGET}" >> $GITHUB_OUTPUT
384380
381+
if [[ ${SWIFT_VERSION_ID} != swift-6.0* ]]; then
382+
# see https://github.com/finagolfin/swift-android-sdk/issues/207
383+
echo "ANDROID_NDK_ROOT=" >> $GITHUB_ENV
384+
fi
385385
- name: Check Swift Version
386386
shell: bash
387387
run: |

0 commit comments

Comments
 (0)