-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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/redacted/agdq19-layouts.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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.