Skip to content

Commit 780b67d

Browse files
committed
macOS packaging - auto version and change destination
1 parent ab2c180 commit 780b67d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/cppcmake.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,30 @@ jobs:
149149
codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework/Versions/A/lsl
150150
codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework
151151
152+
# CMake does a lousy job of creating .pkg files for macOS, so we do it manually
152153
- name: package and notarize (macOS)
153154
if: matrix.config.os == 'macOS-latest'
154155
env:
155156
APPLE_DEVELOPMENT_TEAM: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
156157
APPLE_NOTARIZE_USERNAME: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
157158
APPLE_NOTARIZE_PASSWORD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
158159
run: |
159-
# CMake does a lousy job of creating .pkg files for macOS, so we do it manually
160-
# TODO: However, we need to get the version number from the CMake package!
160+
# Get the version number from the framework's Info.plist
161+
VERSION=$(plutil -extract CFBundleShortVersionString xml1 -o - install/Frameworks/lsl.framework/Versions/A/Resources/Info.plist | sed -n 's/.*<string>\(.*\)<\/string>.*/\1/p')
162+
echo "LSL_VERSION=$VERSION" >> $GITHUB_ENV
163+
164+
mkdir -p package
161165
productbuild --sign "$APPLE_CODE_SIGN_IDENTITY_INST" \
162166
--component install/Frameworks/lsl.framework \
163-
/Library/Frameworks liblsl-1.16.2-Darwin-universal.pkg
167+
/Library/Frameworks package/liblsl-${LSL_VERSION}-Darwin-universal.pkg
164168
# Notarize the package
165-
xcrun notarytool submit liblsl-1.16.2-Darwin-universal.pkg \
169+
xcrun notarytool submit package/liblsl-${LSL_VERSION}-Darwin-universal.pkg \
166170
--apple-id "$APPLE_NOTARIZE_USERNAME" \
167171
--password "$APPLE_NOTARIZE_PASSWORD" \
168172
--team-id "$APPLE_DEVELOPMENT_TEAM" \
169173
--wait
170174
# Staple the notarization ticket to the package
171-
xcrun stapler staple liblsl-1.16.2-Darwin-universal.pkg
175+
xcrun stapler staple package/liblsl-${LSL_VERSION}-Darwin-universal.pkg
172176
# If notarization fails, you can get the history of notarization requests:
173177
# xcrun notarytool history --apple-id "$APPLE_NOTARIZE_USERNAME" --password "$APPLE_NOTARIZE_PASSWORD" --team-id "$APPLE_DEVELOPMENT_TEAM"
174178
# Then you can check the status of a specific request:

0 commit comments

Comments
 (0)