-
Notifications
You must be signed in to change notification settings - Fork 7
69 lines (61 loc) · 2.3 KB
/
macos.yaml
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
name: MacOS
on: push
jobs:
build-and-release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.24.4'
- name: Find and Replace OpenAIP
uses: richardrigutins/replace-in-files@v2
with:
files: '**/*.dart'
search-text: '@@___openaip_client_id__@@'
replacement-text: ${{ secrets.OPENAIP_CLIENT_ID }}
encoding: 'utf8'
max-parallelism: 10
- name: Install project dependencies
run: |
flutter pub get
brew install create-dmg
- name: Build artifacts and sign
run: |
flutter build macos --release
echo -n ${{ secrets.MACOS_DIST_CERTIFICATE }} | base64 --decode --output certificate.p12
# create temporary keychain
security create-keychain -p test_password sign.keychain
security default-keychain -s sign.keychain
security unlock-keychain -p test_password sign.keychain
security import certificate.p12 -k sign.keychain -P ${{ secrets.MACOS_DIST_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k test_password sign.keychain
security find-identity
# sign
/usr/bin/codesign --force --deep -s LPHGYCR8ZX build/macos/Build/Products/Release/AvareX.app
# make dmg
pushd build/macos/Build/Products/Release
create-dmg \
--volname "AvareX" \
--window-pos 200 200 \
--window-size 800 600 \
--icon-size 130 \
--text-size 14 \
--icon "AvareX.app" 260 250 \
--hide-extension "AvareX.app" \
--app-drop-link 540 250 \
--hdiutil-quiet \
"AvareX.dmg" \
"AvareX.app"
popd
# sign dmg
/usr/bin/codesign --force --deep -s LPHGYCR8ZX build/macos/Build/Products/Release/AvareX.dmg
# delete keychain
security delete-keychain sign.keychain
rm certificate.p12
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: MacOS
path: build/macos/Build/Products/Release/AvareX.dmg