forked from Sienci-Labs/gsender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
515 lines (498 loc) · 22.4 KB
/
appveyor.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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# https://stefanscherer.github.io/use-appveyor-to-build-multi-arch-docker-image/
version: "{build}-{branch}"
branches:
only:
- master
- /v\d+\.\d+\.\d+/
environment:
matrix:
# - job_name: Linux build (arm)
# appveyor_build_worker_image: Ubuntu2004
# nodejs_version: "14"
# ARCH: arm
- job_name: Windows build (x86)
appveyor_build_worker_image: Visual Studio 2019
nodejs_version: "14"
ARCH: x86
- job_name: Windows build (x64)
appveyor_build_worker_image: Visual Studio 2019
nodejs_version: "14"
ARCH: x64
- job_name: macOS build (x64)
appveyor_build_worker_image: macos
nodejs_version: "14"
ARCH: x64
- job_name: Linux build (amd64)
appveyor_build_worker_image: Ubuntu2004
nodejs_version: "14"
ARCH: amd64
- job_name: Linux build (arm64)
appveyor_build_worker_image: Ubuntu2004
nodejs_version: "14"
ARCH: arm64
global:
GH_TOKEN:
secure: jqBCwY/hOwLqF2LEGxVwiKGJC+YaXDn43WYTfh4d27NSKbWkug09qMdd1EVNtX2/
GITHUB_TOKEN:
secure: jqBCwY/hOwLqF2LEGxVwiKGJC+YaXDn43WYTfh4d27NSKbWkug09qMdd1EVNtX2/
for:
# Linux
-
matrix:
only:
- job_name: Linux build (amd64)
- job_name: Linux build (arm)
- job_name: Linux build (arm64)
fast_finish: true
init:
- uname -a
- git --version
- git config --global core.autocrlf false
- git config --global user.name "AppVeyor"
- git config --global user.email "appveyor@ci.appveyor.com"
- sh: |
export CI_BRANCH=$APPVEYOR_REPO_BRANCH
export CI_BUILD_NUMBER=$APPVEYOR_BUILD_NUMBER
export CI_COMMIT=$APPVEYOR_REPO_COMMIT
export CI_COMMIT_SHORT=${APPVEYOR_REPO_COMMIT:0:8}
export CI_COMMIT_TIMESTAMP=$APPVEYOR_REPO_COMMIT_TIMESTAMP
export CI_TAG=$APPVEYOR_REPO_TAG_NAME
echo "• ARCH=$ARCH"
echo "• CI_BRANCH=$CI_BRANCH"
echo "• CI_BUILD_NUMBER=$CI_BUILD_NUMBER"
echo "• CI_COMMIT=$CI_COMMIT"
echo "• CI_COMMIT_SHORT=$CI_COMMIT_SHORT"
echo "• CI_COMMIT_TIMESTAMP=$CI_COMMIT_TIMESTAMP"
echo "• CI_TAG=$CI_TAG"
install:
# https://github.com/cfillion/reapack/blob/master/.appveyor.yml
- |
sudo cp -af /etc/apt/sources.list /etc/apt/sources.list.old
sudo sed -i '/arch=/! s/^deb/deb [arch=amd64,i386]/' /etc/apt/sources.list
awk '
$3 !~ /ubuntu\.com/ { next }
$1 == "deb" {
$2 = "[arch=armhf,arm64]";
$3 = "http://ports.ubuntu.com/ubuntu-ports/"
} 1' /etc/apt/sources.list | sudo dd of=/etc/apt/sources.list.d/ports.list
diff -uN /etc/apt/sources.list.old /etc/apt/sources.list
cat /etc/apt/sources.list.d/ports.list
- sudo dpkg --print-architecture
- sudo dpkg --add-architecture arm64
- sudo dpkg --add-architecture armhf
- sudo dpkg --add-architecture i386
- sudo dpkg --print-foreign-architectures
- sudo apt-get update
- sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick gcc-multilib g++-multilib rpm
- nvm install $nodejs_version
- npm config set loglevel warn
- npm config set scripts-prepend-node-path auto
- npm install -g yarn
- yarn
build_script:
- sh: |
yarn clean
yarn lint
yarn test
if [[ -z "$CI_TAG" ]]; then
yarn build-latest
else
yarn build
fi
- sh: |
# i386
if [[ "$ARCH" == "i386" ]]; then
GIT_COMMIT_LOG=`git log -1 --format='%ci %H %s'`
PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
PRODUCT_NAME=gSender
yarn build:linux-ia32
ls -al output output/*
mkdir -p releases/linux
cp -af "output/${PACKAGE_NAME}-${PACKAGE_VERSION}.i686.rpm" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.i686.rpm"
cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}-i386.AppImage" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-i386.AppImage"
cp -af "output/${PACKAGE_NAME}_${PACKAGE_VERSION}_i386.deb" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-i386.deb"
pushd releases/linux
ln -sf ../../output/linux-ia32-unpacked "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-ia32"
tar zcfh "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-ia32.tar.gz" "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-ia32"
rm -f "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-ia32";
popd
ls -al releases/linux/*
if [[ "$CI_BRANCH" == "master" && -z "$CI_TAG" ]]; then
yarn github-release delete \
--owner=gSender \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
"*-linux-i386.AppImage" \
"*-linux-i386.deb" \
"*-linux.i686.rpm" \
"*-linux-ia32.tar.gz";
yarn github-release upload \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
--body="${COMMIT_LOG}" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.i686.rpm" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-i386.AppImage" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-i386.deb" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-ia32.tar.gz";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.i686.rpm";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-i386.AppImage";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-i386.deb";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-ia32.tar.gz";
fi
fi
- sh: |
# amd64
if [[ "$ARCH" == "amd64" ]]; then
GIT_COMMIT_LOG=`git log -1 --format='%ci %H %s'`
PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
PRODUCT_NAME=gSender
yarn build:linux-x64
ls -al output output/*
mkdir -p releases/linux
cp -af "output/${PACKAGE_NAME}-${PACKAGE_VERSION}.x86_64.rpm" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.x86_64.rpm"
cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}.AppImage" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-x86_64.AppImage"
cp -af "output/${PACKAGE_NAME}_${PACKAGE_VERSION}_amd64.deb" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-amd64.deb"
pushd releases/linux
ln -sf ../../output/linux-unpacked "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-x64"
tar zcfh "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-x64.tar.gz" "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-x64"
rm -f "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-x64"
popd
ls -al releases/linux/*
if [[ "$CI_BRANCH" == "master" && -z "$CI_TAG" ]]; then
yarn github-release delete \
--owner=Sienic \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
"*-linux.x86_64.rpm" \
"*-linux-x86_64.AppImage" \
"*-linux-amd64.deb" \
"*-linux-x64.tar.gz";
yarn github-release upload \
--owner=sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
--body="${GIT_COMMIT_LOG}" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.x86_64.rpm" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-x86_64.AppImage" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-amd64.deb" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-x64.tar.gz";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.x86_64.rpm";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-x86_64.AppImage";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-amd64.deb";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-x64.tar.gz";
fi
fi
- sh: |
# arm
if [[ "$ARCH" == "arm" ]]; then
GIT_COMMIT_LOG=`git log -1 --format='%ci %H %s'`
PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
PRODUCT_NAME=gSender
yarn build:linux-armv7l
ls -al output output/*
mkdir -p releases/linux
cp -af "output/${PACKAGE_NAME}-${PACKAGE_VERSION}.armv7l.rpm" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.armv7l.rpm"
cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}-armv7l.AppImage" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l.AppImage"
cp -af "output/${PACKAGE_NAME}_${PACKAGE_VERSION}_armv7l.deb" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l.deb"
pushd releases/linux
ln -sf ../../output/linux-armv7l-unpacked "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l"
tar zcfh "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l.tar.gz" "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l"
rm -f "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l"
popd
ls -al releases/linux/*
if [[ "$CI_BRANCH" == "master" && -z "$CI_TAG" ]]; then
yarn github-release delete \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
"*-linux.armv7l.rpm" \
"*-linux-armv7l.AppImage" \
"*-linux-armv7l.deb" \
"*-linux-armv7l.tar.gz";
yarn github-release upload \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
--body="${GIT_COMMIT_LOG}" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.armv7l.rpm" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l.AppImage" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l.deb" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l.tar.gz";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.armv7l.rpm";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l.AppImage";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l.deb";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-armv7l.tar.gz";
fi
fi
- sh: |
# arm64
if [[ "$ARCH" == "arm64" ]]; then
GIT_COMMIT_LOG=`git log -1 --format='%ci %H %s'`
PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
PRODUCT_NAME=gSender
yarn build:linux-arm64
ls -al output output/*
mkdir -p releases/linux
cp -af "output/${PACKAGE_NAME}-${PACKAGE_VERSION}.arm64.rpm" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.arm64.rpm"
cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}-arm64.AppImage" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64.AppImage"
cp -af "output/${PACKAGE_NAME}_${PACKAGE_VERSION}_arm64.deb" "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64.deb"
pushd releases/linux
ln -sf ../../output/linux-arm64-unpacked "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64"
tar zcfh "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64.tar.gz" "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64"
rm -f "${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64"
popd
ls -al releases/linux/*
if [[ "$CI_BRANCH" == "master" && -z "$CI_TAG" ]]; then
yarn github-release delete \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
"*-linux.arm64.rpm" \
"*-linux-arm64.AppImage" \
"*-linux-arm64.deb" \
"*-linux-arm64.tar.gz";
yarn github-release upload \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
--body="${GIT_COMMIT_LOG}" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.arm64.rpm" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64.AppImage" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64.deb" \
"releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64.tar.gz";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux.arm64.rpm";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64.AppImage";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64.deb";
#rm -f "releases/linux/${PACKAGE_NAME}-${PACKAGE_VERSION}-linux-arm64.tar.gz";
fi
fi
test: off
# Packaging artifacts
# https://www.appveyor.com/docs/packaging-artifacts
artifacts:
- path: releases/linux/*
# Publishing artifacts to GitHub Releases
# https://www.appveyor.com/docs/deployment/github
deploy:
- provider: GitHub
auth_token:
secure: jqBCwY/hOwLqF2LEGxVwiKGJC+YaXDn43WYTfh4d27NSKbWkug09qMdd1EVNtX2/
draft: true
prerelease: false
on:
appveyor_repo_tag: true # deploy on tag push only
nodejs_version: "14"
# macOS
-
matrix:
only:
- job_name: macOS build (x64)
fast_finish: true
init:
- uname -a
- git --version
- git config --global core.autocrlf false
- git config --global user.name "AppVeyor"
- git config --global user.email "appveyor@ci.appveyor.com"
- sh: |
export CI_BRANCH=$APPVEYOR_REPO_BRANCH
export CI_BUILD_NUMBER=$APPVEYOR_BUILD_NUMBER
export CI_COMMIT=$APPVEYOR_REPO_COMMIT
export CI_COMMIT_SHORT=${APPVEYOR_REPO_COMMIT:0:8}
export CI_COMMIT_TIMESTAMP=$APPVEYOR_REPO_COMMIT_TIMESTAMP
export CI_TAG=$APPVEYOR_REPO_TAG_NAME
echo "• ARCH=$ARCH"
echo "• CI_BRANCH=$CI_BRANCH"
echo "• CI_BUILD_NUMBER=$CI_BUILD_NUMBER"
echo "• CI_COMMIT=$CI_COMMIT"
echo "• CI_COMMIT_SHORT=$CI_COMMIT_SHORT"
echo "• CI_COMMIT_TIMESTAMP=$CI_COMMIT_TIMESTAMP"
echo "• CI_TAG=$CI_TAG"
install:
- nvm install $nodejs_version
- npm config set loglevel warn
- npm config set scripts-prepend-node-path auto
- npm install -g yarn
- yarn
build_script:
- sh: |
yarn clean
yarn lint
yarn test
if [[ -z "$CI_TAG" ]]; then
yarn build-latest
else
yarn build
fi
- sh: |
# x64
if [[ "$ARCH" == "x64" ]]; then
GIT_COMMIT_LOG=`git log -1 --format='%ci %H %s'`
PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
PRODUCT_NAME=gSender
yarn build:macos-x64
ls -al output output/*
mkdir -p releases/macos
cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}.dmg" "releases/macos/${PACKAGE_NAME}-${PACKAGE_VERSION}-macos.x64.dmg"
ls -al releases/macos/*
if [[ "$CI_BRANCH" == "master" && -z "$CI_TAG" ]]; then
yarn github-release delete \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
"*-macos.x64.dmg";
yarn github-release upload \
--owner=Sienci \
--repo=sender \
--tag="${CI_BRANCH}" \
--release-name="${CI_BRANCH}" \
--body="${GIT_COMMIT_LOG}" \
"releases/macos/${PACKAGE_NAME}-${PACKAGE_VERSION}-macos.x64.dmg";
#rm -f "releases/macos/${PACKAGE_NAME}-${PACKAGE_VERSION}-macos.x64.dmg";
fi
fi
test: off
# Packaging artifacts
# https://www.appveyor.com/docs/packaging-artifacts
artifacts:
- path: releases/macos/*
# Publishing artifacts to GitHub Releases
# https://www.appveyor.com/docs/deployment/github
deploy:
- provider: GitHub
auth_token:
secure: jqBCwY/hOwLqF2LEGxVwiKGJC+YaXDn43WYTfh4d27NSKbWkug09qMdd1EVNtX2/
draft: true
prerelease: false
on:
appveyor_repo_tag: true # deploy on tag push only
nodejs_version: "14"
# Windows
-
matrix:
only:
- job_name: Windows build (x64)
- job_name: Windows build (x86)
fast_finish: true
init:
- git --version
- git config --global core.autocrlf false
- git config --global user.name "AppVeyor"
- git config --global user.email "appveyor@ci.appveyor.com"
- ps: |
$env:CI_BRANCH = $env:APPVEYOR_REPO_BRANCH
$env:CI_BUILD_NUMBER = $env:APPVEYOR_BUILD_NUMBER
$env:CI_COMMIT = $env:APPVEYOR_REPO_COMMIT
$env:CI_COMMIT_SHORT = ${env:APPVEYOR_REPO_COMMIT}.SubString(0,8)
$env:CI_COMMIT_TIMESTAMP = $env:APPVEYOR_REPO_COMMIT_TIMESTAMP
$env:CI_TAG = $env:APPVEYOR_REPO_TAG_NAME
Write-Host "• ARCH=$env:ARCH"
Write-Host "• CI_BRANCH=$env:CI_BRANCH"
Write-Host "• CI_BUILD_NUMBER=$env:CI_BUILD_NUMBER"
Write-Host "• CI_COMMIT=$env:CI_COMMIT"
Write-Host "• CI_COMMIT_SHORT=$env:CI_COMMIT_SHORT"
Write-Host "• CI_COMMIT_TIMESTAMP=$env:CI_COMMIT_TIMESTAMP"
Write-Host "• CI_TAG=$env:CI_TAG"
install:
- ps: Install-Product node $env:nodejs_version
- npm config set loglevel warn
- npm config set scripts-prepend-node-path auto
- npm install -g yarn
- yarn
build_script:
- ps: |
yarn clean
yarn lint
yarn test
if (-not $env:CI_TAG) {
yarn build-latest
} else {
yarn build
}
- ps: |
if ($env:ARCH -eq "x64") {
$GIT_COMMIT_LOG = git log -1 --format='%ci %H %s'
$PACKAGE_NAME = node -e "console.log(require('./src/package.json').name)"
$PACKAGE_VERSION = node -e "console.log(require('./src/package.json').version)"
$PRODUCT_NAME = "gSender"
mkdir -Force -Path releases\windows
yarn build:windows-all
Get-ChildItem output
Copy-Item "output\${PRODUCT_NAME} Setup ${PACKAGE_VERSION}.exe" "releases\windows\${PACKAGE_NAME}-${PACKAGE_VERSION}-windows-x64.exe"
Get-ChildItem releases\windows
if ($env:CI_BRANCH -eq "master" -And -not $env:CI_TAG) {
yarn github-release delete `
--owner=Sienci `
--repo=sender `
--tag="${env:CI_BRANCH}-latest" `
--release-name="${env:CI_BRANCH}" `
"*-windows-x64.exe"
yarn github-release upload `
--owner=sienci `
--repo=sender `
--tag="${env:CI_BRANCH}-latest" `
--release-name="${env:CI_BRANCH}" `
--body="${GIT_COMMIT_LOG}" `
"releases\windows\${PACKAGE_NAME}-${PACKAGE_VERSION}-windows-x64.exe"
#Remove-Item "releases\windows\${PACKAGE_NAME}-${PACKAGE_VERSION}-windows-x64.exe"
}
}
- ps: |
if ($env:ARCH -eq "x86") {
$GIT_COMMIT_LOG = git log -1 --format='%ci %H %s'
$PACKAGE_NAME = node -e "console.log(require('./src/package.json').name)"
$PACKAGE_VERSION = node -e "console.log(require('./src/package.json').version)"
$PRODUCT_NAME = "gSender"
mkdir -Force -Path releases\windows
yarn build:windows-all
Get-ChildItem output
Copy-Item "output\${PRODUCT_NAME} Setup ${PACKAGE_VERSION}.exe" "releases\windows\${PACKAGE_NAME}-${PACKAGE_VERSION}-windows-x86.exe"
Get-ChildItem releases\windows
if ($env:CI_BRANCH -eq "master" -And -not $env:CI_TAG) {
yarn github-release delete `
--owner=Sienci `
--repo=sender `
--tag="${env:CI_BRANCH}-latest" `
--release-name="${env:CI_BRANCH}" `
"*-windows-x86.exe"
yarn github-release upload `
--owner=sienci `
--repo=sender `
--tag="${env:CI_BRANCH}-latest" `
--release-name="${env:CI_BRANCH}" `
--body="${GIT_COMMIT_LOG}" `
"releases\windows\${PACKAGE_NAME}-${PACKAGE_VERSION}-windows-x86.exe"
#Remove-Item "releases\windows\${PACKAGE_NAME}-${PACKAGE_VERSION}-windows-x86.exe"
}
}
test: off
# Packaging artifacts
# https://www.appveyor.com/docs/packaging-artifacts
artifacts:
- path: releases\windows\*
# Publishing artifacts to GitHub Releases
# https://www.appveyor.com/docs/deployment/github
deploy:
- provider: GitHub
auth_token:
secure: jqBCwY/hOwLqF2LEGxVwiKGJC+YaXDn43WYTfh4d27NSKbWkug09qMdd1EVNtX2/
draft: true
prerelease: false
on:
appveyor_repo_tag: true # deploy on tag push only
nodejs_version: "14"