-
Notifications
You must be signed in to change notification settings - Fork 95
150 lines (127 loc) · 4.54 KB
/
macos.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
name: macOS
on:
push:
branches:
- master
- beta
- stable
pull_request:
branches:
- master
- beta
- stable
jobs:
macOS_x86-64:
runs-on: macos-10.15
env:
SIGNING_ENABLED: ${{ secrets.MACOS_CERTIFICATE_P12_DATA }}
UPLOAD_ENABLED: ${{ secrets.DROPBOX_ACCESS_TOKEN }}
steps:
- name: Install brew packages
run: brew install autoconf automake dos2unix meson
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache dependencies
uses: actions/cache@v2
id: fsdeps_cache
with:
path: fsdeps/_prefix
key: fsdeps_${{ hashFiles('fsdeps/**/*') }}_${{ runner.os }}
- name: Build dependencies
if: steps.fsdeps_cache.outputs.cache-hit != 'true'
run: |
fsdeps/make
- name: Update version
if: hashFiles('fsbuild/version') != ''
run: |
fsbuild/version
- name: Bootstrap
if: hashFiles('fsbuild/bootstrap') != ''
run: |
fsdeps/use fsbuild/bootstrap
- name: Configure
if: hashFiles('fsbuild/configure') != ''
run: |
fsdeps/use fsbuild/configure
- name: Build
run: |
fsdeps/use fsbuild/make
- name: Bundle
run: |
fsbuild/bundle
- name: Prepare signing certificate
if: env.SIGNING_ENABLED != null
env:
KEYCHAIN_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
SIGNING_CERTIFICATE_P12_DATA: ${{ secrets.MACOS_CERTIFICATE_P12_DATA }}
SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
run: |
echo $SIGNING_CERTIFICATE_P12_DATA | base64 --decode > certificate.p12
security create-keychain -p $KEYCHAIN_PASSWORD build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain
security import certificate.p12 -k build.keychain -P $SIGNING_CERTIFICATE_PASSWORD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k $KEYCHAIN_PASSWORD build.keychain
- name: Sign
if: env.SIGNING_ENABLED != null
run: |
fsbuild/sign
- name: Notarize
if: env.SIGNING_ENABLED != null
env:
NOTARIZATION_PASSWORD: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
NOTARIZATION_PROVIDER: ${{ secrets.MACOS_NOTARIZATION_PROVIDER }}
NOTARIZATION_USERNAME: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
run: |
fsbuild/notarize
- name: Archive
run: |
fsbuild/archive
- name: Install appdmg
if: hashFiles('fsbuild/build-dmg') != ''
run: |
npm install -g appdmg
- name: Build DMG
if: hashFiles('fsbuild/build-dmg') != ''
run: |
fsbuild/build-dmg
- name: Unlock keychain again
if: env.SIGNING_ENABLED != null
env:
KEYCHAIN_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
SIGNING_CERTIFICATE_P12_DATA: ${{ secrets.MACOS_CERTIFICATE_P12_DATA }}
SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
run: |
echo $SIGNING_CERTIFICATE_P12_DATA | base64 --decode > certificate.p12
security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain
- name: Sign DMG
if: hashFiles('fsbuild/sign-dmg') != '' && env.SIGNING_ENABLED != null
run: |
fsbuild/sign-dmg
- name: Notarize DMG
if: hashFiles('fsbuild/notarize-dmg') != '' && env.SIGNING_ENABLED != null
env:
NOTARIZATION_PASSWORD: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
NOTARIZATION_PROVIDER: ${{ secrets.MACOS_NOTARIZATION_PROVIDER }}
NOTARIZATION_USERNAME: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
run: |
fsbuild/notarize-dmg
- uses: actions/upload-artifact@v2
with:
name: macOS_x86-64
path: fsbuild/_dist/*
- name: Upload build to Dropbox folder
if: >-
env.UPLOAD_ENABLED != null && (
github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/dev' ||
github.ref == 'refs/heads/beta' ||
github.ref == 'refs/heads/stable'
)
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
DROPBOX_ACCESS_TOKEN: ${{ secrets.DROPBOX_ACCESS_TOKEN }}
run: |
python3 -m pip install dropbox==11.23.0
fsbuild/upload