forked from sdlpal/sdlpal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
75 lines (72 loc) · 5.3 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
version: 2.0.{build}
image:
- Visual Studio 2019
environment:
#since appveyor official binding for bintray lacks of ability to specify upload path, we'd to use the manual curl way
BINTRAY_APIKEY:
secure: s4sB+aNp/xHO4oiFNkZ84OOewXOCUMmDIychhJYcXzJ+Exdj1+WJRXQisXgOYHpY
matrix:
- solution_name: win32/sdlpal.sln
APPX_OPTIONS:
- solution_name: winrt/SDLPal.UWP.sln
APPX_OPTIONS: /p:AppxBundle=Always;AppxBundlePlatforms="x86|x64|ARM";AppxPackageDir="AppPackages"
build_script:
- |-
msbuild /nologo /m %solution_name% /p:Configuration=Release %APPX_OPTIONS%
before_build:
- |-
git submodule update --init --recursive
cd winrt
if "%solution_name%"=="winrt/SDLPal.UWP.sln" nuget restore SDLPal.UWP.sln
cd ..
after_build:
- |-
if exist win32\Win32\Release\sdlpal.exe ( cd win32\Win32\Release & 7z a ..\..\..\sdlpal-win32-msvc.zip sdlpal.exe & cd ..\..\..\ )
for /d %%d in ("winrt\SDLPal.UWP\AppPackages\*") do ( cd %%d & del /q *.appxsym & 7z a ..\..\..\..\sdlpal-uwp.zip * & cd ..\..\..\..\ )
- ps: >-
if([string]::IsNullOrEmpty($env:APPVEYOR_PULL_REQUEST_NUMBER)) {
$COMMIT_DATE=((git show -s --format=%cs)|out-string).trim()
$COMMIT_ID=((git rev-parse --short HEAD)|out-string).trim()
$VERSION="v$COMMIT_DATE-g$COMMIT_ID"
$BINTRAY_USER="palxex"
$BINTRAY_REPO="sdlpal/nightly"
$BINTRAY_PATH="$BINTRAY_REPO/$env:APPVEYOR_REPO_BRANCH"
# remove notorious PS curl alias to use the built-in one
remove-item alias:curl
# create package
curl -fsS -u "${BINTRAY_USER}:${env:BINTRAY_APIKEY}" -X POST -d "{\""name\"":\""$env:APPVEYOR_REPO_BRANCH\"", \""desc\"": \""I was pushed completely automatically\"", \""labels\"": [\""game\"", \""c\"", \""rpg\""], \""licenses\"": [\""GPL-3.0\""], \""vcs_url\"": \""https://github.com/sdlpal/sdlpal.git\"", \""website_url\"": \""https://sdlpal.github.io\"", \""issue_tracker_url\"": \""https://github.com/sdlpal/sdlpal/issues\"", \""github_repo\"": \""sdlpal/sdlpal\"", \""public_download_numbers\"": true, \""public_stats\"": true}" "https://api.bintray.com/packages/$BINTRAY_REPO" -H "Content-Type: application/json"
# create version
$DESC=$env:APPVEYOR_REPO_COMMIT_MESSAGE
$RELEASE_DATE=(git show -s --format=%cI)
$VCS_TAG=(git describe --tags)
$AUTHOR=(git show -s --format=%an)
$AUTHOR_DATE=(git show -s --format=%ai)
$CIMMITER=(git show -s --format=%cn)
$BRANCH=$env:APPVEYOR_REPO_BRANCH
$COMMITID=(git show -s --format=%h)
curl -fsS -u "${BINTRAY_USER}:${env:BINTRAY_APIKEY}" -X POST -d "{\""name\"":\""$VERSION\"", \""desc\"": \""$DESC\"", \""released\"": \""$RELEASE_DATE\"", \""vcs_t ag\"": \""$VCS_TAG\"", \""attributes\"": [ {\""name\"": \""Author\"",\""values\"" : [\""$AUTHOR\""], \""type\"": \""string\""}, {\""name\"": \""AuthorDate\"",\""values\"" : [\""$AUTHOR_DATE\""], \""type\"": \""string\""}, {\""name\"": \""Commiter\"",\""values\"" : [\""$CIMMITER\""], \""type\"": \""string\""}, {\""name\"": \""Branch\"",\""values\"" : [\""$BRANCH\""], \""type\"": \""string\""}, {\""name\"": \""CommitID\"", \""values\"" : [\""$COMMITID\""], \""type\"": \""string\""} ]}" "https://api.bintray.com/packages/$BINTRAY_PATH/versions" -H "Content-Type: application/json"
# upload artifacts
@("sdlpal-win32-msvc.zip","sdlpal-uwp.zip") | ForEach-Object -Process { if (Test-Path ${_}) { curl -fsS -u "${BINTRAY_USER}:${env:BINTRAY_APIKEY}" -X PUT "https://api.bintray.com/content/$BINTRAY_PATH/$VERSION/$VERSION/${_}?override=1&publish=1" -T "${_}" } }
curl -fsS -u "${BINTRAY_USER}:${env:BINTRAY_APIKEY}" -X POST "https://api.bintray.com/packages/$BINTRAY_PATH/versions/$VERSION/attributes" -H "Content-Type: application/json" -d "[ {\""name\"": \""Author\"", \""values\"" : [\""$(git show -s --format=%an)\""], \""type\"": \""string\""}, {\""name\"": \""AuthorDate\"", \""values\"" : [\""$(git show -s --format=%ai)\""], \""type\"": \""string\""}, {\""name\"": \""Commiter\"", \""values\"" : [\""$(git show -s --format=%cn)\""], \""type\"": \""string\""}, {\""name\"": \""Branch\"", \""values\"" : [\""${env:APPVEYOR_REPO_BRANCH}\""], \""type\"": \""string\""}, {\""name\"": \""CommitID\"", \""values\"" : [\""$(git show -s --format=%h)\""], \""type\"": \""string\""}]"
# Wait publishing PUT processing; the latter PUT, list_in_downloads, only has effect after publish done.
start-sleep -s 10
@("sdlpal-win32-msvc.zip","sdlpal-uwp.zip") | ForEach-Object -Process { if (Test-Path ${_}) { curl -gsS -u "${BINTRAY_USER}:${env:BINTRAY_APIKEY}" -X PUT "https://api.bintray.com/file_metadata/$BINTRAY_REPO/$VERSION/${_}" -H "Content-Type: application/json" -d '{\"list_in_downloads\": true}' } }
}
deploy:
- provider: GitHub
on:
appveyor_repo_tag: true
auth_token:
secure: RYDRqm5LncsJG32FRSlCkLzkJC4ykCtlgO3+xW4q80wQOA3U9pHAe2beyMEduJIe
artifacts:
- path: sdlpal-win32-msvc.zip
name: Win32
- path: sdlpal-uwp.zip
name: UWP
notifications:
- provider: Webhook
url: https://webhooks.gitter.im/e/2accb0e6e37119e604b3
method: POST
on_build_success: true
on_build_failure: true
on_build_status_changed: true