Add asb to release including ARM build

pull/311/head
Daniel Karzel 3 years ago
parent 009597ac49
commit 58c33f8468

@ -40,7 +40,7 @@ jobs:
build: build:
strategy: strategy:
matrix: matrix:
target: [ x86_64-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-msvc ] target: [ x86_64-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-msvc, armv7-unknown-linux-gnueabihf ]
include: include:
- target: x86_64-unknown-linux-gnu - target: x86_64-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
@ -56,7 +56,15 @@ jobs:
- uses: Swatinem/rust-cache@v1.2.0 - uses: Swatinem/rust-cache@v1.2.0
- name: Install compiler for armhf arch
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- name: Build binary - name: Build binary
env:
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
run: | run: |
cargo build -p swap --target ${{ matrix.target }} cargo build -p swap --target ${{ matrix.target }}
@ -77,7 +85,7 @@ jobs:
RUST_TEST_TASKS: 2 RUST_TEST_TASKS: 2
strategy: strategy:
matrix: matrix:
target: [ x86_64-unknown-linux-gnu, x86_64-apple-darwin ] target: [ x86_64-unknown-linux-gnu, x86_64-apple-darwin, armv7-unknown-linux-gnueabihf ]
include: include:
- target: x86_64-unknown-linux-gnu - target: x86_64-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
@ -91,7 +99,15 @@ jobs:
- uses: Swatinem/rust-cache@v1.2.0 - uses: Swatinem/rust-cache@v1.2.0
- name: Install compiler for armhf arch
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- name: Build tests - name: Build tests
env:
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
run: cargo build --tests --workspace --all-features run: cargo build --tests --workspace --all-features
- name: Run monero-harness tests - name: Run monero-harness tests

@ -1,4 +1,4 @@
name: "Release swap" name: "Release swap and asb"
on: on:
release: release:
@ -10,13 +10,32 @@ jobs:
strategy: strategy:
matrix: matrix:
include: include:
- target: x86_64-unknown-linux-gnu - bin: swap
target: x86_64-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
archive_ext: tar archive_ext: tar
- target: x86_64-apple-darwin - bin: swap
target: x86_64-apple-darwin
os: macos-latest os: macos-latest
archive_ext: tar archive_ext: tar
- target: x86_64-pc-windows-msvc - bin: swap
target: x86_64-pc-windows-msvc
os: windows-latest
archive_ext: zip
- bin: asb
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
archive_ext: tar
- bin: asb
target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
archive_ext: tar
- bin: asb
target: x86_64-apple-darwin
os: macos-latest
archive_ext: tar
- bin: asb
target: x86_64-pc-windows-msvc
os: windows-latest os: windows-latest
archive_ext: zip archive_ext: zip
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -29,11 +48,20 @@ jobs:
- uses: Swatinem/rust-cache@v1.2.0 - uses: Swatinem/rust-cache@v1.2.0
- name: Build ${{ matrix.target }} release binary - name: Install compiler for armhf arch
run: cargo build --target=${{ matrix.target }} --release --package swap --bin swap if: matrix.target == 'armv7-unknown-linux-gnueabihf'
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- name: Build ${{ matrix.target }} ${{ matrix.bin }} release binary
env:
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
run: cargo build --target=${{ matrix.target }} --release --package swap --bin ${{ matrix.bin }}
- name: Smoke test the binary - name: Smoke test the binary
run: target/${{ matrix.target }}/release/swap --help if: matrix.target != 'armv7-unknown-linux-gnueabihf' # armv7-unknown-linux-gnueabihf is only cross-compiled, no smoke test
run: target/${{ matrix.target }}/release/${{ matrix.bin }} --help
# Remove once python 3 is the default # Remove once python 3 is the default
- uses: actions/setup-python@v1 - uses: actions/setup-python@v1
@ -51,26 +79,26 @@ jobs:
triple = "${{ matrix.target }}".split("-") triple = "${{ matrix.target }}".split("-")
arch = triple[0] arch = triple[0]
archive_name=f'swap_${{ github.event.release.tag_name }}_{os_info.system}_{arch}.${{ matrix.archive_ext }}' archive_name=f'${{ matrix.bin }}_${{ github.event.release.tag_name }}_{os_info.system}_{arch}.${{ matrix.archive_ext }}'
print(f'::set-output name=archive::{archive_name}') print(f'::set-output name=archive::{archive_name}')
- name: Pack macos archive - name: Pack macos archive
if: matrix.os == 'macos-latest' if: matrix.os == 'macos-latest'
shell: bash shell: bash
run: gtar -C ./target/${{ matrix.target }}/release --create --file=${{ steps.create-archive-name.outputs.archive }} swap run: gtar -C ./target/${{ matrix.target }}/release --create --file=${{ steps.create-archive-name.outputs.archive }} ${{ matrix.bin }}
- name: Pack linux archive - name: Pack linux archive
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
shell: bash shell: bash
run: tar -C ./target/${{ matrix.target }}/release --create --file=${{ steps.create-archive-name.outputs.archive }} swap run: tar -C ./target/${{ matrix.target }}/release --create --file=${{ steps.create-archive-name.outputs.archive }} ${{ matrix.bin }}
- name: Pack windows archive - name: Pack windows archive
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
shell: bash shell: bash
run: | run: |
cp target/${{ matrix.target }}/release/swap.exe ./swap.exe cp target/${{ matrix.target }}/release/${{ matrix.bin }}.exe ./${{ matrix.bin }}.exe
7z a -tzip ${{ steps.create-archive-name.outputs.archive }} ./swap.exe 7z a -tzip ${{ steps.create-archive-name.outputs.archive }} ./${{ matrix.bin }}.exe
- name: Upload archive - name: Upload archive
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1

11
Cargo.lock generated

@ -2311,6 +2311,15 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
[[package]]
name = "openssl-src"
version = "111.14.0+1.1.1j"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "055b569b5bd7e5462a1700f595c7c7d487691d73b5ce064176af7f9f0cbb80a9"
dependencies = [
"cc",
]
[[package]] [[package]]
name = "openssl-sys" name = "openssl-sys"
version = "0.9.60" version = "0.9.60"
@ -2320,6 +2329,7 @@ dependencies = [
"autocfg 1.0.1", "autocfg 1.0.1",
"cc", "cc",
"libc", "libc",
"openssl-src",
"pkg-config", "pkg-config",
"vcpkg", "vcpkg",
] ]
@ -3598,6 +3608,7 @@ dependencies = [
"monero", "monero",
"monero-harness", "monero-harness",
"monero-rpc", "monero-rpc",
"openssl",
"pem", "pem",
"port_check", "port_check",
"prettytable-rs", "prettytable-rs",

@ -1,3 +1,4 @@
[toolchain] [toolchain]
channel = "nightly-2021-01-31" channel = "nightly-2021-01-31"
components = ["rustfmt", "clippy"] components = ["rustfmt", "clippy"]
targets = ["armv7-unknown-linux-gnueabihf"]

@ -31,6 +31,7 @@ libp2p-async-await = { git = "https://github.com/comit-network/rust-libp2p-async
miniscript = { version = "5", features = ["serde"] } miniscript = { version = "5", features = ["serde"] }
monero = { version = "0.10", features = ["serde_support"] } monero = { version = "0.10", features = ["serde_support"] }
monero-rpc = { path = "../monero-rpc" } monero-rpc = { path = "../monero-rpc" }
openssl = { version = "0.10", features = ["vendored"] }
pem = "0.8" pem = "0.8"
prettytable-rs = "0.8" prettytable-rs = "0.8"
rand = "0.7" rand = "0.7"

Loading…
Cancel
Save