-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
158 lines (135 loc) · 4.82 KB
/
build-macos.yml
File metadata and controls
158 lines (135 loc) · 4.82 KB
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
name: Build macOS
on:
workflow_call:
inputs:
version:
required: true
type: string
build_type:
required: true
type: string
installer_base_name:
required: true
type: string
jobs:
build-macos:
permissions:
contents: "read"
id-token: "write"
env:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
BUILD_TYPE: ${{ inputs.build_type }}
VERSION: ${{ inputs.version }}
runs-on: macos-15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download pubspec.yaml
uses: actions/download-artifact@v4
with:
name: pubspec
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: true
- name: Cache Flutter dependencies
uses: actions/cache@v4
timeout-minutes: 5
continue-on-error: true
with:
path: |
~/.pub-cache
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-flutter-
- name: Cache macOS CocoaPods
uses: actions/cache@v4
timeout-minutes: 10
continue-on-error: true
with:
path: |
macos/Pods
key: ${{ runner.os }}-macos-pods-${{ hashFiles('macos/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-macos-pods-
- name: Install Flutter
uses: subosito/flutter-action@v2.22.0
with:
channel: stable
flutter-version-file: .github/flutter-version.yaml
- name: Decode APP_ENV
uses: timheuer/base64-to-file@v1.2
with:
fileName: "app.env"
fileDir: ${{ github.workspace }}
encodedString: ${{ secrets.APP_ENV }}
- name: Install node on macOS
uses: actions/setup-node@v4
with:
node-version: 18
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Import Code Signing Certificates
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.MACOS_BNS_CERT }}
p12-password: ${{ secrets.MACOS_BNS_CERT_PASS }}
- name: Install provisioning profiles for macOS
env:
BUILD_MACOS_PROVISION_PROFILE_BASE64: ${{ secrets.MACOS_PROVISION_PROFILE_BASE64 }}
BUILD_MACOS_TUNNEL_PROFILE_BASE64: ${{ secrets.MACOS_PROVISION_TUNNEL_BASE64 }}
run: |
PROVISIONING_PROFILES_DIR=~/Library/MobileDevice/Provisioning\ Profiles
mkdir -p "$PROVISIONING_PROFILES_DIR"
PP_PATH=$RUNNER_TEMP/build_pp.provisionprofile
PT_PATH=$RUNNER_TEMP/build_pt.provisionprofile
echo -n "$BUILD_MACOS_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
echo -n "$BUILD_MACOS_TUNNEL_PROFILE_BASE64" | base64 --decode -o $PT_PATH
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
cp $PT_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Enable Flutter Desktop Support
run: flutter config --enable-macos-desktop
- name: Set gomobile cache dir
shell: bash
run: |
echo "GOMOBILECACHE=$HOME/.cache/gomobile" >> "$GITHUB_ENV"
mkdir -p "$HOME/.cache/gomobile"
- name: Cache gomobile
uses: actions/cache@v4
timeout-minutes: 10
continue-on-error: true
with:
path: ~/.cache/gomobile
key: ${{ runner.os }}-gomobile-${{ hashFiles('**/go.mod', '**/go.sum') }}
restore-keys: |
${{ runner.os }}-gomobile-
- name: Install dependencies
run: make install-macos-deps
env:
GOMOBILECACHE: ${{ env.GOMOBILECACHE }}
- name: Run macOS unit tests
run: make macos-unit-tests
- name: Build macOS release
run: make macos-release
env:
BUILD_TYPE: ${{ inputs.build_type }}
VERSION: ${{ inputs.version }}
INSTALLER_NAME: ${{ inputs.installer_base_name }}
GOMOBILECACHE: ${{ env.GOMOBILECACHE }}
- name: Check system extension build number monotonicity
if: ${{ inputs.build_type == 'nightly' }}
shell: bash
env:
BUILD_TYPE: ${{ inputs.build_type }}
INSTALLER_BASE_NAME: ${{ inputs.installer_base_name }}
BUCKET: ${{ vars.S3_RELEASES_BUCKET }}
run: bash ./.github/scripts/check_macos_sysext_build.sh
- name: Upload macOS installer
uses: actions/upload-artifact@v4
with:
name: lantern-installer-dmg
path: ${{ inputs.installer_base_name }}${{ inputs.build_type != 'production' && format('-{0}', inputs.build_type) || '' }}.dmg
retention-days: 2