forked from pglet/pglet-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
61 lines (47 loc) · 1.28 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
version: 0.1.{build}
skip_branch_with_pr: true
image: Visual Studio 2019
environment:
NODE_VERSION: 12
NPM_TOKEN:
secure: k2cSmOKcnk4Va2hNea/oVjUCIyWl+iAMMS0ZgxWzXFHQg/0q5f+T7JyKYEIEF56Y
init:
- ps: Install-Product node $env:NODE_VERSION
- ps: npm install -g typescript
build_script:
# run tests
- tsc --version
- node --version
- npm --version
# build and publish package
- echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
- ps: |
$ErrorActionPreference = "Stop"
if ($env:APPVEYOR_REPO_TAG -eq 'true') {
# release mode
# version
$ver = $env:APPVEYOR_REPO_TAG_NAME
if ($ver.StartsWith('v')) { $ver = $ver.Substring(1) }
# prerelease moniker
$idx = $ver.indexOf('-')
if ($idx -ne -1) {
$prerelease = $ver.Substring($idx + 1)
$ver = $ver.Substring(0, $idx)
}
} else {
# build mode
$ver = $env:APPVEYOR_BUILD_VERSION
$env:NPM_TOKEN = '123'
}
# patch version
$packageJson = Get-Content 'package.json' | ConvertFrom-Json
$packageJson.version = $ver
$packageJson | ConvertTo-Json -Depth 20 | Set-Content -Path 'package.json'
- npm install
- npm test
- tsc
- npm pack
- IF "%APPVEYOR_REPO_TAG%"=="true" npm publish --access public
test: off
artifacts:
- path: '**\*.tgz'