Skip to content

Commit 6748354

Browse files
authored
feat: build for watchos and tvos (#57)
1 parent faff91d commit 6748354

File tree

4 files changed

+36
-69
lines changed

4 files changed

+36
-69
lines changed

.github/workflows/ci.yml

+20-60
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ on:
1010
- 'main'
1111

1212
env:
13-
BUILDER_VERSION: v0.8.18
13+
BUILDER_VERSION: v0.9.1
1414
BUILDER_SOURCE: releases
1515
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
1616
PACKAGE_NAME: aws-crt-swift
17-
LINUX_BASE_IMAGE: ubuntu-16-x64
1817
RUN: ${{ github.run_id }}-${{ github.run_number }}
18+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
19+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
20+
AWS_REGION: us-east-1
1921

2022
jobs:
2123
lint:
@@ -32,81 +34,39 @@ jobs:
3234
uses: norio-nomura/[email protected]
3335
env:
3436
DIFF_BASE: ${{ github.base_ref }}
35-
ubuntu:
37+
linux:
3638
runs-on: ubuntu-latest
3739
strategy:
3840
matrix:
3941
image:
40-
- aws-crt-swift-5-ubuntu-16-x64
42+
- ubuntu-x64
43+
- al2-x64
44+
- centos-x64
4145
steps:
42-
- name: Checkout Sources
43-
uses: actions/checkout@v2
44-
with:
45-
submodules: true
46-
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
4746
- name: Build ${{ env.PACKAGE_NAME }}
4847
run: |
49-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin
50-
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/${{ matrix.image }}:${{ env.BUILDER_VERSION }}
51-
docker pull $DOCKER_IMAGE
52-
docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream
53-
al2:
54-
runs-on: ubuntu-latest
55-
strategy:
56-
matrix:
57-
image:
58-
- aws-crt-swift-5-al2-x64
59-
steps:
60-
- name: Checkout Sources
61-
uses: actions/checkout@v2
62-
with:
63-
submodules: true
64-
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
65-
- name: Build ${{ env.PACKAGE_NAME }} + consumers
66-
run: |
67-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin
68-
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/${{ matrix.image }}:${{ env.BUILDER_VERSION }}
69-
docker pull $DOCKER_IMAGE
70-
docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream
71-
centos:
72-
runs-on: ubuntu-latest
73-
strategy:
74-
matrix:
75-
image:
76-
- aws-crt-swift-5-centos-x64
77-
steps:
78-
- name: Checkout Sources
79-
uses: actions/checkout@v2
80-
with:
81-
submodules: true
82-
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
83-
- name: Build ${{ env.PACKAGE_NAME }}
84-
run: |
85-
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin
86-
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/${{ matrix.image }}:${{ env.BUILDER_VERSION }}
87-
docker pull $DOCKER_IMAGE
88-
docker run --mount type=bind,source=$(pwd),target=/root/${{ env.PACKAGE_NAME }} --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} --build-dir=/root/${{ env.PACKAGE_NAME }} --spec=downstream
48+
aws s3 cp --debug s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
49+
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-swift-5-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
8950
osx:
9051
runs-on: macos-11
9152
steps:
92-
- name: Checkout Sources
93-
uses: actions/checkout@v2
94-
with:
95-
submodules: true
9653
- name: Build ${{ env.PACKAGE_NAME }} + consumers
9754
run: |
9855
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
9956
chmod a+x builder
100-
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
101-
ios:
57+
./builder build -p ${{ env.PACKAGE_NAME }}
58+
devices:
10259
runs-on: macos-11
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
target:
64+
- ios
65+
- tvos
66+
- watchos
10367
steps:
104-
- name: Checkout Sources
105-
uses: actions/checkout@v2
106-
with:
107-
submodules: true
10868
- name: Build ${{ env.PACKAGE_NAME }} + consumers
10969
run: |
11070
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
11171
chmod a+x builder
112-
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream --target=ios-armv8
72+
./builder build -p ${{ env.PACKAGE_NAME }} --target=${{ matrix.target }}-armv8

Package.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ let excludesFromAll = ["tests", "cmake", "CONTRIBUTING.md",
77
var packageTargets: [Target] = []
88

99
var package = Package(name: "AwsCrt",
10-
platforms: [.iOS(.v11), .macOS(.v10_14)],
11-
products: [
12-
.library(name: "AwsCommonRuntimeKit", targets: ["AwsCommonRuntimeKit"]),
13-
.executable(name: "Elasticurl", targets: ["Elasticurl"])
14-
]
10+
platforms: [.iOS(.v13), .macOS(.v10_14), .tvOS(.v13), .watchOS(.v5)],
11+
products: [
12+
.library(name: "AwsCommonRuntimeKit", targets: ["AwsCommonRuntimeKit"]),
13+
.executable(name: "Elasticurl", targets: ["Elasticurl"])
14+
]
1515
)
1616

1717
var calDependencies: [Target.Dependency] = ["AwsCCommon"]

aws-common-runtime/s2n

Submodule s2n updated 174 files

builder.json

+10-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
"swift test"
1111
],
1212
"hosts": {
13-
"ubuntu": {},
14-
"macos": {},
15-
"al2": {},
1613
"al2012": {
1714
"enabled": false
1815
},
@@ -29,6 +26,16 @@
2926
"xcodebuild -scheme AwsCommonRuntimeKit -destination 'generic/platform=iOS'"
3027
]
3128
},
29+
"tvos": {
30+
"!build_steps": [
31+
"xcodebuild -scheme AwsCommonRuntimeKit -destination 'generic/platform=tvOS'"
32+
]
33+
},
34+
"watchos": {
35+
"!build_steps": [
36+
"xcodebuild -scheme AwsCommonRuntimeKit -destination 'generic/platform=watchOS'"
37+
]
38+
},
3239
"macos": {
3340
"!test_steps": [
3441
"./integ_test.sh"

0 commit comments

Comments
 (0)