Skip to content

Commit 30d839e

Browse files
committed
Swift Androd build
1 parent 9562903 commit 30d839e

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

.github/workflows/pull_request.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,21 @@ jobs:
6767
ARTIFACT_PATH=$(realpath ${{ runner.temp }}/swift-android-sdk/products/*.artifactbundle.tar.gz)
6868
echo "artifact-path=${ARTIFACT_PATH}" >> $GITHUB_OUTPUT
6969
70+
ARTIFACT_EXT=".artifactbundle.tar.gz"
71+
ARTIFACT_NAME=$(basename ${ARTIFACT_PATH} ${ARTIFACT_EXT})"
7072
# artifacts need a unique name so we suffix with the matrix arch(s)
71-
ARTIFACT_SUFFIX=""
7273
if [[ ! -z "${{ matrix.arch }}" ]]; then
73-
ARTIFACT_SUFFIX="-${{ matrix.arch }}"
74+
ARTIFACT_NAME="${ARTIFACT_NAME}-$(echo ${{ matrix.arch }} | tr ',' '-')"
7475
fi
75-
echo "artifact-name=$(basename ${ARTIFACT_PATH} .tar.gz)${ARTIFACT_SUFFIX}.tar.gz" >> $GITHUB_OUTPUT
76+
ARTIFACT_NAME="${ARTIFACT_NAME}${ARTIFACT_EXT}"
77+
78+
# There is no way to prevent even a single-file artifact from being zipped:
79+
# https://github.com/actions/upload-artifact?tab=readme-ov-file#zip-archives
80+
# so we tack ".zip" on to the end of the name
81+
ARTIFACT_NAME="${ARTIFACT_NAME}.zip"
82+
83+
# e.g.: swift-6.1-RELEASE_android-0.1-x86_64.artifactbundle.tar.gz
84+
echo "artifact-name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
7685
- name: Upload SDK artifactbundle
7786
uses: actions/upload-artifact@v4
7887
with:
@@ -90,21 +99,7 @@ jobs:
9099
# recent releases require that ANDROID_NDK_ROOT *not* be set
91100
# see https://github.com/finagolfin/swift-android-sdk/issues/207
92101
echo "ANDROID_NDK_ROOT=" >> $GITHUB_ENV
93-
- name: Build swift-algorithms
94-
run: |
95-
cd ${{ runner.temp }}
96-
git clone https://github.com/apple/swift-algorithms.git
97-
cd swift-algorithms
98-
${{ steps.paths.outputs.swift-path }} build --build-tests --swift-sdk x86_64-unknown-linux-android28
99-
- name: Test swift-algorithms on Android
100-
uses: skiptools/swift-android-action@main
101-
with:
102-
#package-path: ${{ runner.temp }}/DemoProject
103-
package-path: ${{ runner.temp }}/swift-algorithms
104-
installed-sdk: x86_64-unknown-linux-android28
105-
installed-swift: ${{ steps.paths.outputs.swift-root }}
106102
- name: Build Demo Project
107-
if: false
108103
run: |
109104
cd ${{ runner.temp }}
110105
mkdir DemoProject
@@ -118,3 +113,16 @@ jobs:
118113
echo 'import Dispatch' >> Sources/DemoProject/DemoProject.swift
119114
echo 'import Android' >> Sources/DemoProject/DemoProject.swift
120115
${{ steps.paths.outputs.swift-path }} build --build-tests --swift-sdk x86_64-unknown-linux-android28
116+
- name: Build swift-algorithms
117+
run: |
118+
cd ${{ runner.temp }}
119+
git clone https://github.com/apple/swift-algorithms.git
120+
cd swift-algorithms
121+
${{ steps.paths.outputs.swift-path }} build --build-tests --swift-sdk x86_64-unknown-linux-android28
122+
- name: Test swift-algorithms on Android
123+
uses: skiptools/swift-android-action@main
124+
with:
125+
#package-path: ${{ runner.temp }}/DemoProject
126+
package-path: ${{ runner.temp }}/swift-algorithms
127+
installed-sdk: x86_64-unknown-linux-android28
128+
installed-swift: ${{ steps.paths.outputs.swift-root }}

0 commit comments

Comments
 (0)