Skip to content

Commit

Permalink
Merge pull request #31 from KatrinaAS/master
Browse files Browse the repository at this point in the history
Added Conan Automation
  • Loading branch information
DanielKrawisz authored Jul 29, 2022
2 parents da53e13 + b5cada8 commit 9f31d6a
Show file tree
Hide file tree
Showing 4 changed files with 308 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.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.2@proofofwork/unstable", "data/86991d9@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
200 changes: 200 additions & 0 deletions table.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@

<!DOCTYPE html>
<html lang="en">
<head>
<title>Conan | data/86991d9@proofofwork/unstable</title>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/dataTables.bootstrap.min.css"/>
<style>
tr td {
white-space:nowrap;
}
</style>
</head>
<body>
<div class="container-fluid">
<h1>data/86991d9@proofofwork/unstable</h1>
<div class="info">
<p>
Depending on your package_id_mode, any combination of settings, options and requirements
can give you a different packageID. Take into account that your configuration might be
different from the one used to generate the packages.
</p>
</div>

<!-- Button trigger modal -->
<span id="filterProfileButton"> |
<button type="button" class="btn btn-link" data-toggle="modal" data-target="#filterProfile">
Filter using profile
</button>
</span>

<!-- Modal -->
<div class="modal fade" id="filterProfile" tabindex="-1" role="dialog" aria-labelledby="filterProfileLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="filterProfileLabel">Filter results</h4>
</div>
<div class="modal-body">
<p>Copy and paste here the content of a Conan profile:</p>
<form>
<div class="form-group">
<textarea id="filterProfileValue" class="form-control" rows="8" placeholder="[settings]&#10;os=Macos&#10;arch=x86_64&#10;compiler=apple-clang&#10;compiler.version=11.0&#10;compiler.libcxx=libc++&#10;build_type=Release"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="apply_profile_filter()">Apply filter</button>
</div>
</div>
</div>
</div>

<table id="results" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th class="text-center" rowspan="2" colspan="1">
remote
</th>
<th class="text-center" rowspan="2" colspan="1">
package_id
</th>
<th class="text-center" rowspan="2" colspan="1">
outdated
</th>
<th class="text-center" rowspan="2" colspan="1">
os
</th>
<th class="text-center" rowspan="2" colspan="1">
arch
</th>
<th class="text-center" rowspan="1" colspan="3">
compiler
</th>
<th class="text-center" rowspan="2" colspan="1">
build_type
</th>
<th class="text-center" rowspan="1" colspan="2">
options
</th>
<th class="text-center" rowspan="2" colspan="1">
requires
</th>
</tr>
<tr>
<th>compiler</th>
<th>libcxx</th>
<th>version</th>
<th>fPIC</th>
<th>shared</th>
</tr>
</thead>
<tbody>
<tr>
<td>proofofwork</td>
<td>235fbfc1df2d8473a4701c5b6963470cd315afd5</td>
<td>False</td>
<td>Linux</td>
<td>x86_64</td>
<td>gcc</td>
<td>libstdc++11</td>
<td>10</td>
<td>Release</td>
<td>True</td>
<td>False</td>
<td>SECP256K1/0.2@proofofwork/unstable, autoconf/2.71, automake/1.16.3, boost/1.76.0, bzip2/1.0.8, cryptopp/8.5.0, gmp/6.2.1, libbacktrace/cci.20210118, libtool/2.4.6, nlohmann_json/3.10.0, openssl/1.1.1k, uriparser/0.9.6, zlib/1.2.12</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>remote</th>
<th>package_id</th>
<th>outdated</th>
<th>os</th>
<th>arch</th>
<th>compiler</th>
<th>compiler.libcxx</th>
<th>compiler.version</th>
<th>build_type</th>
<th>fPIC</th>
<th>shared</th>
<th>requires</th>
</tr>
</tfoot>
</table>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.20/datatables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.21/js/dataTables.bootstrap.min.js"></script>
<script>
$(document).ready(function() {
// Setup - add a text input to each footer cell
$('#results tfoot th').each( function () {
var title = $(this).text();
var title_id = title.replace('.', '_');
$(this).html( '<input type="text" id="filter-input-'+title_id+'" class="form-control filter-input" placeholder="Filter '+title+'" style="width:100%"/>' );
});

var table = $('#results').DataTable( {
"dom": "lrtip",
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"pageLength": 10,
"columnDefs": [
{ className: "cell_border_right", "targets": [ 8, 10 ] },
{ className: "cell_border_right monospaced", "targets": [2, ]}
]
});

// Apply the search
table.columns().every( function () {
var that = this;

$( 'input', this.footer() ).on( 'keyup change clear', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );

// Add filter profile to
$("#filterProfileButton").appendTo("#results_length");
});

function apply_profile_filter() {
// Parse the profile input
var profile_txt = $("#filterProfileValue").val();
var regex = {
section: /^\s*\[\s*([^\]]*)\s*\]\s*$/,
param: /^\s*([^=]+?)\s*=\s*(.*?)\s*$/
};
profile_txt.split(/[\r\n]+/).forEach( function(line) {
if(regex.param.test(line)){
var match = line.match(regex.param);
var field_id = '#filter-input-'+match[1].replace('.', '_');
$(field_id).val(match[2]);
$(field_id).keyup();
}
});
$('#filterProfile').modal('hide');
}
</script>
</div>
</body>
<footer>
<div class="container-fluid">
<div class="info">
<p>
Conan <b>v1.47.0</b> <script>document.write(new Date().getFullYear())</script> JFrog LTD. <a>https://conan.io</a>
</p>
</div>
</div>
</footer>
</html>

0 comments on commit 9f31d6a

Please sign in to comment.