Skip to content

Commit 81f7c41

Browse files
committed
Add AppVeyor config
1 parent 99c11a3 commit 81f7c41

3 files changed

Lines changed: 106 additions & 13 deletions

File tree

CMakeLists.txt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,25 @@ install(TARGETS foo DESTINATION lib)
88
install(TARGETS boo DESTINATION bin)
99

1010
string(COMPARE NOTEQUAL "$ENV{TRAVIS_TAG}" "" travis_deploy)
11+
string(COMPARE EQUAL "$ENV{APPVEYOR_REPO_TAG}" "true" appveyor_deploy)
12+
1113
if(travis_deploy)
12-
string(REGEX REPLACE "^v([0-9]+)\\.[0-9]+\\.[0-9]+$" "\\1" major_ver "$ENV{TRAVIS_TAG}")
13-
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+)\\.[0-9]+$" "\\1" minor_ver "$ENV{TRAVIS_TAG}")
14-
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+)$" "\\1" patch_ver "$ENV{TRAVIS_TAG}")
14+
set(version "$ENV{TRAVIS_TAG}")
15+
elseif(appveyor_deploy)
16+
set(version "$ENV{APPVEYOR_REPO_TAG_NAME}")
1517
else()
16-
set(major_ver 0)
17-
set(minor_ver 0)
18-
set(patch_ver 0)
18+
set(version "v0.0.0")
1919
endif()
2020

21-
set(CPACK_PACKAGE_VERSION_MAJOR ${major_ver})
22-
set(CPACK_PACKAGE_VERSION_MINOR ${minor_ver})
23-
set(CPACK_PACKAGE_VERSION_PATCH ${patch_ver})
21+
string(REGEX REPLACE "^v([0-9]+)\\.[0-9]+\\.[0-9]+$" "\\1" x "${version}")
22+
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+)\\.[0-9]+$" "\\1" y "${version}")
23+
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+)$" "\\1" z "${version}")
2424

25-
if(travis_deploy)
25+
set(CPACK_PACKAGE_VERSION_MAJOR ${x})
26+
set(CPACK_PACKAGE_VERSION_MINOR ${y})
27+
set(CPACK_PACKAGE_VERSION_PATCH ${z})
28+
29+
if(travis_deploy OR appveyor_deploy)
2630
string(COMPARE EQUAL "$ENV{CONFIG}" "Debug" debug_build)
2731
if(debug_build)
2832
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-$ENV{TOOLCHAIN}-Debug")

README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
### Uploading release binaries
1+
# Uploading release binaries
22

33
[![Build Status](https://travis-ci.org/forexample/github-binary-release.svg)](https://travis-ci.org/forexample/github-binary-release/builds)
44

5+
## Travis
6+
57
#### Create token
68

79
Create GitHub token with name like "Token for Travis CI deployment" and select `public_repo` (or `repo`). Keep in mind that this token is a **private sensitive** data! See:
@@ -31,7 +33,7 @@ before_deploy:
3133
deploy:
3234
provider: releases
3335
api_key:
34-
- secure: "encrypted GITHUB OAUTH TOKEN"
36+
- secure: "Encrypted GITHUB OAUTH TOKEN"
3537
file_glob: true
3638
file: "${FILE_TO_UPLOAD}"
3739
skip_cleanup: true
@@ -52,9 +54,40 @@ os:
5254
- osx
5355
```
5456

55-
#### Deploy (Linux + OS X)
57+
## AppVeyor
58+
59+
Create GitHub token with name like "Token for AppVeyor CI deployment" and select `public_repo` (or `repo`). Keep in mind that this token is a **private sensitive** data! See:
60+
* [Creating an access token](https://help.github.com/articles/creating-an-access-token-for-command-line-use)
61+
62+
#### Encrypt token
63+
64+
Encrypt your token using form on [appveyor.com](https://ci.appveyor.com/tools/encrypt).
65+
66+
#### Add token
67+
68+
Copy `secure: "..."` string to `appveyor.yml`:
69+
70+
```
71+
artifacts:
72+
- path: _builds\*\Foo-*.tar.gz
73+
name: Releases
74+
75+
deploy:
76+
provider: GitHub
77+
auth_token:
78+
secure: "Encrypted GITHUB OAUTH TOKEN"
79+
artifact: /Foo-.*\.tar.gz/
80+
draft: false
81+
prerelease: false
82+
on:
83+
appveyor_repo_tag: true
84+
```
85+
86+
## Deploy
5687

5788
```bash
5889
> git tag vA.B.C
5990
> git push --tags
6091
```
92+
93+
Travis will deploy artifacts from Linux and OS X, AppVeyor will deploy artifacts from Windows.

appveyor.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
environment:
2+
matrix:
3+
- TOOLCHAIN: "vs-12-2013"
4+
CONFIG: Release
5+
6+
- TOOLCHAIN: "vs-12-2013"
7+
CONFIG: Debug
8+
9+
- TOOLCHAIN: "vs-12-2013-win64"
10+
CONFIG: Release
11+
12+
- TOOLCHAIN: "vs-12-2013-win64"
13+
CONFIG: Debug
14+
15+
- TOOLCHAIN: "vs-11-2012"
16+
CONFIG: Release
17+
18+
- TOOLCHAIN: "vs-11-2012"
19+
CONFIG: Debug
20+
21+
- TOOLCHAIN: "vs-10-2010"
22+
CONFIG: Release
23+
24+
- TOOLCHAIN: "vs-10-2010"
25+
CONFIG: Debug
26+
27+
- TOOLCHAIN: "vs-9-2008"
28+
CONFIG: Release
29+
30+
- TOOLCHAIN: "vs-9-2008"
31+
CONFIG: Debug
32+
33+
install:
34+
- cmd: set POLLY_VERSION="0.7.5"
35+
- cmd: appveyor DownloadFile "https://github.com/ruslo/polly/archive/v%POLLY_VERSION%.tar.gz"
36+
- cmd: cmake -E tar xf "v%POLLY_VERSION%.tar.gz"
37+
- cmd: set PATH=%cd%\polly-%POLLY_VERSION%\bin;%PATH%
38+
- cmd: cmake --version
39+
- cmd: python --version
40+
41+
build_script:
42+
- cmd: build.py --verbose --pack TGZ --config "%CONFIG%" --toolchain "%TOOLCHAIN%"
43+
44+
artifacts:
45+
- path: _builds\*\Foo-*.tar.gz
46+
name: Releases
47+
48+
deploy:
49+
provider: GitHub
50+
auth_token:
51+
secure: "MlYtJPvxZuQlKMolBQxysZef5AiZapj8gOI8dPpEzkMxeQlQmL6/j/myMT6Zpkne"
52+
artifact: /Foo-.*\.tar.gz/
53+
draft: false
54+
prerelease: false
55+
on:
56+
appveyor_repo_tag: true

0 commit comments

Comments
 (0)