Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build for watchos and tvos #57

Merged
merged 24 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
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
80 changes: 20 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ on:
- 'main'

env:
BUILDER_VERSION: v0.8.18
BUILDER_VERSION: v0.9.1
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-swift
LINUX_BASE_IMAGE: ubuntu-16-x64
RUN: ${{ github.run_id }}-${{ github.run_number }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1

jobs:
lint:
Expand All @@ -32,81 +34,39 @@ jobs:
uses: norio-nomura/action-swiftlint@3.1.0
env:
DIFF_BASE: ${{ github.base_ref }}
ubuntu:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- aws-crt-swift-5-ubuntu-16-x64
- ubuntu-x64
- al2-x64
- centos-x64
steps:
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
- name: Build ${{ env.PACKAGE_NAME }}
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/${{ matrix.image }}:${{ env.BUILDER_VERSION }}
docker pull $DOCKER_IMAGE
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
al2:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- aws-crt-swift-5-al2-x64
steps:
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/${{ matrix.image }}:${{ env.BUILDER_VERSION }}
docker pull $DOCKER_IMAGE
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
centos:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- aws-crt-swift-5-centos-x64
steps:
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
# We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
- name: Build ${{ env.PACKAGE_NAME }}
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/${{ matrix.image }}:${{ env.BUILDER_VERSION }}
docker pull $DOCKER_IMAGE
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
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
./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-swift-5-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }}
osx:
runs-on: macos-11
steps:
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
ios:
./builder build -p ${{ env.PACKAGE_NAME }}
devices:
runs-on: macos-11
strategy:
fail-fast: false
matrix:
target:
- ios
- tvos
- watchos
steps:
- name: Checkout Sources
uses: actions/checkout@v2
with:
submodules: true
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream --target=ios-armv8
./builder build -p ${{ env.PACKAGE_NAME }} --target=${{ matrix.target }}-armv8
10 changes: 5 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ let excludesFromAll = ["tests", "cmake", "CONTRIBUTING.md",
var packageTargets: [Target] = []

var package = Package(name: "AwsCrt",
platforms: [.iOS(.v11), .macOS(.v10_14)],
products: [
.library(name: "AwsCommonRuntimeKit", targets: ["AwsCommonRuntimeKit"]),
.executable(name: "Elasticurl", targets: ["Elasticurl"])
]
platforms: [.iOS(.v13), .macOS(.v10_14), .tvOS(.v13), .watchOS(.v5)],
products: [
.library(name: "AwsCommonRuntimeKit", targets: ["AwsCommonRuntimeKit"]),
.executable(name: "Elasticurl", targets: ["Elasticurl"])
]
)

var calDependencies: [Target.Dependency] = ["AwsCCommon"]
Expand Down
2 changes: 1 addition & 1 deletion aws-common-runtime/s2n
Submodule s2n updated 174 files
13 changes: 10 additions & 3 deletions builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
"swift test"
],
"hosts": {
"ubuntu": {},
"macos": {},
"al2": {},
"al2012": {
"enabled": false
},
Expand All @@ -29,6 +26,16 @@
"xcodebuild -scheme AwsCommonRuntimeKit -destination 'generic/platform=iOS'"
]
},
"tvos": {
"!build_steps": [
"xcodebuild -scheme AwsCommonRuntimeKit -destination 'generic/platform=tvOS'"
]
},
"watchos": {
"!build_steps": [
"xcodebuild -scheme AwsCommonRuntimeKit -destination 'generic/platform=watchOS'"
]
},
"macos": {
"!test_steps": [
"./integ_test.sh"
Expand Down