1 Star 0 Fork 1

刘老憨/mangos-wotlk

forked from MagicCube/mangos-wotlk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
appveyor.yml 5.21 KB
一键复制 编辑 原始数据 按行查看 历史
Cyberium 提交于 2021-03-07 01:01 . Update Appveyor environement
# Specify version format
version: "0.18.{build}"
# Operating system (build VM template)
os: Visual Studio 2019
# build platform, i.e. Win32 (instead of x86), x64, Any CPU. This setting is optional.
platform:
- x64
# specify custom environment variables
environment:
CMANGOS_PROJECT_NAME: "CMaNGOS_WoTLK" # should be same as root CMakeList.txt
MSVC_DEFAULT_OPTIONS: ON
BOOST_ROOT: C:\Libraries\boost_1_73_0
BOOST_LIBRARYDIR_WIN64: C:\Libraries\boost_1_73_0\lib64-msvc-14.2
SNAPSHOT_TAG: "Last_$(APPVEYOR_PROJECT_NAME)_PreBuild"
SEC_ACCESS_TOKEN:
secure: GXsXxwHSSt1y+ae3C6A0csN+dCQxPW8w98SGwl8cqzqPDhKKbvFJ37eJCCDeNIm2
# build configuration, i.e. Debug, Release, etc.
configuration:
- Release
# scripts that are called at very beginning, before repo cloning
init:
# This script will delete already existing tag with its release when it already exist.
# This should be done to correctly update tag details and to avoid mixed release under same tag (if one fail).
# The principle is to delete the tag and release whenever we found it and the commit hash is different than current.
# Do not modify this script for security reason
- ps: >-
function Delete-Github-Release($gitHubRepository, $releaseVersion, $commitHash, $token){
$baseReleaseUrl = "https://api.github.com/repos/$gitHubRepository/releases";
$ref_endpoint = "https://api.github.com/repos/$gitHubRepository/git/refs/tags"
$getReleaseId = @{Uri = "$baseReleaseUrl" + "?access_token=$token"; Method = "GET";}
$wr_error = 'True'; try {$result = Invoke-WebRequest @getReleaseId;} catch {$wr_error = 'False';}
if ($result.StatusCode -ne 200 -or $wr_error -eq 'False') {Write-Host "No release found so nothing to delete." -f Yellow; return;}
$releasesData = ConvertFrom-Json $result.Content; $releaseInfos = $null;
if ($releasesData -is [system.array] -and $releasesData.Count -ge "1") {foreach ($releaseItr in $releasesData) {if ($releaseItr.name -eq $releaseVersion) { $releaseInfos = $releaseItr; break;}}}
if ($releaseInfos -eq $null) {Write-Host "Release $releaseVersion is not found, nothing to delete." -f Yellow; return;}
if ($releaseInfos.target_commitish -ne $commitHash){
$id = $releaseInfos.id; $delBaseReleaseUrl = "$baseReleaseUrl/$id" + "?access_token=$token"
Write-Host "Deleting release $releaseVersion..." -f Yellow;
$delReleaseParams = @{Uri = $delBaseReleaseUrl; Method = "DELETE";}
$wr_error = 'True'; try { $delRelResult = Invoke-WebRequest @delReleaseParams; } catch { $wr_error = 'False'; }
if ($wr_error -eq 'False' -or $delRelResult.StatusCode -eq 204) {Write-Host "$releaseVersion release is deleted" -f Green;} else {Write-Host "ERROR cannot delete $releaseVersion" -f Red;}
Write-Host "Deleting release tag $releaseVersion..." -f Yellow;
$delTagBaseUrl = "$ref_endpoint/$releaseVersion" + "?access_token=$token";
$delTagParams = @{Uri = $delTagBaseUrl; Method = "DELETE";}
$wr_error = 'True'; try {$delTagResult = Invoke-WebRequest @delTagParams;} catch {$wr_error = 'False';}
if ($wr_error -eq 'False' -or $delTagResult.StatusCode -eq 204) {Write-Host "$releaseVersion tag is deleted" -f Green;} else {Write-Host "ERROR cannot delete $releaseVersion" -f Red;}}
else {Write-Host "Skipping tag delete because its same commit!" -f Yellow;}}
# clone directory
clone_folder: C:\projects\cmangos
# branches to build
branches:
# whitelist
only:
- master
# Do not build on tags (GitHub only)
skip_tags: true
# unit test
test: off
# scripts to run before build
before_build:
- cmd: if "%platform%"=="x64" set BOOST_LIBRARYDIR="%BOOST_LIBRARYDIR_WIN64%"
- cmd: set BUILD_DIR="%APPVEYOR_BUILD_FOLDER%\BuildDir"
- cmd: mkdir "%BUILD_DIR%"
- cmd: cd "%BUILD_DIR%"
- cmd: cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=/"%APPVEYOR_BUILD_FOLDER%"/installed -DBUILD_EXTRACTORS=ON ..
# build script
build_script:
- ps: |
$buildFolder = "$env:BUILD_DIR"
$sourceFolder = "$env:APPVEYOR_BUILD_FOLDER\"
$slnFile = "$env:CMANGOS_PROJECT_NAME" + ".sln"
Write-Host "Building $env:CMANGOS_PROJECT_NAME project ..." -f Yellow
msbuild "$buildFolder\$slnFile" /m /verbosity:quiet /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
artifacts:
- path: bin\$(platform)_$(configuration)
name: $(APPVEYOR_PROJECT_NAME)_$(platform)_$(configuration)
# scripts to run before deployment
before_deploy:
ps: Delete-Github-Release $env:APPVEYOR_REPO_NAME $env:SNAPSHOT_TAG $env:APPVEYOR_REPO_COMMIT "$env:SEC_ACCESS_TOKEN"
# deploy settings
deploy:
- provider: GitHub
auth_token: $(SEC_ACCESS_TOKEN)
release: $(SNAPSHOT_TAG) # name of the tag used
description: 'Binaries of commit $(APPVEYOR_REPO_COMMIT) \n$(APPVEYOR_REPO_COMMIT_MESSAGE) \nSnapshot v$(APPVEYOR_BUILD_VERSION)'
artifact: $(APPVEYOR_PROJECT_NAME)_$(platform)_$(configuration)
draft: false
prerelease: true
on:
branch: master # release from master branch only
appveyor_repo_tag: false # deploy on tag push only
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liulaohan/mangos-wotlk.git
git@gitee.com:liulaohan/mangos-wotlk.git
liulaohan
mangos-wotlk
mangos-wotlk
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385