Skip to content

Commit

Permalink
Fix building for older macOS versions (#45)
Browse files Browse the repository at this point in the history
* Explicitly set GitHub runners
* Install Swift runtime for integration tests
  • Loading branch information
majd authored Feb 28, 2022
1 parent b257a5c commit 2f3b033
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
get_version:
name: Get version
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Set output
id: set_output
Expand All @@ -17,12 +17,10 @@ jobs:
version: ${{ steps.set_output.outputs.version }}
test:
name: Run tests
runs-on: macos-latest
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure Xcode
run: sudo xcode-select -s "/Applications/Xcode_13.2.1.app"
- name: Inject version
run: ./Scripts/version
- name: Build
Expand All @@ -31,13 +29,11 @@ jobs:
run: swift test
build:
name: Build
runs-on: macos-latest
runs-on: macos-11
needs: [get_version, test]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure Xcode
run: sudo xcode-select -s "/Applications/Xcode_13.2.1.app"
- name: Inject version
run: ./Scripts/version
- name: Build
Expand All @@ -50,7 +46,7 @@ jobs:
if-no-files-found: error
distribute:
name: Distribute
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: [get_version, build]
steps:
- name: Download binary
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ on:
jobs:
build:
name: Build
runs-on: macos-latest
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure Xcode
run: sudo xcode-select -s "/Applications/Xcode_13.2.1.app"
- name: Inject version
run: ./Scripts/version
- name: Build
Expand Down Expand Up @@ -41,5 +39,11 @@ jobs:
path: ipatool-current
- name: Update permissions
run: chmod +x ./ipatool-current/ipatool
- name: Install Swift toolchain
run: |
wget https://download.swift.org/swift-5.5.3-release/xcode/swift-5.5.3-RELEASE/swift-5.5.3-RELEASE-osx.pkg
sudo installer -pkg swift-5.5.3-RELEASE-osx.pkg -target /
- name: Run tests
run: ./ipatool-current/ipatool ${{ matrix.command }} --help
run: |
export DYLD_LIBRARY_PATH=/Library/Developer/Toolchains/swift-5.5.3-RELEASE.xctoolchain/usr/lib/swift/macosx
./ipatool-current/ipatool ${{ matrix.command }} --help
4 changes: 1 addition & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ on:
jobs:
test-networking:
name: Test Networking
runs-on: macos-latest
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure Xcode
run: sudo xcode-select -s "/Applications/Xcode_13.2.1.app"
- name: Inject version
run: ./Scripts/version
- name: Build
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ prefix ?= /usr/local
bindir = $(prefix)/bin

build:
swift build --configuration release --triple arm64-apple-macosx
swift build --configuration release --triple x86_64-apple-macosx
swift build --product ipatool --configuration release --triple arm64-apple-macosx
swift build --product ipatool --configuration release --triple x86_64-apple-macosx
lipo -create -output .build/ipatool .build/arm64-apple-macosx/release/ipatool .build/x86_64-apple-macosx/release/ipatool

install: build
Expand Down
13 changes: 8 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ let package = Package(
.package(url: "https://github.com/weichsel/ZIPFoundation", revision: "0.9.14")
],
targets: [
.executableTarget(name: "CLI", dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.byName(name: "Networking"),
.byName(name: "StoreAPI")
]),
.executableTarget(
name: "CLI",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.byName(name: "Networking"),
.byName(name: "StoreAPI")
]
),
.target(
name: "StoreAPI",
dependencies: [
Expand Down

0 comments on commit 2f3b033

Please sign in to comment.