-
-
Notifications
You must be signed in to change notification settings - Fork 1
202 lines (168 loc) · 9.2 KB
/
test_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: test_build
on:
workflow_dispatch:
inputs:
release:
description: 'Create Test Build'
required: true
default: 'no'
jobs:
build:
runs-on: macos-14
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: List Xcode Installations
run: sudo ls -1 /Applications | grep "Xcode"
- name: Select Xcode 16.0
run: sudo xcode-select -s /Applications/Xcode_16.0.app/Contents/Developer
- name: Change to Xcode Project Directory
run: cd Source/Marker\ Data
- name: Prepare Directories
run: |
PARENT=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
mkdir -p "$PARENT/dist/dmg-builds/latest-build"
mkdir -p "$PARENT/dist/dmg-builds/app-build"
mkdir -p "$PARENT/dist/dmg-builds/sdk"
- name: Copy Local Distribution
run: |
mkdir -p dist/dmg-builds
mkdir -p dist/dmg-builds/latest-build
cp -R ./Distribution/dmg-builds/. ./dist/dmg-builds
- name: Verify Copied Files
run: |
echo "Checking copied files..."
ls -l ./dist/dmg-builds
ls -l ./dist/dmg-builds/latest-build
ls -l ./dist/dmg-builds/uninstaller/include
- name: Copy Workflow Extensions SDK
run: |
mkdir -p dist/dmg-builds/sdk
cp -R ./SDK/Workflow_Extensions_1.0.2.dmg ./dist/dmg-builds/sdk
- name: Mount Workflow Extensions DMG
run: |
hdiutil attach ./dist/dmg-builds/sdk/Workflow_Extensions_1.0.2.dmg
- name: Install Workflow Extensions SDK
run: |
sudo installer -pkg /Volumes/WorkflowExtensionsSDK/WorkflowExtensionsSDK.pkg -target /
- name: View Volume Directory
run: |
ls /Volumes
- name: View Workflow Extensions SDK DMG Directory
run: |
ls /Volumes/WorkflowExtensionsSDK
- name: Unmount Workflow Extensions SDK DMG
run: |
hdiutil detach /Volumes/WorkflowExtensionsSDK
- name: Check Installed Workflow Extensions SDK Directory
run: |
ls /Library/Developer/SDKs
- name: Build Marker Data
run: |
PARENT=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
PROJECT_PATH="Source/Marker Data/Marker Data.xcodeproj"
SCHEME="Marker Data"
CONFIGURATION="Release"
DESTINATION="generic/platform=macOS,name=Any Mac"
BUILD_FOLDER="$PARENT/dist/dmg-builds/app-build"
echo "PARENT=$PARENT" >> $GITHUB_ENV
echo "CONFIG=$CONFIGURATION" >> $GITHUB_ENV
xcodebuild -project "$PROJECT_PATH" -scheme "$SCHEME" -configuration "$CONFIGURATION" -destination "$DESTINATION" -derivedDataPath "$BUILD_FOLDER" clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -allowProvisioningUpdates | xcpretty
- name: Prepare VM Directories
run: |
PARENT=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
mkdir -p "$PARENT/dist/dmg-builds"
mkdir -p "$PARENT/dist/dmg-builds/latest-build"
cp -R $PARENT/dist/dmg-builds/app-build/Build/Products/${{ env.CONFIG }}/Marker\ Data.app "$PARENT/dist/dmg-builds/latest-build/"
cp -R ./Distribution/dmg-builds/entitlements.plist "$PARENT/dist/dmg-builds/"
- name: Codesign Marker Data Workflow Extension
env:
APPLE_CERT_DATA: ${{ secrets.APPLE_CERT_DATA }}
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
KEYCHAIN_PASSWORD_MX: ${{ secrets.KEYCHAIN_PASSWORD_MX }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
PARENT=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
ENTITLE="$PARENT/dist/dmg-builds/entitlements.plist"
APPX1="$PARENT/dist/dmg-builds/latest-build/Marker Data.app/Contents/PlugIns/Workflow Extension.appex/Contents/MacOS/Workflow Extension"
APPX2="$PARENT/dist/dmg-builds/latest-build/Marker Data.app/Contents/PlugIns/Workflow Extension.appex/Contents/Resources/Assets.car"
APPX3="$PARENT/dist/dmg-builds/latest-build/Marker Data.app/Contents/PlugIns/Workflow Extension.appex"
echo $APPLE_CERT_DATA | base64 --decode > certificate.p12
security create-keychain -p $KEYCHAIN_PASSWORD_MX build-mx.keychain
security default-keychain -s build-mx.keychain
security unlock-keychain -p $KEYCHAIN_PASSWORD_MX build-mx.keychain
security import certificate.p12 -k build-mx.keychain -P $APPLE_CERT_PASSWORD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD_MX build-mx.keychain
/usr/bin/codesign --force -s $APPLE_TEAM_ID --options runtime --entitlements "$ENTITLE" "$APPX1" -v
/usr/bin/codesign --force -s $APPLE_TEAM_ID --options runtime --entitlements "$ENTITLE" "$APPX2" -v
/usr/bin/codesign --force -s $APPLE_TEAM_ID --options runtime --entitlements "$ENTITLE" "$APPX3" -v
- name: Codesign Marker Data Sparkle Framework
env:
APPLE_CERT_DATA: ${{ secrets.APPLE_CERT_DATA }}
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
KEYCHAIN_PASSWORD_SF: ${{ secrets.KEYCHAIN_PASSWORD_SF }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
PARENT=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
APPSF1="$PARENT/dist/dmg-builds/latest-build/Marker Data.app/Contents/Frameworks/Sparkle.framework/Versions/B/XPCServices/Installer.xpc"
APPSF2="$PARENT/dist/dmg-builds/latest-build/Marker Data.app/Contents/Frameworks/Sparkle.framework/Versions/B/XPCServices/Downloader.xpc"
APPSF3="$PARENT/dist/dmg-builds/latest-build/Marker Data.app/Contents/Frameworks/Sparkle.framework/Versions/B/Autoupdate"
APPSF4="$PARENT/dist/dmg-builds/latest-build/Marker Data.app/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app"
APPSF5="$PARENT/dist/dmg-builds/latest-build/Marker Data.app/Contents/Frameworks/Sparkle.framework"
echo $APPLE_CERT_DATA | base64 --decode > certificate.p12
security create-keychain -p $KEYCHAIN_PASSWORD_SF build-sf.keychain
security default-keychain -s build-sf.keychain
security unlock-keychain -p $KEYCHAIN_PASSWORD_SF build-sf.keychain
security import certificate.p12 -k build-sf.keychain -P $APPLE_CERT_PASSWORD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD_SF build-sf.keychain
/usr/bin/codesign --force -s $APPLE_TEAM_ID --options runtime "$APPSF1" -v
/usr/bin/codesign --force -s $APPLE_TEAM_ID --options runtime "$APPSF2" -v
/usr/bin/codesign --force -s $APPLE_TEAM_ID --options runtime "$APPSF3" -v
/usr/bin/codesign --force -s $APPLE_TEAM_ID --options runtime "$APPSF4" -v
/usr/bin/codesign --force -s $APPLE_TEAM_ID --options runtime "$APPSF5" -v
- name: Codesign Marker Data
env:
APPLE_CERT_DATA: ${{ secrets.APPLE_CERT_DATA }}
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }}
KEYCHAIN_PASSWORD_M: ${{ secrets.KEYCHAIN_PASSWORD_M }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
PARENT=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
APP="$PARENT/dist/dmg-builds/latest-build/Marker Data.app"
echo $APPLE_CERT_DATA | base64 --decode > certificate.p12
security create-keychain -p $KEYCHAIN_PASSWORD_M build-m.keychain
security default-keychain -s build-m.keychain
security unlock-keychain -p $KEYCHAIN_PASSWORD_M build-m.keychain
security import certificate.p12 -k build-m.keychain -P $APPLE_CERT_PASSWORD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD_M build-m.keychain
/usr/bin/codesign --force -s $APPLE_TEAM_ID --options runtime "$APP" -v
- name: Notarize Marker Data
env:
APPLE_DEV_ID: ${{ secrets.APPLE_DEV_ID }}
APPLE_DEV_ID_PASSWORD: ${{ secrets.APPLE_DEV_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
PARENT=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
APP="$PARENT/dist/dmg-builds/latest-build/Marker Data.app"
echo "Create keychain profile"
xcrun notarytool store-credentials "notarytool-profile" --apple-id $APPLE_DEV_ID --password $APPLE_DEV_ID_PASSWORD --team-id $APPLE_TEAM_ID
echo "Creating temp notarization archive"
ditto -c -k --keepParent "$APP" "notarization-m.zip"
echo "Notarize app"
xcrun notarytool submit "notarization-m.zip" --keychain-profile "notarytool-profile" --progress --wait
echo "Attach staple"
xcrun stapler staple "$APP"
- name: Make Directory for Zip
run: mkdir test_build
- name: Build Zip with Marker Data
run: |
mkdir -p dist
PARENT=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cp -R $PARENT/dist/dmg-builds/latest-build/Marker\ Data.app "test_build/"
ditto -c -k --sequesterRsrc --keepParent "test_build/Marker Data.app" "test_build/marker_data_test-build.zip"
rm -rf test_build/Marker\ Data.app
- name: Save App as Artifact
uses: actions/upload-artifact@v4
with:
name: Marker Data
path: test_build