Skip to content

Commit f15b911

Browse files
committed
fix: Carthage Xcode 12 Workaround
1 parent e3761f3 commit f15b911

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/create-release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
uses: ad-m/github-push-action@master
3535
with:
3636
github_token: ${{ secrets.GITHUB_TOKEN }}
37+
branch: ${{ github.ref }}
3738

3839
- name: Restore Carthage Cache
3940
uses: actions/cache@v1
@@ -43,18 +44,23 @@ jobs:
4344
restore-keys: |
4445
${{ runner.os }}-carthage-
4546
46-
- name: Carthage Xcode Script
47+
- name: Resolving Carthage dependencies and build framework
4748
run: |
49+
set -euo pipefail
50+
4851
xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
4952
trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
53+
54+
# For Xcode 12 make sure EXCLUDED_ARCHS is set to arm architectures otherwise
55+
# the build will fail on lipo due to duplicate architectures.
56+
5057
CURRENT_XCODE_VERSION=$(xcodebuild -version | grep "Build version" | cut -d' ' -f3)
5158
echo "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$CURRENT_XCODE_VERSION = arm64 arm64e armv7 armv7s armv6 armv8" >> $xcconfig
59+
5260
echo 'EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200 = $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64__XCODE_1200__BUILD_$(XCODE_PRODUCT_BUILD_VERSION))' >> $xcconfig
5361
echo 'EXCLUDED_ARCHS = $(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT)__XCODE_$(XCODE_VERSION_MAJOR))' >> $xcconfig
54-
export XCODE_XCCONFIG_FILE="$xcconfig"
5562
56-
- name: Resolving Carthage dependencies and build framework
57-
run: |
63+
export XCODE_XCCONFIG_FILE="$xcconfig"
5864
carthage update --cache-builds --new-resolver --configuration Release
5965
carthage build --archive --cache-builds --configuration Release
6066

0 commit comments

Comments
 (0)