-
Notifications
You must be signed in to change notification settings - Fork 53
322 lines (280 loc) · 12.1 KB
/
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# Generate a new release (alpha or beta)
name: Release
on:
# Generate an alpha every day
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
# Note: `releaseType` will be set to an empty string when automatically run without human action (via the cronjob).
# In that case, it means we want to generate an alpha.
releaseType:
description: 'Set to "release" for a beta release.'
required: false
default: "alpha"
signExe:
description: 'Set to "true" to generate sign .exe on Windows.'
required: false
default: "false"
env:
GITHUB_USERNAME: "nuxeodrive"
GITHUB_EMAILID: "[email protected]"
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, 'macos-13']
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
#
# Global
#
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIV_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOST_DEPLOY }}
- name: Setup git
if: github.event.inputs.releaseType == 'alpha' || github.event.inputs.releaseType == ''
run: |
git config user.email ${{ env.GITHUB_EMAILID }}
git config user.name ${{ env.GITHUB_USERNAME }}
- name: Bump the version number
if: github.event.inputs.releaseType == 'alpha' || github.event.inputs.releaseType == ''
run: |
git fetch --unshallow --tags
bash tools/bump-alpha-version.sh || exit 1
#
# GNU/Linux
#
- name: "[GNU/Linux] Install AppImage checkers"
if: matrix.os == 'ubuntu-latest'
run: sudo apt install --yes appstream desktop-file-utils
- name: "[GNU/Linux] Login to the docker registry"
if: matrix.os == 'ubuntu-latest'
uses: docker/[email protected]
with:
registry: "docker-private.packages.nuxeo.com"
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: "[GNU/Linux] Set appropriate volume folders"
if: matrix.os == 'ubuntu-latest'
run: |
mkdir build dist venv
chmod 777 build dist venv
- name: "[GNU/Linux] Generate the .AppImage"
if: matrix.os == 'ubuntu-latest'
env:
REGISTRY: "docker-private.packages.nuxeo.com"
REPOSITORY: "nuxeo-drive-build"
run: docker run -v "$(pwd)":/opt/sources "${REGISTRY}/${REPOSITORY}:py-3.9.5" # XXX_PYTHON
- name: "[GNU/Linux] Ensure the AppImage is correct"
if: matrix.os == 'ubuntu-latest'
run: bash tools/linux/deploy_ci_agent.sh --check
#
# macOS
#
- name: "[macOS] Setup certificates"
if: matrix.os == 'macos-13'
run: |
wget https://www.apple.com/appleca/AppleIncRootCertificate.cer
echo "${{ secrets.CERT_APP_MACOS }}" | base64 --decode > developerID_application.p12
echo "${{ secrets.PRIV_APP_MACOS }}" | base64 --decode > nuxeo-drive.priv
#- name: "[macOS] Downloading Python"
# if: matrix.os == 'macos-13'
# run: curl https://www.python.org/ftp/python/3.9.5/python-3.9.5-macosx10.9.pkg -o "python.pkg" # XXX_PYTHON
#- name: "[macOS] Install Python"
# if: matrix.os == 'macos-13'
# run: sudo installer -pkg python.pkg -target /
- name: "[macOS] Setup the environment"
if: matrix.os == 'macos-13'
env:
MACOSX_DEPLOYMENT_TARGET: "11.3"
SYSTEM_VERSION_COMPAT: 0
run: bash tools/osx/deploy_ci_agent.sh --install-release
- name: "[macOS] Generate the .dmg and validate against 2021"
if: matrix.os == 'macos-13'
timeout-minutes: 20
env:
NXDRIVE_TEST_NUXEO_URL: "https://drive-2021.beta.nuxeocloud.com/nuxeo"
MACOSX_DEPLOYMENT_TARGET: "11.3"
KEYCHAIN_PATH: "~/Library/Keychains/drive.keychain-db"
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
NOTARIZATION_TEAMID: ${{ secrets.NOTARIZATION_TEAMID }}
SIGNING_ID: "NUXEO CORP"
SIGNING_ID_NEW: "Hyland Software, Inc."
SYSTEM_VERSION_COMPAT: 0
run: bash tools/osx/deploy_ci_agent.sh --check-upgrade
- name: "[macOS] Generate the .dmg and validate against 2023"
if: matrix.os == 'macos-13'
timeout-minutes: 20
env:
NXDRIVE_TEST_NUXEO_URL: "https://drive-2023.beta.nuxeocloud.com/nuxeo"
NXDRIVE_TEST_USERNAME: ${{ secrets.NXDRIVE_2023_TEST_USERNAME }}
NXDRIVE_TEST_PASSWORD: ${{ secrets.NXDRIVE_2023_TEST_PASSWORD }}
MACOSX_DEPLOYMENT_TARGET: "11.3"
KEYCHAIN_PATH: "~/Library/Keychains/drive.keychain-db"
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
NOTARIZATION_TEAMID: ${{ secrets.NOTARIZATION_TEAMID }}
SIGNING_ID: "NUXEO CORP"
SYSTEM_VERSION_COMPAT: 0
run: bash tools/osx/deploy_ci_agent.sh --check-upgrade
#
# Windows
#
- name: "[Windows] Unlock PowerShell"
if: matrix.os == 'windows-latest'
run: powershell Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine
- name: "[Windows] Setup the environment"
if: matrix.os == 'windows-latest'
run: powershell ".\\tools\\windows\\deploy_ci_agent.ps1" -install_release
- name: Setup Certificate
if: matrix.os == 'windows-latest'
run: |
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
cat /d/Certificate_pkcs12.p12
shell: bash
- name: Set variables
if: matrix.os == 'windows-latest'
id: variables
run: |
dir
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
echo "KEYPAIR_NAME=gt-standard-keypair" >> $GITHUB_OUTPUT
echo "CERTIFICATE_NAME=gt-certificate" >> $GITHUB_OUTPUT
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
echo "SM_API_KEY=${{ secrets.SM_API_KEY }}" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_FILE=D:\\Certificate_pkcs12.p12" >> "$GITHUB_ENV"
echo "SM_CLIENT_CERT_PASSWORD=${{ secrets.SM_CLIENT_CERT_PASSWORD }}" >> "$GITHUB_ENV"
echo "SM_KEYPAIR_ALIAS=${{ secrets.SM_KEYPAIR_ALIAS }}" >> "$GITHUB_ENV"
echo "SM_CODE_SIGNING_CERT_SHA1_HASH=${{ secrets.SM_CODE_SIGNING_CERT_SHA1_HASH }}" >> "$GITHUB_ENV"
echo "C:\Program Files (x86)\Windows Kits\10\App Certification Kit" >> $GITHUB_PATH
echo "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools" >> $GITHUB_PATH
echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
shell: bash
- name: Setup Keylocker KSP on windows
if: matrix.os == 'windows-latest'
run: |
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o Keylockertools-windows-x64.msi
msiexec /i Keylockertools-windows-x64.msi /quiet /qn
smksp_registrar.exe list
smctl.exe keypair ls
C:\Windows\System32\certutil.exe -csp "DigiCert Signing Manager KSP" -key -user
shell: cmd
- name: Certificates Sync
if: matrix.os == 'windows-latest'
run: |
smctl windows certsync --keypair-alias=${{ secrets.SM_KEYPAIR_ALIAS }}
shell: cmd
- name: Health status
if: matrix.os == 'windows-latest'
run: |
smctl healthcheck
shell: cmd
- name: "[Windows] Generate the .exe and validate against 2021"
timeout-minutes: 15
if: matrix.os == 'windows-latest'
env:
KEYCHAIN_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
NXDRIVE_TEST_NUXEO_URL: "https://drive-2021.beta.nuxeocloud.com/nuxeo"
SIGNING_ID: "Nuxeo"
SIGNTOOL_PATH: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x86'
run: powershell ".\\tools\\windows\\deploy_ci_agent.ps1" -check_upgrade
- name: "[Windows] Generate the .exe and validate against 2023"
timeout-minutes: 15
if: matrix.os == 'windows-latest'
env:
NXDRIVE_TEST_NUXEO_URL: "https://drive-2023.beta.nuxeocloud.com/nuxeo"
NXDRIVE_TEST_USERNAME: ${{ secrets.NXDRIVE_2023_TEST_USERNAME }}
NXDRIVE_TEST_PASSWORD: ${{ secrets.NXDRIVE_2023_TEST_PASSWORD }}
SIGNING_ID: "Nuxeo"
SIGNTOOL_PATH: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x86'
run: powershell ".\\tools\\windows\\deploy_ci_agent.ps1" -check_upgrade
- name: "[Windows] Generate and sign the .exe"
timeout-minutes: 15
if: matrix.os == 'windows-latest' && github.event.inputs.signExe == 'true'
env:
KEYCHAIN_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
SIGNING_ID_NEW: "Hyland Software, Inc."
SIGNTOOL_PATH: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x86'
run: powershell ".\\tools\\windows\\deploy_ci_agent.ps1" -build_installer_and_sign
- name: "Upload artifacts"
uses: actions/upload-artifact@v4
with:
name: package-distributions-${{ matrix.os }}
path: |
./dist/*.exe
./dist/*.dmg
./dist/*.AppImage
if-no-files-found: error
deploy:
runs-on: ubuntu-latest
needs: [release]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch
- name: Install SSH key for Bastion
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DEV_TOOLS_BASTION_PRIVATE_KEY }}
name: id_rsa-bastion
known_hosts: ${{ secrets.KNOWN_HOSTS_OF_BASTION }}
config: ${{ secrets.CONFIG }}
- name: Install SSH key of target
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DEV_TOOLS_EC2_PRIVATE_KEY }}
name: id_rsa-target
known_hosts: ${{ secrets.KNOWN_HOSTS_OF_TARGET }}
config: ${{ secrets.CONFIG }}
- name: Setup git
run: |
git config user.email ${{ env.GITHUB_EMAILID }}
git config user.name ${{ env.GITHUB_USERNAME }}
git fetch --unshallow --tags
git remote set-url origin "https://${{ env.GITHUB_USERNAME }}:${{ secrets.NXDRIVE_GIT_TOKEN }}@github.com/nuxeo/nuxeo-drive.git"
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: package-distributions*
path: dist/
merge-multiple: true
- name: Upload artifacts to the staging server
run: |
for f in dist/*; do
bash tools/upload.sh staging "${f}"
done
- name: Bump the version number
if: github.event.inputs.releaseType == 'alpha' || github.event.inputs.releaseType == ''
run: |
# It will fail on the git stuff, but it is not important here
bash tools/bump-alpha-version.sh || true
- name: Do the release
if: steps.extract_branch.outputs.branch == 'master'
run: |
release_type="${{ github.event.inputs.releaseType }}"
if [ "${release_type}" = "" ]; then
release_type="alpha"
fi
bash tools/release.sh --publish "${release_type}" || exit 1
bash tools/release.sh --create "${release_type}" || exit 1
env:
GIT_TOKEN: ${{ secrets.NXDRIVE_GIT_TOKEN }}
- name: Cancel the release
if: failure() || cancelled()
run: bash tools/release.sh --cancel