This repository has been archived by the owner on Jul 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
appveyor.yml
109 lines (84 loc) · 4.08 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
image: Visual Studio 2017
platform:
- x64
environment:
PKG_CACHE_PATH: '%USERPROFILE%\pkg-cache'
TEST_SCREENSHOT_DIR: '%USERPROFILE%\test-screenshots'
APPVEYOR_BUILD_ARTIFACT_STORAGE: gce-artifacts-us
cache:
- '%APPDATA%\npm'
- '%APPDATA%\npm-cache'
- '%LOCALAPPDATA%\bower'
- '%USERPROFILE%\pkg-cache'
install:
- ps: Install-Product node 8 x64
- npm install -g npm@latest
- npm install -g bower nodecg-cli
- npm install -g https://github.com/randallknutson/pkg.git#build
- npm ci # http://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable
- bower install
before_build:
# Debug prints
- node --version
- npm --version
# Clone NodeCG, so that we can reference its types.
# Don't install its deps yet though.
- cd ..
- git clone https://github.com/nodecg/nodecg.git
- cd nodecg
- git checkout a6637d331a9c301d60957a89b3ba0dec708165b3
# Move our bundle into the expected path, and cd back into that dir.
- 'move %APPVEYOR_BUILD_FOLDER% bundles\%APPVEYOR_PROJECT_SLUG%'
- cd bundles\%APPVEYOR_PROJECT_SLUG%
build_script:
- npm run build
- npm run test
after_build:
# Get rid of our bundle's devDeps, we only want to package prod deps.
- npm ci --production
# Install NodeCG's deps
- cd ../..
- npm ci --production && bower install
# Delete .git files, so that they aren't added to the package.
- del /f/s/q .git bundles\%APPVEYOR_PROJECT_SLUG%\.git > nul
- rmdir /s/q .git bundles\%APPVEYOR_PROJECT_SLUG%\.git
# Delete test files, so that they aren't added to the package.
- del /f/s/q test bundles\%APPVEYOR_PROJECT_SLUG%\test > nul
- rmdir /s/q test bundles\%APPVEYOR_PROJECT_SLUG%\test
# Some real bullshit
- ps: '$env:GOD_DAMNIT = "./node_modules/@babel/core/lib/config/files/plugins.js"'
- ps: (Get-Content -path $env:GOD_DAMNIT -Raw).replace('const standardizedName = standardizeName(type, name);','const standardizedName = standardizeName(type, name); dirname = "/snapshot/nodecg/";') | Set-Content -Path $env:GOD_DAMNIT
# Create our exe using Zeit pkg.
- pkg . --targets node8-win-x64 --public
# Download our demo config.
- if not exist cfg mkdir cfg
- ps: Start-FileDownload 'https://www.dropbox.com/s/ek96b2gd502qnl2/agdq19-layouts-redacted.json?dl=1' -FileName 'cfg/agdq19-layouts.json'
# Create a URL shortcut to the repo's page on GitHub
- 'echo [InternetShortcut] > "GitHub Repo.URL"'
- 'echo URL=https://github.com/gamesdonequick/%APPVEYOR_PROJECT_SLUG% >> "GitHub Repo.URL"'
- 'echo IconFile=https://github.com/favicon.ico >> "GitHub Repo.URL"'
- 'echo IconIndex=0 >> "GitHub Repo.URL"'
# Compute the zip filename, used in the following steps.
- ps: '$env:PKG_ZIP_NAME = "$env:APPVEYOR_PROJECT_SLUG-$(-join $env:APPVEYOR_REPO_COMMIT[0..7]).zip"'
# Add the main files to the zip.
- 7z a %PKG_ZIP_NAME% nodecg.exe cfg
# Make the README available in the root of the archive, for easy access.
- 7z a %PKG_ZIP_NAME% .\bundles\%APPVEYOR_PROJECT_SLUG%\README.md "GitHub Repo.URL"
# Make the obs-assets folder available in the root of the archive as well.
- 7z a %PKG_ZIP_NAME% .\bundles\%APPVEYOR_PROJECT_SLUG%\obs-assets
# Add any compiled native dependency files to the archive.
- ps: 'Get-ChildItem -Recurse -ErrorAction SilentlyContinue bundles\$env:APPVEYOR_PROJECT_SLUG\node_modules\*.node | % { 7z a $env:PKG_ZIP_NAME $_.FullName }'
- ps: 'Get-ChildItem -Recurse -ErrorAction SilentlyContinue bundles\$env:APPVEYOR_PROJECT_SLUG\node_modules\*.dll | % { 7z a $env:PKG_ZIP_NAME $_.FullName }'
# Move the archive to the root of the build folder, to make it a bit easier to find and upload.
- 'if not exist %APPVEYOR_BUILD_FOLDER% mkdir %APPVEYOR_BUILD_FOLDER%'
- 'move %PKG_ZIP_NAME% %APPVEYOR_BUILD_FOLDER%'
test: off
# Always upload test screenshots even if tests failed.
on_finish:
- 'if not exist %TEST_SCREENSHOT_DIR% mkdir %TEST_SCREENSHOT_DIR%'
- 7z a test-screenshots.zip %TEST_SCREENSHOT_DIR%\*.png
- 7z a test-screenshots.zip %TEST_SCREENSHOT_DIR%\*.log
- ps: Push-AppveyorArtifact test-screenshots.zip
artifacts:
- path: '%PKG_ZIP_NAME%'
name: pkg-agdq19-layouts