Skip to content

Commit

Permalink
Merge branch 'main' into feat/revocation-list
Browse files Browse the repository at this point in the history
Signed-off-by: Belsy <email-me@belsy.space>
  • Loading branch information
whalelephant authored Jan 6, 2023
2 parents 63177c0 + 829caf2 commit 3201c90
Show file tree
Hide file tree
Showing 7 changed files with 675 additions and 4 deletions.
130 changes: 126 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: "Build Packages"
name: 'Build Packages'

"on":
'on':
release:
types: [created]
workflow_dispatch:
inputs:
publish:
description: "Publish packages"
description: 'Publish packages'
required: true
default: "false"
default: 'false'

jobs:
build-manylinux:
Expand Down Expand Up @@ -174,3 +174,125 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing wrappers/python/dist/*
build-android-libraries:
name: Build Android Libraries
runs-on: ubuntu-latest
strategy:
matrix:
architecture:
[
aarch64-linux-android,
armv7-linux-androideabi,
i686-linux-android,
x86_64-linux-android,
]

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.architecture }}
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{matrix.architecture}} --package=anoncreds --features=vendored
- uses: actions/upload-artifact@v2
name: Save library
with:
name: ${{matrix.architecture}}
path: target/${{matrix.architecture}}/release/libanoncreds.so

create-android-library:
name: Create android libraries
runs-on: ubuntu-latest
needs: build-android-libraries
if: |
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.publish == 'true'))
steps:
- name: Fetch libraries
uses: actions/download-artifact@v3
- run: |
sudo mkdir ./libs
sudo mv aarch64-linux-android ./libs/arm64-v8a
sudo mv armv7-linux-androideabi ./libs/armeabi-v7a
sudo mv i686-linux-android ./libs/x86
sudo mv x86_64-linux-android ./libs/x86_64
- name: Save Android library
uses: actions/upload-artifact@v2
with:
name: android-libs
path: ./libs
- uses: geekyeggo/delete-artifact@v1
with:
name: |
aarch64-linux-android
armv7-linux-androideabi
i686-linux-android
x86_64-linux-android
failOnError: false

build-ios-libraries:
name: Build ios Libraries
runs-on: macos-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
strategy:
matrix:
architecture:
[aarch64-apple-ios, aarch64-apple-ios-sim, x86_64-apple-ios]

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.architecture }}
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{matrix.architecture}} --package=anoncreds --features=vendored
- uses: actions/upload-artifact@v2
name: Save library
with:
name: ${{matrix.architecture}}
path: target/${{matrix.architecture}}/release/libanoncreds.dylib

create-ios-xcframework:
name: Create ios xcframework
runs-on: macos-latest
needs: build-ios-libraries
if: |
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.publish == 'true'))
steps:
- uses: actions/checkout@v2
- name: Fetch static libraries
uses: actions/download-artifact@v3
- run: >
lipo -create aarch64-apple-ios-sim/libanoncreds.dylib \
x86_64-apple-ios/libanoncreds.dylib \
-output libanoncreds.dylib
- run: >
xcodebuild -create-xcframework \
-library aarch64-apple-ios/libanoncreds.dylib -headers include/libanoncreds.h \
-library libanoncreds.dylib -headers include/libanoncreds.h \
-output anoncreds.xcframework
- name: Save xcframework
uses: actions/upload-artifact@v3
with:
name: anoncreds.xcframework
path: anoncreds.xcframework
- uses: geekyeggo/delete-artifact@v1
with:
name: |
aarch64-apple-ios
aarch64-apple-ios-sim
x86_64-apple-ios
failOnError: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
target
Cargo.lock
.tmp
.DS_Store
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ members = [
[profile.release]
lto = true
codegen-units = 1

# openssl-src does not have a build script for the target `aarch64-apple-ios-sim`, which we need.
# This fork has that target added and no functional changes. There is a pull request open for
# the fix but previous pull requests were closed with the same context as they were not security
# fixes. When this pull request is merged, we can depend on the `upstream` git repo or, when
# released, we can depend on the latest version of `openssl-src`.
[patch.crates-io]
openssl-src = { git = "https://github.com/blu3beri/openssl-src-rs", branch = "release/111" }
11 changes: 11 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[target.x86_64-linux-android]
image = "ghcr.io/cross-rs/x86_64-linux-android:main"

[target.i686-linux-android]
image = "ghcr.io/cross-rs/i686-linux-android:main"

[target.aarch64-linux-android]
image = "ghcr.io/cross-rs/aarch64-linux-android:main"

[target.armv7-linux-androideabi]
image = "ghcr.io/cross-rs/armv7-linux-androideabi:main"
13 changes: 13 additions & 0 deletions include/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
_Generating the C header:_

Install [cbindgen](https://github.com/eqrion/cbindgen/):

```sh
cargo install cbindgen
```

Generate the header file:

```sh
cbindgen --config include/cbindgen.toml --crate anoncreds --output include/libanoncreds.h
```
151 changes: 151 additions & 0 deletions include/cbindgen.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# This is a template cbindgen.toml file with all of the default values.
# Some values are commented out because their absence is the real default.
#
# See https://github.com/eqrion/cbindgen/blob/master/docs.md#cbindgentoml
# for detailed documentation of every option here.



language = "C"
cpp_compat = true


############## Options for Wrapping the Contents of the Header #################

# header = "/* Text to put at the beginning of the generated file. Probably a license. */"
# trailer = "/* Text to put at the end of the generated file */"
# include_guard = "my_bindings_h"
# pragma_once = true
# autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"
include_version = false
# namespace = "my_namespace"
namespaces = []
using_namespaces = []
sys_includes = []
includes = []
no_includes = false
after_includes = ""




