-
Notifications
You must be signed in to change notification settings - Fork 5
239 lines (204 loc) · 8.24 KB
/
build.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
name: Build
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
release:
types:
- created
jobs:
build_ubuntu:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install
run: npm install
- name: Test
run: npm run test
- name: Build Ubuntu (AppImage)
if: ${{github.ref != 'refs/heads/main'}}
env:
MODE: production
run: |
npm run build:installer
- name: Build and Release Ubuntu (AppImage)
if: ${{github.ref == 'refs/heads/main'}}
env:
GITHUB_TOKEN: ${{secrets.github_token}}
EP_PRE_RELEASE: true
run: |
npm run publish
- name: Upload artifacts
env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_BUCKET: ${{secrets.S3_BUCKET}}
if: ${{env.AWS_BUCKET != ''}}
run: |
node scripts/prepare-artifacts.cjs AppImage
npx @dcl/cdn-uploader@next --bucket ${{secrets.S3_BUCKET}} --local-folder output --bucket-folder "launcher-branch/${{github.ref_name}}"
build_macos:
runs-on: macos-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install
run: npm install
- name: Test
run: npm run test
- name: Build MacOS (dmg)
if: ${{github.ref != 'refs/heads/main'}}
env:
MODE: production
run: |
npm run build:installer
- name: Build and Release MacOS (dmg)
if: ${{github.ref == 'refs/heads/main'}}
env:
GITHUB_TOKEN: ${{secrets.github_token}}
CSC_LINK: ${{secrets.MACOS_CSC_LINK}}
CSC_KEY_PASSWORD: ${{secrets.MACOS_CSC_KEY_PASSWORD}}
EP_PRE_RELEASE: true
run: |
npm run publish
- name: Notarize MacOS (dmg)
if: ${{github.ref == 'refs/heads/main'}}
env:
MACOS_NOTARIZATION_APPLE_ID: ${{secrets.MACOS_NOTARIZATION_APPLE_ID}}
MACOS_NOTARIZATION_TEAM_ID: ${{secrets.MACOS_NOTARIZATION_TEAM_ID}}
MACOS_NOTARIZATION_PWD: ${{secrets.MACOS_NOTARIZATION_PWD}}
run: |
# Store the notarization credentials to prevent the UI password dialog for blocking the CI
echo "Create keychain profile"
xcrun notarytool store-credentials "notary-profile" --apple-id "$MACOS_NOTARIZATION_APPLE_ID" --team-id "$MACOS_NOTARIZATION_TEAM_ID" --password "$MACOS_NOTARIZATION_PWD"
# Send the notarization request to the Apple's Notarization service and wait for the result.
echo "Notarize app"
xcrun notarytool submit "dist/Decentraland.dmg" --keychain-profile "notary-profile" --wait
# Attach the staple to the executable, this allow the app to be validated by macOS
# even when an internet connection is not available.
echo "Attach staple"
xcrun stapler staple "dist/Decentraland.dmg"
# Validate the staple attached to the executable.
echo "Validate staple"
xcrun stapler validate "dist/Decentraland.dmg"
- name: Upload artifacts
env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_BUCKET: ${{secrets.S3_BUCKET}}
if: ${{env.AWS_BUCKET != ''}}
run: |
node scripts/prepare-artifacts.cjs dmg
npx @dcl/cdn-uploader@next --bucket ${{secrets.S3_BUCKET}} --local-folder output --bucket-folder "launcher-branch/${{github.ref_name}}"
build_windows:
runs-on: windows-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install
run: npm install
- name: Test
run: npm run test
- name: Build Windows (exe)
if: ${{github.ref != 'refs/heads/main'}}
env:
MODE: production
run: |
npm run build:installer
- name: Build and Publish Windows (exe)
if: ${{github.ref == 'refs/heads/main'}}
env:
GITHUB_TOKEN: ${{secrets.github_token}}
EP_PRE_RELEASE: true
run: |
npm run publish
- name: Sign Windows Build (exe)
uses: sslcom/esigner-codesign@develop
if: ${{github.ref == 'refs/heads/main'}}
with:
command: sign
username: ${{ secrets.ES_USERNAME }}
password: ${{ secrets.ES_PASSWORD }}
credential_id: ${{ secrets.CREDENTIAL_ID }}
totp_secret: ${{ secrets.ES_TOTP_SECRET }}
file_path: ${GITHUB_WORKSPACE}/dist/Install Decentraland.exe
output_path: ${GITHUB_WORKSPACE}/dist/signed
malware_block: false
environment_name: PROD
signing_method: v2
- name: Replace signed exe
if: ${{github.ref == 'refs/heads/main'}}
run: |
Copy-Item -Path "${env:GITHUB_WORKSPACE}\dist\signed\Install Decentraland.exe" -Destination "${env:GITHUB_WORKSPACE}\dist\Install Decentraland.exe" -Force
- name: Upload artifacts exe
env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_BUCKET: ${{secrets.S3_BUCKET}}
if: ${{env.AWS_BUCKET != ''}}
run: |
node scripts/prepare-artifacts.cjs exe
npx @dcl/cdn-uploader@next --bucket ${{secrets.S3_BUCKET}} --local-folder output --bucket-folder "launcher-branch/${{github.ref_name}}"
- name: Build Windows (appx)
if: ${{github.ref != 'refs/heads/main'}}
env:
MODE: production
run: |
npm run build:appx
- name: Build and Publish Windows (appx) [moved to azure]
if: ${{github.ref == 'refs/heads/main'}}
env:
GITHUB_TOKEN: ${{secrets.github_token}}
EP_PRE_RELEASE: true
run: |
npm run publish:appx
- name: Upload artifacts appx
env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_BUCKET: ${{secrets.S3_BUCKET}}
if: ${{env.AWS_BUCKET != ''}}
run: |
node scripts/prepare-artifacts.cjs appx
npx @dcl/cdn-uploader@next --bucket ${{secrets.S3_BUCKET}} --local-folder output --bucket-folder "launcher-branch/${{github.ref_name}}"
deployment_notification:
runs-on: ubuntu-latest
name: Decentraland Unity-Renderer Deployment Notification
needs:
- build_macos
- build_windows
- build_ubuntu
steps:
- name: Comment PR
env:
AWS_BUCKET: ${{secrets.S3_BUCKET}}
if: ${{env.AWS_BUCKET != '' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'decentraland/explorer-desktop-launcher'}} # Not a fork
uses: thollander/actions-comment-pull-request@main
with:
message: |
This branch can be downloaded with the following links:
- [Windows](https://renderer-artifacts.decentraland.org/launcher-branch/${{github.ref_name}}/Install-Decentraland.exe)
- [Windows AppX](https://renderer-artifacts.decentraland.org/launcher-branch/${{github.ref_name}}/Decentraland.appx)
- [Linux](https://renderer-artifacts.decentraland.org/launcher-branch/${{github.ref_name}}/Decentraland.AppImage)
- [Mac](https://renderer-artifacts.decentraland.org/launcher-branch/${{github.ref_name}}/Decentraland.dmg)
> Mac: After installing the app, run the following command in your console: `sudo xattr -c /Applications/Decentraland.app`
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}