Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/android_sdk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Swift SDK for Android
on:
workflow_call:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I configured this so that the release pipeline could use it if needed.

push:
branches: [main]
paths:
- '.github/workflows/android_sdk.yaml'
pull_request:
branches: [main]
paths:
- '.github/workflows/android_sdk.yaml'

jobs:
# Generic versioning support of https://www.swift.org/documentation/articles/swift-sdk-for-android-getting-started.html
# Downloads the Android SDK for the active SDK version, determines the checksum, installs the sdk and configures the Android NDK.
# Finally runs build.
android_test:
name: Build with Swift SDK for Android on Ubuntu
strategy:
fail-fast: false
matrix:
swift_version: ["6.3.3"]
runs-on: ubuntu-22.04

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opted for Ubuntu as linux runners are cheap than macos.

env:
OPENSWIFTUI_WERROR: 0 # Disable it to avoid enable OAG's werror and hit conflicts
OPENSWIFTUI_OPENATTRIBUTESHIMS_ATTRIBUTEGRAPH: 0
OPENSWIFTUI_COMPATIBILITY_TEST: 0
OPENSWIFTUI_SWIFT_LOG: 1
OPENSWIFTUI_SWIFT_CRYPTO: 1
OPENSWIFTUI_LINK_TESTING: 1
Comment on lines +25 to +30

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is copy pasta; they seem important but can be cleaned up as needed!

ANDROID_NDK_HOME: ''
container: swift:${{ matrix.swift_version }}-jammy
steps:
- uses: actions/checkout@v4
- name: Download ${{ matrix.swift_version }} SDK artifact
run: curl -o https://download.swift.org/swift-${{ matrix.swift_version }}-release/android-sdk/swift-${{ matrix.swift_version }}-RELEASE/swift-${{ matrix.swift_version }}-RELEASE_android.artifactbundle.tar.gz
- name: Configure Swift SDK for Android
run: |
echo "$(swift package compute-checksum swift-${{ matrix.swift_version }}-RELEASE_android.artifactbundle.tar.gz)" | \
swift sdk install swift-${{ matrix.swift_version }}-RELEASE_android.artifactbundle.tar.gz --checksum
- name: Install & Confgure Android
working-directory: ~/.swiftpm/swift-sdks/swift-${{ matrix.swift_version }}-RELEASE_android.artifactbundle/swift-android/
run: |
curl -fSL -o ndk.zip "https://dl.google.com/android/repository/android-ndk-r27d-$(uname -s).zip"
unzip -qo ndk.zip
echo "ANDROID_NDK_HOME=$PWD/android-ndk-r27d" >> $GITHUB_ENV
./scripts/setup-android-sdk.sh
- name: Build artifacts
run: swift build --swift-sdk x86_64-unknown-linux-android28 --static-swift-stdlib
Comment on lines +48 to +49

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Artifact storage is still up for a decision but this gets the foundation.