Skip to content

Commit 685ae5f

Browse files
authored
Split static and dynamic XCFramework build in separate jobs (ios-release.yml) (#4068)
1 parent 15476b0 commit 685ae5f

1 file changed

Lines changed: 87 additions & 38 deletions

File tree

.github/workflows/ios-release.yml

Lines changed: 87 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,8 @@ on:
1515
default: ''
1616
description: Version (only for pre-releases)
1717

18-
permissions:
19-
id-token: write # needed for AWS
20-
contents: write # allow making a release
21-
actions: write # for triggering ios-release-cocoapods.yml
22-
issues: write # for notify-release-on-prs.ts
23-
2418
jobs:
25-
ios-release:
19+
ios-build-dynamic:
2620
runs-on: macos-14
2721
defaults:
2822
run:
@@ -33,6 +27,89 @@ jobs:
3327
with:
3428
submodules: recursive
3529

30+
- name: Build XCFramework (Dynamic)
31+
run: |
32+
bazel build --compilation_mode=opt --features=dead_strip,thin_lto --objc_enable_binary_stripping \
33+
--apple_generate_dsym --output_groups=+dsyms --//:renderer=metal //platform/ios:MapLibre.dynamic --embed_label=maplibre_ios_"$(cat VERSION)"
34+
echo xcframework="$(bazel info execution_root)"/"$(bazel cquery --output=files --compilation_mode=opt --//:renderer=metal //platform/ios:MapLibre.dynamic)" >> "$GITHUB_ENV"
35+
36+
- name: Create .zip with debug symbols
37+
working-directory: ./bazel-bin/platform/ios/MapLibre.dynamic_dsyms
38+
run: |
39+
zip MapLibre_ios_device.framework.dSYM.zip MapLibre_ios_device.framework.dSYM/Contents/Resources/DWARF/MapLibre_ios_device MapLibre_ios_device.framework.dSYM/Contents/Info.plist
40+
echo debug_symbols_ios="$(realpath MapLibre_ios_device.framework.dSYM.zip)" >> "$GITHUB_ENV"
41+
42+
- name: Copy debug symbols to root
43+
working-directory: .
44+
run: cp ${{ env.debug_symbols_ios }} .
45+
46+
- name: Add license to XCFramework zip
47+
run: |
48+
cp ${{ env.xcframework }} MapLibre.dynamic.xcframework.zip
49+
chmod +w MapLibre.dynamic.xcframework.zip
50+
zip MapLibre.dynamic.xcframework.zip LICENSE.md # add license to zip
51+
working-directory: .
52+
53+
- name: Upload artifact
54+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
55+
with:
56+
name: xcframework
57+
path: |
58+
MapLibre.dynamic.xcframework.zip
59+
MapLibre_ios_device.framework.dSYM.zip
60+
61+
ios-build-static:
62+
runs-on: macos-14
63+
defaults:
64+
run:
65+
working-directory: platform/ios
66+
shell: bash
67+
steps:
68+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
69+
with:
70+
submodules: recursive
71+
72+
- name: Build XCFramework (Static)
73+
# for now, just build it TODO: make a static framework release
74+
run: |
75+
bazel build //platform/ios:MapLibre.static --//:renderer=metal --compilation_mode="opt" --copt -g --copt="-Oz" --strip never --output_groups=+dsyms --apple_generate_dsym
76+
echo xcframework_static="$(bazel info execution_root)"/"$(bazel cquery --output=files --compilation_mode=opt --//:renderer=metal //platform/ios:MapLibre.static)" >> "$GITHUB_ENV"
77+
78+
- name: Add license to XCFramework zip
79+
run: |
80+
cp ${{ env.xcframework_static }} MapLibre.static.xcframework.zip
81+
chmod +w MapLibre.static.xcframework.zip
82+
zip MapLibre.static.xcframework.zip LICENSE.md # add license to zip
83+
working-directory: .
84+
85+
- name: Upload artifact
86+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
87+
with:
88+
name: xcframework-static
89+
path: |
90+
MapLibre.static.xcframework.zip
91+
92+
ios-release:
93+
permissions:
94+
id-token: write # needed for AWS
95+
contents: write # allow making a release
96+
actions: write # for triggering ios-release-cocoapods.yml
97+
issues: write # for notify-release-on-prs.ts
98+
runs-on: ubuntu-latest
99+
needs:
100+
- ios-build-dynamic
101+
- ios-build-static
102+
defaults:
103+
run:
104+
working-directory: platform/ios
105+
shell: bash
106+
steps:
107+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
108+
with:
109+
submodules: recursive
110+
111+
- uses: actions/download-artifact@v5
112+
36113
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v4
37114
with:
38115
node-version-file: ".nvmrc"
@@ -61,24 +138,6 @@ jobs:
61138
working-directory: .
62139
run: .github/scripts/ensure-tag.sh ios-v${{ env.version }} ${{ github.sha }}
63140

64-
- name: Build XCFramework (Dynamic)
65-
run: |
66-
bazel build --compilation_mode=opt --features=dead_strip,thin_lto --objc_enable_binary_stripping \
67-
--apple_generate_dsym --output_groups=+dsyms --//:renderer=metal //platform/ios:MapLibre.dynamic --embed_label=maplibre_ios_"$(cat VERSION)"
68-
echo xcframework="$(bazel info execution_root)"/"$(bazel cquery --output=files --compilation_mode=opt --//:renderer=metal //platform/ios:MapLibre.dynamic)" >> "$GITHUB_ENV"
69-
70-
- name: Build XCFramework (Static)
71-
# for now, just build it TODO: make a static framework release
72-
run: |
73-
bazel build //platform/ios:MapLibre.static --//:renderer=metal --compilation_mode="opt" --copt -g --copt="-Oz" --strip never --output_groups=+dsyms --apple_generate_dsym
74-
echo xcframework_static="$(bazel info execution_root)"/"$(bazel cquery --output=files --compilation_mode=opt --//:renderer=metal //platform/ios:MapLibre.static)" >> "$GITHUB_ENV"
75-
76-
- name: Create .zip with debug symbols
77-
working-directory: ./bazel-bin/platform/ios/MapLibre.dynamic_dsyms
78-
run: |
79-
zip MapLibre_ios_device.framework.dSYM.zip MapLibre_ios_device.framework.dSYM/Contents/Resources/DWARF/MapLibre_ios_device MapLibre_ios_device.framework.dSYM/Contents/Info.plist
80-
echo debug_symbols_ios="$(realpath MapLibre_ios_device.framework.dSYM.zip)" >> "$GITHUB_ENV"
81-
82141
- name: Extract changelog for version
83142
run: |
84143
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "${{ env.changelog_version_heading }}" { p = 1 };' CHANGELOG.md > changelog_for_version.md
@@ -94,25 +153,15 @@ jobs:
94153
- name: Upload changelog to S3
95154
run: aws s3 cp changelog_for_version.md s3://maplibre-native/changelogs/ios-${{ env.version }}.md
96155

97-
- name: Add license to XCFramework zip
98-
run: |
99-
cp ${{ env.xcframework }} MapLibre.dynamic.xcframework.zip
100-
cp ${{ env.xcframework_static }} MapLibre.static.xcframework.zip
101-
chmod +w MapLibre.dynamic.xcframework.zip
102-
chmod +w MapLibre.static.xcframework.zip
103-
zip MapLibre.dynamic.xcframework.zip LICENSE.md # add license to zip
104-
zip MapLibre.static.xcframework.zip LICENSE.md # add license to zip
105-
working-directory: .
106-
107156
- name: Release (GitHub) - Create Draft
108157
id: github_release
109158
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
110159
with:
111160
name: ios-v${{ env.version }}
112161
files: |
113-
MapLibre.dynamic.xcframework.zip
114-
MapLibre.static.xcframework.zip
115-
${{ env.debug_symbols_ios }}
162+
xcframework/MapLibre.dynamic.xcframework.zip
163+
xcframework/MapLibre_ios_device.framework.dSYM.zip
164+
xcframework-static/MapLibre.static.xcframework.zip
116165
tag_name: ios-v${{ env.version }}
117166
prerelease: ${{ github.event.inputs.release == 'pre' }}
118167
body_path: platform/ios/changelog_for_version.md

0 commit comments

Comments
 (0)