Skip to content

Commit

Permalink
Add CI Azure Pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
julianxhokaxhiu committed Sep 18, 2020
1 parent 8bfec47 commit 973e68b
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 18 deletions.
67 changes: 67 additions & 0 deletions .ci/azure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Azure Pipeline YAML file

name: 1.0$(Rev:.r)

trigger:
branches:
include:
- master
tags:
include:
- '*'

variables:
_IS_BUILD_CANARY: false
_RELEASE_NAME: FF7SND
_RELEASE_VERSION: v0
_RELEASE_CONFIGURATION: Release
_BUILD_VERSION: $(Build.BuildNumber)
_BUILD_BRANCH: $(Build.SourceBranch)

pool:
vmImage: 'windows-latest'

steps:
- checkout: self
- task: VSBuild@1
displayName: 'Build $(_RELEASE_NAME)'
inputs:
solution: $(Build.Repository.LocalPath)\src\FF7SND.sln
platform: x86
configuration: $(_RELEASE_CONFIGURATION)
msbuildArgs: /p:WindowsTargetPlatformVersion=10.0.19041.0
- task: PowerShell@2
displayName: 'Package $(_RELEASE_NAME)'
inputs:
filePath: $(Build.Repository.LocalPath)\.ci\package.ps1
env:
buildPath: $(Build.Repository.LocalPath)
- task: GitHubRelease@0
condition: and(eq(variables._IS_BUILD_CANARY, 'true'), not(contains(variables._BUILD_BRANCH, 'refs/pull/')))
displayName: 'Delete $(_RELEASE_NAME) Release (Canary)'
continueOnError: true
inputs:
gitHubConnection: github_ci
action: delete
tagSource: manual
tag: canary
- task: GitHubRelease@0
condition: and(eq(variables._IS_BUILD_CANARY, 'true'), not(contains(variables._BUILD_BRANCH, 'refs/pull/')))
displayName: 'Create $(_RELEASE_NAME) Release (Canary)'
inputs:
gitHubConnection: github_ci
assets: $(Build.Repository.LocalPath)\.dist\*.zip
isPreRelease: true
tagSource: manual
tag: canary
title: $(_RELEASE_NAME)-$(_RELEASE_VERSION)
releaseNotesSource: input
releaseNotes: |
This is a canary build. Please be aware it may be prone to crashing and is NOT tested by anyone. Use this build AT YOUR OWN RISK!
- task: GitHubRelease@0
condition: and(eq(variables._IS_BUILD_CANARY, 'false'), not(contains(variables._BUILD_BRANCH, 'refs/pull/')))
displayName: 'Create $(_RELEASE_NAME) Release (Stable)'
inputs:
gitHubConnection: github_ci
assets: $(Build.Repository.LocalPath)\.dist\*.zip
title: $(_RELEASE_NAME)-$(_RELEASE_VERSION)
24 changes: 24 additions & 0 deletions .ci/package.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
if ($env:_BUILD_BRANCH -eq "refs/heads/master" -Or $env:_BUILD_BRANCH -eq "refs/tags/canary") {
$env:_IS_BUILD_CANARY = "true"
}
elseif ($env:_BUILD_BRANCH -like "refs/tags/*") {
$env:_BUILD_VERSION = $env:_BUILD_VERSION.Substring(0,$env:_BUILD_VERSION.LastIndexOf('.')) + ".0"
}
$env:_RELEASE_VERSION = "v${env:_BUILD_VERSION}"

Write-Output "--------------------------------------------------"
Write-Output "BUILD CONFIGURATION: $env:_RELEASE_CONFIGURATION"
Write-Output "RELEASE VERSION: $env:_RELEASE_VERSION"
Write-Output "--------------------------------------------------"

Write-Host "##vso[task.setvariable variable=_BUILD_VERSION;]${env:_BUILD_VERSION}"
Write-Host "##vso[task.setvariable variable=_RELEASE_VERSION;]${env:_RELEASE_VERSION}"
Write-Host "##vso[task.setvariable variable=_IS_BUILD_CANARY;]${env:_IS_BUILD_CANARY}"

Set-Location ${env:buildPath}\src\Release
New-Item -Path ".dist" -ItemType Directory | Out-Null

Move-Item *.exe .dist

mkdir ${env:buildPath}\.dist | Out-Null
Compress-Archive -Path .dist\* -DestinationPath "${env:buildPath}\.dist\${env:_RELEASE_NAME}-${env:_RELEASE_VERSION}_${env:_RELEASE_CONFIGURATION}.zip"
36 changes: 18 additions & 18 deletions src/FF7SND.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>.\Debug\</OutDir>
<IntDir>.\Debug\</IntDir>
<OutDir>Debug\</OutDir>
<IntDir>Debug\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\Release\</OutDir>
<IntDir>.\Release\</IntDir>
<OutDir>Release\</OutDir>
<IntDir>Release\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Expand All @@ -57,18 +57,18 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>.\Debug\</AssemblerListingLocation>
<PrecompiledHeaderOutputFile>.\Debug\FF7SND.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>Debug\</AssemblerListingLocation>
<PrecompiledHeaderOutputFile>Debug\FF7SND.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<ObjectFileName>.\Debug\</ObjectFileName>
<ProgramDataBaseFileName>.\Debug\</ProgramDataBaseFileName>
<ObjectFileName>Debug\</ObjectFileName>
<ProgramDataBaseFileName>Debug\</ProgramDataBaseFileName>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\Debug\FF7SND.tlb</TypeLibraryName>
<TypeLibraryName>Debug\FF7SND.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
<TargetEnvironment>Win32</TargetEnvironment>
</Midl>
Expand All @@ -78,13 +78,13 @@
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug\FF7SND.bsc</OutputFile>
<OutputFile>Debug\FF7SND.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OutputFile>.\Debug\FF7SND.exe</OutputFile>
<OutputFile>Debug\FF7SND.exe</OutputFile>
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand All @@ -98,17 +98,17 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AssemblerListingLocation>.\Release\</AssemblerListingLocation>
<PrecompiledHeaderOutputFile>.\Release\FF7SND.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>Release\</AssemblerListingLocation>
<PrecompiledHeaderOutputFile>Release\FF7SND.pch</PrecompiledHeaderOutputFile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
<ObjectFileName>.\Release\</ObjectFileName>
<ProgramDataBaseFileName>.\Release\</ProgramDataBaseFileName>
<ObjectFileName>Release\</ObjectFileName>
<ProgramDataBaseFileName>Release\</ProgramDataBaseFileName>
</ClCompile>
<Midl>
<SuppressStartupBanner>true</SuppressStartupBanner>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<TypeLibraryName>.\Release\FF7SND.tlb</TypeLibraryName>
<TypeLibraryName>Release\FF7SND.tlb</TypeLibraryName>
<MkTypLibCompatible>true</MkTypLibCompatible>
<TargetEnvironment>Win32</TargetEnvironment>
</Midl>
Expand All @@ -118,12 +118,12 @@
</ResourceCompile>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release\FF7SND.bsc</OutputFile>
<OutputFile>Release\FF7SND.bsc</OutputFile>
</Bscmake>
<Link>
<SuppressStartupBanner>true</SuppressStartupBanner>
<SubSystem>Windows</SubSystem>
<OutputFile>.\Release\FF7SND.exe</OutputFile>
<OutputFile>Release\FF7SND.exe</OutputFile>
<AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand Down

0 comments on commit 973e68b

Please sign in to comment.