diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-07-19 14:54:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-19 14:54:32 -0700 |
| commit | a2b8b4c20632d79721052abd232fe2d1bdf2700d (patch) | |
| tree | d2197a4db151d91899eb26c7687963293d657884 | |
| parent | 019bc0d1507afcc6b12f3dd097040d664d9c1d50 (diff) | |
| parent | 6c71681364ac892108c275b8e46d39c9ff77a395 (diff) | |
Merge pull request #127 from tfoleyNV/deployment
Use AppVeyor to deploy to GitHub Releases
| -rw-r--r-- | appveyor.yml | 63 | ||||
| -rw-r--r-- | build/slang-build.props | 4 | ||||
| -rw-r--r-- | test.bat | 5 |
3 files changed, 66 insertions, 6 deletions
diff --git a/appveyor.yml b/appveyor.yml index 132bffb6b..5b6596b8d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,18 @@ # Our solution file is currently set up for VS2015 image: Visual Studio 2015 +init: + # Construct a version number suitable for using as a release name + - ps: >- + if ($env:APPVEYOR_REPO_TAG -eq "true") + { + $env:SLANG_VERSION = "$($env:APPVEYOR_REPO_TAG_NAME.TrimStart("v"))" + } + else + { + $env:SLANG_VERSION = "dev-$($env:APPVEYOR_REPO_COMMIT.Substring(0, 7))" + } + # The project uses a submodule for the "glslang" dependency, # so we need to make sure to pull that before building. install: @@ -8,9 +20,11 @@ install: # We want to build the full matrix of platforms and configurations # that we support on Windows. +# +# Put Release|x64 first since that is the target which runs the most tests. platform: - - Win32 - x64 + - Win32 configuration: - Release @@ -54,6 +68,49 @@ test_script: } .\test.bat -platform %PLATFORM% -configuration %CONFIGURATION% -appveyor -category $testCategory -# TODO: need to figure out what we want to package for deployment +# Package up the stuff we want to deploy into a single .zip file + +after_build: + - ps: | + if ($env:PLATFORM -eq "x64") + { + $env:SLANG_DEPLOY_PLATFORM = "win64" + } + else + { + $env:SLANG_DEPLOY_PLATFORM = "win32" + } + $env:SLANG_BINARY_ARCHIVE = "slang-$($env:SLANG_VERSION)-$($env:SLANG_DEPLOY_PLATFORM).zip" + $env:SLANG_SOURCE_ARCHIVE = "slang-$($env:SLANG_VERSION)-source.zip" + 7z a "$env:SLANG_BINARY_ARCHIVE" slang.h + 7z a "$env:SLANG_BINARY_ARCHIVE" bin\*\*\slang.dll + 7z a "$env:SLANG_BINARY_ARCHIVE" bin\*\*\slang.lib + 7z a "$env:SLANG_BINARY_ARCHIVE" bin\*\*\slang-glslang.dll + 7z a "$env:SLANG_BINARY_ARCHIVE" bin\*\*\slangc.exe + 7z a "$env:SLANG_SOURCE_ARCHIVE" slang.h + 7z a "$env:SLANG_SOURCE_ARCHIVE" source\*\*.h + 7z a "$env:SLANG_SOURCE_ARCHIVE" source\*\*.cpp + +# Register the created .zip file as an artifact with AppVeyor + +artifacts: + - path: $(SLANG_BINARY_ARCHIVE) + name: binary_archive + - path: $(SLANG_SOURCE_ARCHIVE) + name: source_archive + +# On a successful build of a tag, push archices to GitHub releases -# TODO: on a successful build of a tag, push to GitHub releases +deploy: + release: v$(SLANG_VERSION) + description: 'Slang $(SLANG_VERSION)' + provider: GitHub + auth_token: + secure: +FukP7TA9F+fofZRZnu2FSqPcrQ1u4r8r4pl+/83owiY6M1R4ykg+8RcSzXi2f63 + artifact: 'binary_archive,source_archive' + draft: false + prerelease: false + force_update: true # TODO: consider if we can avoid this + on: + configuration: Release + appveyor_repo_tag: true # deploy on tag push only diff --git a/build/slang-build.props b/build/slang-build.props index bb7b68930..265f54d14 100644 --- a/build/slang-build.props +++ b/build/slang-build.props @@ -3,8 +3,8 @@ <ImportGroup Label="PropertySheets" /> <PropertyGroup Label="UserMacros" /> <PropertyGroup> - <OutDir>$(SolutionDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir> - <IntDir>$(SolutionDir)intermediate\$(PlatformShortName)\$(Configuration)\$(ProjectName)\</IntDir> + <OutDir>$(SolutionDir)bin\windows-$(PlatformShortName)\$(Configuration.ToLower())\</OutDir> + <IntDir>$(SolutionDir)intermediate\windows-$(PlatformShortName)\$(Configuration.ToLower())\$(ProjectName)\</IntDir> </PropertyGroup> <ItemDefinitionGroup /> <ItemGroup /> @@ -31,6 +31,9 @@ if "%1"=="-configuration" ( :: When done with arguments, we'll just fall through here + + + :: Set root directory to the directory where `test.bat` resides :: (which should be the root of the source tree) SET "SLANG_TEST_ROOT=%~dp0" @@ -45,7 +48,7 @@ IF "%SLANG_TEST_CONFIG%" == "" ( SET "SLANG_TEST_CONFIG=Debug" ) IF "%SLANG_TEST_PLATFORM%"=="Win32" ( Set "SLANG_TEST_PLATFORM=x86" ) :: Establish the directory where the binaries to be tested reside -set "SLANG_TEST_BIN_DIR=%SLANG_TEST_ROOT%bin\%SLANG_TEST_PLATFORM%\%SLANG_TEST_CONFIG%\" +set "SLANG_TEST_BIN_DIR=%SLANG_TEST_ROOT%bin\windows-%SLANG_TEST_PLATFORM%\%SLANG_TEST_CONFIG%\" :: ensure that any built tools are visible SET "PATH=%PATH%;%SLANG_TEST_BIN_DIR%" |
