Skip to content

Commit e7b1b81

Browse files
committed
Try signing and packaging before uploading artifact
1 parent 682291a commit e7b1b81

File tree

1 file changed

+37
-53
lines changed

1 file changed

+37
-53
lines changed

.github/workflows/apple.yml

Lines changed: 37 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,7 @@ jobs:
109109
codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework
110110
fi
111111
112-
- name: Zip LSL Framework
113-
run: |
114-
cd install/Frameworks
115-
zip -r lsl.framework.zip lsl.framework
116-
cd ../..
117-
118-
- name: Upload LSL Framework Zip
119-
uses: actions/upload-artifact@v4
120-
with:
121-
name: build-${{ matrix.config.name }}
122-
path: install/Frameworks/lsl.framework.zip
112+
123113

124114
# run internal tests
125115
# - name: unit tests
@@ -130,13 +120,48 @@ jobs:
130120
# install/bin/lsl_test_exported --order rand --wait-for-keypress never --durations yes
131121
# timeout-minutes: 10
132122

123+
- name: Package and Notarize macOS Installer
124+
if: matrix.config.name == 'macOS-latest'
125+
env:
126+
APPLE_DEVELOPMENT_TEAM: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
127+
APPLE_NOTARIZE_USERNAME: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
128+
APPLE_NOTARIZE_PASSWORD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
129+
run: |
130+
set -x
131+
# Get the version number from the framework's Info.plist
132+
VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" install/Frameworks/lsl.framework/Versions/A/Resources/Info.plist)
133+
echo "LSL_VERSION=$VERSION" >> $GITHUB_ENV
134+
echo $VERSION
135+
echo $LSL_VERSION
136+
137+
mkdir -p package
138+
productbuild --sign "$APPLE_CODE_SIGN_IDENTITY_INST" \
139+
--component install/Frameworks/lsl.framework \
140+
/Library/Frameworks package/liblsl-${LSL_VERSION}-Darwin-universal.pkg
141+
# Notarize the package
142+
xcrun notarytool submit package/liblsl-${LSL_VERSION}-Darwin-universal.pkg \
143+
--apple-id "$APPLE_NOTARIZE_USERNAME" \
144+
--password "$APPLE_NOTARIZE_PASSWORD" \
145+
--team-id "$APPLE_DEVELOPMENT_TEAM" \
146+
--wait --verbose
147+
# Staple the notarization ticket to the package
148+
xcrun stapler staple package/liblsl-${LSL_VERSION}-Darwin-universal.pkg
149+
133150
- name: upload dump
134151
if: failure()
135152
uses: actions/upload-artifact@v4
136153
with:
137154
name: dumps-${{ matrix.config.name }}
138155
path: dumps
139156

157+
- name: upload install dir
158+
uses: actions/upload-artifact@v4
159+
with:
160+
name: build-${{ matrix.config.name }}
161+
path: |
162+
install
163+
package/*.pkg
164+
140165
package_and_deploy:
141166
name: Package and Deploy
142167
needs: build
@@ -152,59 +177,18 @@ jobs:
152177
name: build-iOS
153178
path: build-iOS
154179

155-
- name: Unzip macOS Framework
156-
run: |
157-
unzip build-macOS-latest/lsl.framework.zip -d build-macOS-latest/Frameworks
158-
159180
- name: Unzip iOS Framework
160181
run: |
161182
unzip build-iOS/lsl.framework.zip -d build-iOS/Frameworks
162183
163-
- name: Install certificates and provisioning profiles
164-
uses: ./.github/actions/install-apple-certs
165-
with:
166-
MACOS_CERTIFICATE_APP: ${{ secrets.PROD_MACOS_CERTIFICATE }}
167-
MACOS_CERTIFICATE_INST: ${{ secrets.PROD_MACOS_CERTIFICATE_INST }}
168-
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
169-
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
170-
171-
- name: Package and Notarize macOS Installer
172-
env:
173-
APPLE_DEVELOPMENT_TEAM: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
174-
APPLE_NOTARIZE_USERNAME: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
175-
APPLE_NOTARIZE_PASSWORD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
176-
run: |
177-
set -x
178-
# Get the version number from the framework's Info.plist
179-
VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" build-macOS-latest/Frameworks/lsl.framework/Versions/A/Resources/Info.plist)
180-
echo "LSL_VERSION=$VERSION" >> $GITHUB_ENV
181-
182-
mkdir -p package
183-
productbuild --sign "$APPLE_CODE_SIGN_IDENTITY_INST" \
184-
--component build-macOS-latest/Frameworks/lsl.framework \
185-
/Library/Frameworks package/liblsl-$LSL_VERSION-Darwin-universal.pkg
186-
# Notarize the package
187-
xcrun notarytool submit package/liblsl-$LSL_VERSION-Darwin-universal.pkg \
188-
--apple-id "$APPLE_NOTARIZE_USERNAME" \
189-
--password "$APPLE_NOTARIZE_PASSWORD" \
190-
--team-id "$APPLE_DEVELOPMENT_TEAM" \
191-
--wait --verbose
192-
# Staple the notarization ticket to the package
193-
xcrun stapler staple package/liblsl-$LSL_VERSION-Darwin-universal.pkg
194-
195-
# If notarization fails, you can get the history of notarization requests:
196-
# xcrun notarytool history --apple-id "$APPLE_NOTARIZE_USERNAME" --password "$APPLE_NOTARIZE_PASSWORD" --team-id "$APPLE_DEVELOPMENT_TEAM"
197-
# Then you can check the status of a specific request:
198-
# xcrun notarytool log <request-id> --apple-id "$APPLE_NOTARIZE_USERNAME" --password "$APPLE_NOTARIZE_PASSWORD" --team-id "$APPLE_DEVELOPMENT_TEAM"
199-
200184
- name: Create, Sign, and Notarize XCFramework
201185
env:
202186
APPLE_DEVELOPMENT_TEAM: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
203187
APPLE_NOTARIZE_USERNAME: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
204188
APPLE_NOTARIZE_PASSWORD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
205189
run: |
206190
xcodebuild -create-xcframework \
207-
-framework build-macOS-latest/Frameworks/lsl.framework \
191+
-framework build-macOS-latest/install/Frameworks/lsl.framework \
208192
-framework build-iOS/Frameworks/lsl.framework \
209193
-output lsl.xcframework
210194

0 commit comments

Comments
 (0)