Skip to content

Commit

Permalink
Merge pull request #27 from radixdlt/merge/betanet-v2-into-main
Browse files Browse the repository at this point in the history
Merge Betanet-v2 release branch into main
  • Loading branch information
0xOmarA authored Feb 14, 2023
2 parents 0946475 + e3f513c commit e794028
Show file tree
Hide file tree
Showing 222 changed files with 51,319 additions and 15,631 deletions.
136 changes: 101 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Build

on:
push:

pull_request:
branches:
- develop
Expand All @@ -13,81 +15,79 @@ jobs:
strategy:
matrix:
build-target:
# radix-engine-toolkit-native Crate
- crate: radix-engine-toolkit-native
# native-json-interface Crate
- crate: native-json-interface
target-triple: aarch64-apple-darwin
custom-linker: ""
custom-compiler: /usr/local/opt/llvm/bin/clang
custom-archiver: /usr/local/opt/llvm/bin/llvm-ar
- crate: radix-engine-toolkit-native
features: "jni"
- crate: native-json-interface
target-triple: x86_64-apple-darwin
custom-linker: ""
custom-compiler: /usr/local/opt/llvm/bin/clang
custom-archiver: /usr/local/opt/llvm/bin/llvm-ar
- crate: radix-engine-toolkit-native
features: "jni"
- crate: native-json-interface
target-triple: aarch64-apple-ios
custom-linker: ""
custom-compiler: /usr/local/opt/llvm/bin/clang
custom-archiver: /usr/local/opt/llvm/bin/llvm-ar
- crate: radix-engine-toolkit-native
features: "jni"
- crate: native-json-interface
target-triple: aarch64-apple-ios-sim
custom-linker: ""
custom-compiler: /usr/local/opt/llvm/bin/clang
custom-archiver: /usr/local/opt/llvm/bin/llvm-ar
- crate: radix-engine-toolkit-native
features: "jni"
- crate: native-json-interface
target-triple: x86_64-pc-windows-gnu
custom-linker: ""
custom-compiler: x86_64-w64-mingw32-gcc
custom-archiver: x86_64-w64-mingw32-ar
- crate: radix-engine-toolkit-native
features: "jni"
- crate: native-json-interface
target-triple: x86_64-unknown-linux-gnu
custom-linker: x86_64-unknown-linux-gnu-gcc
custom-compiler: /usr/local/opt/llvm/bin/clang
custom-archiver: /usr/local/opt/llvm/bin/llvm-ar

# radix-engine-toolkit-wasm Crate
- crate: radix-engine-toolkit-wasm
features: "jni"
- crate: native-json-interface
target-triple: aarch64-unknown-linux-gnu
custom-linker: aarch64-unknown-linux-gnu-gcc
custom-compiler: aarch64-unknown-linux-gnu-gcc
custom-archiver: aarch64-unknown-linux-gnu-gcc-ar
features: "jni"
- crate: native-json-interface
target-triple: i686-unknown-linux-gnu
custom-linker: i686-unknown-linux-gnu-gcc
custom-compiler: i686-unknown-linux-gnu-gcc
custom-archiver: i686-unknown-linux-gnu-gcc-ar
features: "jni"
- crate: native-json-interface
target-triple: wasm32-unknown-unknown
custom-linker: ""
custom-compiler: /usr/local/opt/llvm/bin/clang
custom-archiver: /usr/local/opt/llvm/bin/llvm-ar

# radix-engine-toolkit-jni Crate
- crate: radix-engine-toolkit-jni
target-triple: aarch64-apple-darwin
custom-linker: ""
custom-compiler: /usr/local/opt/llvm/bin/clang
custom-archiver: /usr/local/opt/llvm/bin/llvm-ar
- crate: radix-engine-toolkit-jni
target-triple: x86_64-apple-darwin
custom-linker: ""
custom-compiler: /usr/local/opt/llvm/bin/clang
custom-archiver: /usr/local/opt/llvm/bin/llvm-ar
- crate: radix-engine-toolkit-jni
target-triple: x86_64-pc-windows-gnu
custom-linker: ""
custom-compiler: x86_64-w64-mingw32-gcc
custom-archiver: x86_64-w64-mingw32-ar
- crate: radix-engine-toolkit-jni
target-triple: x86_64-unknown-linux-gnu
custom-linker: x86_64-unknown-linux-gnu-gcc
custom-compiler: /usr/local/opt/llvm/bin/clang
custom-archiver: /usr/local/opt/llvm/bin/llvm-ar
- crate: radix-engine-toolkit-jni
features: "jni"
- crate: native-json-interface
target-triple: aarch64-linux-android
custom-linker: $HOME/android-ndk/android-ndk-r22b/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang
custom-compiler: $HOME/android-ndk/android-ndk-r22b/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang
custom-archiver: $HOME/android-ndk/android-ndk-r22b/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ar
- crate: radix-engine-toolkit-jni
features: "jni"
- crate: native-json-interface
target-triple: armv7-linux-androideabi
custom-linker: $HOME/android-ndk/android-ndk-r22b/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi19-clang
custom-compiler: $HOME/android-ndk/android-ndk-r22b/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi19-clang
custom-archiver: $HOME/android-ndk/android-ndk-r22b/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar
- crate: radix-engine-toolkit-jni
features: "jni"
- crate: native-json-interface
target-triple: i686-linux-android
custom-linker: $HOME/android-ndk/android-ndk-r22b/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android19-clang
custom-compiler: $HOME/android-ndk/android-ndk-r22b/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android19-clang
custom-archiver: $HOME/android-ndk/android-ndk-r22b/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android-ar
features: "jni"

