-
Notifications
You must be signed in to change notification settings - Fork 1
251 lines (211 loc) · 8.36 KB
/
create_release.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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: Build and Release Cross-Platform Artifacts
# This triggers the workflow manually
on:
workflow_dispatch:
env:
VERSION: ${{ github.ref_name }} # Extracts the tag name as the version
jobs:
build-macos-arm:
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cx_freeze
pip install .
botocore_version=$(python -c "import botocore; print(botocore.__version__)")
git clone https://github.com/boto/botocore.git vendor/botocore
cd vendor/botocore
git checkout $botocore_version
cd ../..
find vendor/botocore/botocore/data -maxdepth 1 -type d ! -name s3\* ! -path vendor/botocore/botocore/data -exec rm -rf {} \;
pip install vendor/botocore
- name: Import the Apple Developer ID certificate
env:
APPLE_DEV_ID_CERT: ${{ secrets.APPLE_DEV_ID_CERT }}
APPLE_DEV_ID_CERT_PASS: ${{ secrets.APPLE_DEV_ID_CERT_PASS }}
run: |
echo "$APPLE_DEV_ID_CERT" | base64 --decode > DeveloperID.p12
security create-keychain -p "" build.keychain
security import DeveloperID.p12 -k build.keychain -P "$APPLE_DEV_ID_CERT_PASS" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
security unlock-keychain -p "" build.keychain
security set-keychain-settings -lut 14400 build.keychain
security list-keychains -s build.keychain
- name: Build DMG
run: |
cxfreeze bdist_dmg
mv "build/Finch S3 Client.dmg" build/finch-${{ env.VERSION }}-macos-arm64.dmg
- name: Sign the DMG
env:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
codesign --deep --timestamp --options=runtime -s "Developer ID Application: Furkan Kalkan ($APPLE_TEAM_ID)" -v build/finch-${{ env.VERSION }}-macos-arm64.dmg
- name: Notarize the DMG
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
xcrun notarytool submit build/finch-${{ env.VERSION }}-macos-arm64.dmg \
--apple-id "$APPLE_ID" \
--password "$APPLE_APP_SPECIFIC_PASSWORD" \
--team-id "$APPLE_TEAM_ID" \
--wait
- name: Staple the notarization ticket
run: |
xcrun stapler staple build/finch-${{ env.VERSION }}-macos-arm64.dmg
- name: Verify the staple
run: |
spctl -a -t open --context context:primary-signature -v build/finch-${{ env.VERSION }}-macos-arm64.dmg
- name: Clean up the keychain
run: |
security delete-keychain build.keychain
- name: Upload DMG Artifact
uses: actions/upload-artifact@v4
with:
name: macos-arm-artifact
path: build/finch-${{ env.VERSION }}-macos-arm64.dmg
build-macos-intel:
runs-on: macos-13
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cx_freeze
pip install .
botocore_version=$(python -c "import botocore; print(botocore.__version__)")
git clone https://github.com/boto/botocore.git vendor/botocore
cd vendor/botocore
git checkout $botocore_version
cd ../..
find vendor/botocore/botocore/data -maxdepth 1 -type d ! -name s3\* ! -path vendor/botocore/botocore/data -exec rm -rf {} \;
pip install vendor/botocore
- name: Import the Apple Developer ID certificate
env:
APPLE_DEV_ID_CERT: ${{ secrets.APPLE_DEV_ID_CERT }}
APPLE_DEV_ID_CERT_PASS: ${{ secrets.APPLE_DEV_ID_CERT_PASS }}
run: |
echo "$APPLE_DEV_ID_CERT" | base64 --decode > DeveloperID.p12
security create-keychain -p "" build.keychain
security import DeveloperID.p12 -k build.keychain -P "$APPLE_DEV_ID_CERT_PASS" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: -s -k "" build.keychain
security unlock-keychain -p "" build.keychain
security set-keychain-settings -lut 14400 build.keychain
security list-keychains -s build.keychain
- name: Build DMG
run: |
cxfreeze bdist_dmg
mv "build/Finch S3 Client.dmg" build/finch-${{ env.VERSION }}-macos-x86_64.dmg
- name: Sign the DMG
env:
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
codesign --deep --timestamp --options=runtime -s "Developer ID Application: Furkan Kalkan ($APPLE_TEAM_ID)" -v build/finch-${{ env.VERSION }}-macos-x86_64.dmg
- name: Notarize the DMG
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
xcrun notarytool submit build/finch-${{ env.VERSION }}-macos-x86_64.dmg \
--apple-id "$APPLE_ID" \
--password "$APPLE_APP_SPECIFIC_PASSWORD" \
--team-id "$APPLE_TEAM_ID" \
--wait
- name: Staple the notarization ticket
run: |
xcrun stapler staple build/finch-${{ env.VERSION }}-macos-x86_64.dmg
- name: Verify the staple
run: |
spctl -a -t open --context context:primary-signature -v build/finch-${{ env.VERSION }}-macos-x86_64.dmg
- name: Clean up the keychain
run: |
security delete-keychain build.keychain
- name: Upload DMG Artifact
uses: actions/upload-artifact@v4
with:
name: macos-intel-artifact
path: build/finch-${{ env.VERSION }}-macos-x86_64.dmg
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
.\scripts\install_deps.bat
- name: Build MSI
run: |
.\scripts\build_msi.bat ${{ env.VERSION }}
dir .\dist\*.*
- name: Upload MSI Artifact
uses: actions/upload-artifact@v4
with:
name: windows-artifact
path: dist/finch-${{ env.VERSION }}-windows-x86_64.msi
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build DEB
run: |
bash scripts/build_deb.sh ${{ env.VERSION }}
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: linux-artifact
path: dist/linux/finch-${{ env.VERSION }}-linux-all.deb
release:
needs: [build-macos-arm, build-macos-intel, build-windows, build-linux]
runs-on: ubuntu-latest
steps:
- name: Download MacOS Apple Silicon Artifact
uses: actions/download-artifact@v4
with:
name: macos-arm-artifact
- name: Download MacOS Intel Artifact
uses: actions/download-artifact@v4
with:
name: macos-intel-artifact
- name: Download Windows Artifact
uses: actions/download-artifact@v4
with:
name: windows-artifact
- name: Download Linux Artifact
uses: actions/download-artifact@v4
with:
name: linux-artifact
- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
name: v${{ github.ref_name }}
generateReleaseNotes: true,
artifacts: |
finch-${{ env.VERSION }}-macos-arm64.dmg
finch-${{ env.VERSION }}-macos-x86_64.dmg
finch-${{ env.VERSION }}-windows-x86_64.msi
finch-${{ env.VERSION }}-linux-all.deb