forked from cncjs/cncjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
103 lines (93 loc) · 3.98 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
# http://www.appveyor.com/docs/appveyor-yml
version: "{build}-{branch}"
init:
- git --version
- git config --global core.autocrlf false
- git config --global user.name "AppVeyor"
- git config --global user.email "[email protected]"
environment:
matrix:
- nodejs_version: "6"
global:
GITHUB_TOKEN:
secure: 14dS/9loZ4uMoKGOHGkagaYp5oS30HSIQcPB0FEa7aTEfpb2VJQiUms82hv8nWxY
# CSC_LINK:
# secure: a+2xo1z15zej505BjOcL6iIaGEbVgJd4usmxpKZWUP4sI2tLvQdBLMOXdxr/KGzVBtMYKDHJcl3Xpv+iOUXeRjd4iplIZkkSaCUkE9mbccs=
# CSC_KEY_PASSWORD:
# secure: vysRX38PjZMwcrzs07Kn7w==
matrix:
fast_finish: true
platform:
- x64
install:
- ps: |
Write-Host "Build directory: " -NoNewLine
Write-Host $env:APPVEYOR_BUILD_FOLDER -ForegroundColor "Green"
Write-Host "Build number: " -NoNewLine
Write-Host $env:APPVEYOR_BUILD_NUMBER -ForegroundColor "Green"
Write-Host "Branch: " -NoNewLine
Write-Host $env:APPVEYOR_REPO_BRANCH -ForegroundColor "Green"
Write-Host "Tag: " -NoNewLine
Write-Host $env:APPVEYOR_REPO_TAG_NAME -ForegroundColor "Green"
Write-Host "Commit: " -NoNewLine
Write-Host $env:APPVEYOR_REPO_COMMIT -ForegroundColor "Green"
Write-Host "Commit timestamp: " -NoNewLine
Write-Host $env:APPVEYOR_REPO_COMMIT_TIMESTAMP -ForegroundColor "Green"
- ps: Install-Product node $env:nodejs_version $env:platform
- npm install -g npm
- npm --version
- npm install
build_script:
- ps: |
if ($env:APPVEYOR_REPO_TAG -eq 'false' -or $env:APPVEYOR_REPO_TAG -eq 'False') {
npm run build-latest
}
else {
npm run build
}
- ps: mkdir releases
- ps: $PACKAGE_NAME = bash -c 'scripts/package-name.sh src/package.json'
- ps: $PACKAGE_VERSION = bash -c 'scripts/package-version.sh src/package.json'
- ps: $env:RELEASE = "${PACKAGE_NAME}-${PACKAGE_VERSION}"
- ps: $env:COMMIT_LOG = git log -1 --format='%ci %H %s'
- ps: echo "$env:RELEASE"
- ps: echo "$env:COMMIT_LOG"
- ps: |
if ($env:nodejs_version -eq '6' -And $env:platform -eq 'x64') {
npm run build:win-x64
Get-ChildItem output
Copy-Item "output\${PACKAGE_NAME} Setup ${PACKAGE_VERSION}.exe" "releases\${env:RELEASE}-win-x64.exe"
Get-ChildItem releases
if ($env:APPVEYOR_REPO_TAG -eq 'false' -or $env:APPVEYOR_REPO_TAG -eq 'False') {
npm run github-release -- delete --owner=cncjs --repo=cncjs --tag="${env:APPVEYOR_REPO_BRANCH}-latest" --name="${env:APPVEYOR_REPO_BRANCH}" "*-win-x64.exe"
npm run github-release -- upload --owner=cncjs --repo=cncjs --tag="${env:APPVEYOR_REPO_BRANCH}-latest" --name="${env:APPVEYOR_REPO_BRANCH}" --body="${env:COMMIT_LOG}" "releases\${env:RELEASE}-win-x64.exe"
}
}
- ps: |
if ($env:nodejs_version -eq '6' -And $env:platform -eq 'x64') {
npm run build:win-ia32
Get-ChildItem output
Copy-Item "output\${PACKAGE_NAME} Setup ${PACKAGE_VERSION}.exe" "releases\${env:RELEASE}-win-ia32.exe"
Get-ChildItem releases
if ($env:APPVEYOR_REPO_TAG -eq 'false' -or $env:APPVEYOR_REPO_TAG -eq 'False') {
npm run github-release -- delete --owner=cncjs --repo=cncjs --tag="${env:APPVEYOR_REPO_BRANCH}-latest" --name="${env:APPVEYOR_REPO_BRANCH}" "*-win-ia32.exe"
npm run github-release -- upload --owner=cncjs --repo=cncjs --tag="${env:APPVEYOR_REPO_BRANCH}-latest" --name="${env:APPVEYOR_REPO_BRANCH}" --body="${env:COMMIT_LOG}" "releases\${env:RELEASE}-win-ia32.exe"
}
}
test: off
# Packaging artifacts
# https://www.appveyor.com/docs/packaging-artifacts
artifacts:
# pushing all *.exe files in a directory
- path: releases\*.exe
# Publishing artifacts to GitHub Releases
# https://www.appveyor.com/docs/deployment/github
deploy:
- provider: GitHub
auth_token:
secure: 14dS/9loZ4uMoKGOHGkagaYp5oS30HSIQcPB0FEa7aTEfpb2VJQiUms82hv8nWxY
draft: false
prerelease: false
on:
appveyor_repo_tag: true # deploy on tag push only
nodejs_version: "6"