Skip to content

Commit

Permalink
Merge pull request #62 from KatrinaAS/master
Browse files Browse the repository at this point in the history
Added auto building
  • Loading branch information
DanielKrawisz authored Jul 24, 2022
2 parents b59385e + 7d99db8 commit 6ad355f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/conan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Conan development
on:
push:
branches:
- '*'
- '*/*'
- '**'
- '!production'
pull_request:
branches:
- '*'
- '*/*'
- '**'
- '!production'
env:
BUILD_TYPE: Debug
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get Conan
uses: turtlebrowser/[email protected]
- name: Create default profile
run: conan profile new default --detect
- name: Update profile 11
run: conan profile update settings.compiler.libcxx=libstdc++11 default
- name: Update profile version
run: conan profile update settings.compiler.version=10 default
- name: setup conan
run: |
conan config set general.revisions_enabled=True
conan remote add proofofwork https://conan.katcodes.tech/artifactory/api/conan/proof-of-work-main
conan user -p ${{ secrets.CONAN_USER_KEY }} -r proofofwork github
export CURRENT_VERSION=`git rev-parse --short HEAD`
conan install . -r proofofwork
conan create . proofofwork/unstable
conan upload data/${CURRENT_VERSION}@proofofwork/unstable -r proofofwork --all
17 changes: 12 additions & 5 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from conans import ConanFile, CMake
from os import environ


class DataConan(ConanFile):
name = "data"
version = "0.2"
license = "MIT"
author = "Daniel Krawisz"
url = "https://github.com/DanielKrawisz/data"
Expand All @@ -14,19 +14,26 @@ class DataConan(ConanFile):
default_options = {"shared": False, "fPIC": True}
generators = "cmake"
exports_sources = "*"
requires = "boost/1.76.0", "openssl/1.1.1k", "cryptopp/8.5.0", "nlohmann_json/3.10.0", "gmp/6.2.1", "SECP256K1/0.1@proofofwork/stable","uriparser/0.9.6"
requires = "boost/1.76.0", "openssl/1.1.1k", "cryptopp/8.5.0", "nlohmann_json/3.10.0", "gmp/6.2.1", "SECP256K1/0.1@proofofwork/unstable", "uriparser/0.9.6"

def set_version(self):
if "CIRCLE_TAG" in environ:
self.version = environ.get("CIRCLE_TAG")[1:]
if "CURRENT_VERSION" in environ:
self.version = environ['CURRENT_VERSION']

def configure_cmake(self):
cmake = CMake(self)
cmake.definitions["PACKAGE_TESTS"] = "Off"
cmake.configure()
return cmake

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def build(self):
cmake = CMake(self)
cmake.configure()
cmake = self.configure_cmake()
cmake.build()

def package(self):
Expand All @@ -35,4 +42,4 @@ def package(self):
self.copy("*libdata.a", dst="lib", keep_path=False)

def package_info(self):
self.cpp_info.libs = ["data"]
self.cpp_info.libs = ["data"]

0 comments on commit 6ad355f

Please sign in to comment.