steps:
- name: Checkout
Expand All @@ -99,6 +99,10 @@ jobs:
brew install llvm
brew install x86_64-unknown-linux-gnu
brew install mingw-w64
brew tap messense/macos-cross-toolchains
brew install aarch64-unknown-linux-gnu
brew install i686-unknown-linux-gnu
wget https://dl.google.com/android/repository/android-ndk-r22b-darwin-x86_64.zip
unzip -q android-ndk-r22b-darwin-x86_64.zip -d $HOME/android-ndk
Expand Down Expand Up @@ -132,6 +136,8 @@ jobs:
export CC=${{ matrix.build-target.custom-compiler }}
export AR=${{ matrix.build-target.custom-archiver }}
export features=$${{ matrix.build-target.features }}
export features=${features:="default"}
cargo build \
--target ${{ matrix.build-target.target-triple }} \
Expand Down Expand Up @@ -170,3 +176,63 @@ jobs:
with:
name: "${{ matrix.build-target.crate }}-${{ matrix.build-target.target-triple }}.tar.gz"
path: "./${{matrix.build-target.crate}}/target/${{ matrix.build-target.target-triple }}/release/${{ matrix.build-target.target-triple }}.tar.gz"

publish-csharp-nuget:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Sanity Check no. 1
run: |
echo ${{ github.sha }}
- name: Checkout
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: artifacts
- name: Sanity Check no. 2
run: |
ls -laR ./artifacts/
- name: Extract Artifacts
working-directory: artifacts
run: |
mkdir native
for d in native-json-interface-*.tar.gz; do
mv ./$d/* ./native/
done
cd native
for f in *.tar.gz; do
fn=`echo "$f" | cut -d'.' -f 1`
mkdir "$fn"
tar -xvzf "$f" --directory="$fn";
done
- name: Sanity Check no. 3
run: |
ls -laR ./artifacts/
- name: Setup .NET SDK
uses: actions/setup-dotnet@5a3fa01c67e60dba8f95e2878436c7151c4b5f01
with:
dotnet-version: 7.0.x
- name: Configure Version # TODO missing support for stable packages on releases (where VERSION_SUFFIX should not be appended)
run: |
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD | sed 's/\//-/g')
GIT_COMMIT=$(git log -1 --format=%h )
CORE_VERSION=$(cat radix-engine-toolkit/Cargo.toml | grep -e '^version' | cut -d'"' -f 2)
VERSION_SUFFIX=${GIT_BRANCH}-${GIT_COMMIT}
VERSION=${CORE_VERSION}-${VERSION_SUFFIX}
sed -i "s/\(<version>\)[^<>]*\(<\/version>\)/\1$VERSION\2/g" interop/csharp/RadixDlt.RadixEngineToolkit.Native.nuspec
echo "Configured Version: $VERSION"
- name: NuGet Pack
working-directory: interop/csharp
run: nuget pack
- name: Sanity Check no. 4
run: |
md5sum ./artifacts/native/aarch64-apple-darwin/libradix_engine_toolkit.dylib
md5sum ./interop/csharp/RadixDlt.RadixEngineToolkit.Native.nuspec
- name: Publish Packages
working-directory: interop/csharp
run: dotnet nuget push RadixDlt.RadixEngineToolkit.Native.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_API_KEY }}
24 changes: 18 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
crate: [ radix-engine-toolkit-core, radix-engine-toolkit-native, radix-engine-toolkit-jni, radix-engine-toolkit-wasm]
crate: [ native-json-interface, radix-engine-toolkit ]

steps:
- uses: actions/checkout@v3
Expand All @@ -29,13 +29,25 @@ jobs:
- name: Run tests
run: cargo test --manifest-path ./${{ matrix.crate }}/Cargo.toml --verbose

generated-request-examples-test:
schema-and-example-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checking Generated Requests
- name: Generating new schema and examples
run: |
cd docs-examples-generator
mv request-examples.md old-request-examples.md
cd schema
mv out old-out
mkdir -p out/examples
mkdir -p out/schema
cargo run
cmp --quiet request-examples.md old-request-examples.md && exit 0 || exit 1
- name: Comparing old examples to newly generated
run: |
cd schema
cmp --quiet ./out/examples/request-examples.md ./old-out/examples/request-examples.md && exit 0 || exit 1
- name: Comparing old schema to newly generated
run: |
cd schema
for filename in $(find ./out/schema -type f -name "*.json" -exec basename {} \;);
do
cmp --quiet out/schema/$filename ./old-out/schema/$filename && exit 0 || exit 1
done
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
target
node_modules
out
examples/dotnet/bin
examples/dotnet/obj
.mypy_cache
Expand Down
11 changes: 0 additions & 11 deletions .vscode/settings.json

This file was deleted.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[workspace]
members = [
"radix-engine-toolkit",
"schema",
"serializable",
]
Loading

0 comments on commit e794028

Please sign in to comment.