Skip to content

Commit

Permalink
Merge pull request #32 from Gigamonkey-BSV/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
DanielKrawisz authored Aug 26, 2022
2 parents da53e13 + 299d86b commit 4b94644
Show file tree
Hide file tree
Showing 16 changed files with 474 additions and 165 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.pow.co/artifactory/api/conan/conan
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 -r proofofwork
conan upload gigamonkey/${CURRENT_VERSION}@proofofwork/unstable -r proofofwork --all
57 changes: 57 additions & 0 deletions .github/workflows/stable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Conan development
on:
push:
branches:
- production
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- id: release
uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: patch
use_github_release_notes: true
- name: Check Output Parameters
run: |
echo "Got tag name ${{ steps.release.outputs.tag_name }}"
echo "Got release version ${{ steps.release.outputs.version }}"
- 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.pow.co/artifactory/api/conan/conan
conan user -p ${{ secrets.CONAN_USER_KEY }} -r proofofwork github
export CURRENT_VERSION="${{ steps.release.outputs.tag_name }}"
echo "Current version: ${CURRENT_VERSION}"
conan install . -r proofofwork
conan create . proofofwork/stable -r proofofwork
conan upload gigamonkey/${CURRENT_VERSION}@proofofwork/stable -r proofofwork --all
- name: prepare release package
run: |
mkdir build
cd build
conan install .. -r=proofofwork
cmake .. -DPACKAGE_TESTS=Off
cmake --build .
export CURRENT_VERSION="${{ steps.release.outputs.tag_name }}"
cp -r ../include ./
tar -czvf "gigamonkey-${CURRENT_VERSION}-linux.tar.gz" lib include
- name: Upload release
uses: svenstaro/upload-release-action@v2
with:
tag: ${{ steps.release.outputs.tag_name }}
file: build/gigamonkey-${{ steps.release.outputs.tag_name }}-linux.tar.gz
asset_name: gigamonkey-${{ steps.release.outputs.tag_name }}-linux.tar.gz
18 changes: 13 additions & 5 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,32 @@ class GigamonkeyConan(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", "data/0.2@proofofwork/stable"
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", "data/v0.0.5@proofofwork/unstable"

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 config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC

def build(self):
def configure_cmake(self):
if "CMAKE_BUILD_CORES_COUNT" in environ:
cmake = CMake(self, parallel=False)
cmake.configure()
cmake.build(args=["--", environ.get("CMAKE_BUILD_CORES_COUNT")])
else:
cmake = CMake(self)
cmake.configure()
cmake.definitions["PACKAGE_TESTS"] = "Off"
cmake.configure()
return cmake

def build(self):
cmake = self.configure_cmake()
if "CMAKE_BUILD_CORES_COUNT" in environ:
cmake.build(args=["--", environ.get("CMAKE_BUILD_CORES_COUNT")])
else:
cmake.build()

def package(self):
Expand Down
2 changes: 1 addition & 1 deletion extern/data
Submodule data updated from ab4a38 to 0544ae
2 changes: 1 addition & 1 deletion include/gigamonkey/accounts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace Gigamonkey::Bitcoin {
if (txs.empty()) return *this;
return data::fold([](const account& a, const event& e) -> account {
return a.reduce(e);
}, account{}, txs.values());
}, account{}, txs);
return reduce(txs.first()).reduce(txs.rest());
}
};
Expand Down
2 changes: 1 addition & 1 deletion include/gigamonkey/hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Gigamonkey {

operator bytes_view() const;

explicit operator math::number::N() const;
explicit operator N() const;

byte* begin();
byte* end();
Expand Down
Loading

0 comments on commit 4b94644

Please sign in to comment.