############################ Code Style Options ################################

braces = "SameLine"
line_length = 100
tab_width = 2
documentation = true
documentation_style = "auto"
# documentation_length = "full"
line_endings = "LF" # also "CR", "CRLF", "Native"




############################# Codegen Options ##################################

style = "both"
sort_by = "Name" # default for `fn.sort_by` and `const.sort_by`
usize_is_size_t = true



[defines]
# "target_os = freebsd" = "DEFINE_FREEBSD"
# "feature = serde" = "DEFINE_SERDE"
"feature = rich_schema" = "DEFINE_RICH_SCHEMA"
"test" = "DEFINE_TEST"

[export]
include = []
exclude = []
# prefix = "CAPI_"
item_types = []
renaming_overrides_prefixing = false



[export.rename]


[export.body]


[export.mangle]


[fn]
rename_args = "None"
# must_use = "MUST_USE_FUNC"
# no_return = "NO_RETURN"
# prefix = "START_FUNC"
# postfix = "END_FUNC"
args = "auto"
sort_by = "Name"




[struct]
rename_fields = "None"
# must_use = "MUST_USE_STRUCT"
derive_constructor = false
derive_eq = false
derive_neq = false
derive_lt = false
derive_lte = false
derive_gt = false
derive_gte = false




[enum]
rename_variants = "None"
# must_use = "MUST_USE_ENUM"
add_sentinel = false
prefix_with_name = false
derive_helper_methods = false
derive_const_casts = false
derive_mut_casts = false
# cast_assert_name = "ASSERT"
derive_tagged_enum_destructor = false
derive_tagged_enum_copy_constructor = false
enum_class = true
private_default_tagged_enum_constructor = false




[const]
allow_static_const = true
allow_constexpr = false
sort_by = "Name"




[macro_expansion]
bitflags = false






############## Options for How Your Rust library Should Be Parsed ##############

[parse]
parse_deps = true
include = ["ffi-support"]
exclude = []
clean = false
extra_bindings = []



[parse.expand]
crates = []
all_features = false
default_features = true
features = []
Loading

0 comments on commit 3201c90

Please sign in to comment.