conan deploy through GH actions

This commit is contained in:
Michele Caini 2019-09-25 14:58:16 +02:00
parent 90affa4d51
commit b117c6118b
2 changed files with 36 additions and 2 deletions

View File

@ -13,7 +13,9 @@ def get_version():
match = re.search(r'project\(uvw VERSION (.*)\)', content)
if match:
return match.group(1)
return os.getenv("TRAVIS_BRANCH", "master")
tag_version = os.getenv("GITHUB_REF")
package_version = tag_version.replace("refs/tags/v", "")
return package_version
def get_username():
return os.getenv("CONAN_USERNAME", "skypjack")
@ -28,7 +30,7 @@ def get_reference():
def get_upload():
username = get_username()
url = "https://api.bintray.com/conan/{}/conan".format(username)
default_upload = url if os.getenv("TRAVIS_TAG") else False
default_upload = url if os.getenv("GITHUB_REF") else False
return os.getenv("CONAN_UPLOAD", default_upload)

32
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: deploy
on:
push:
tags:
- v*
jobs:
conan:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: docker://conanio/gcc8
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@master
with:
version: 3.7
- name: Install
run: |
pip install --upgrade wheel
pip install conan_package_tools
- name: Deploy
env:
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_LOGIN_USERNAME }}
CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }}
CONAN_UPLOAD: ${{ secrets.CONAN_UPLOAD }}
CONAN_GCC_VERSIONS: 8
run: |
python .conan/build.py