Updated github workflows
parent
04894ce6a7
commit
b78392bb9a
@ -1,43 +0,0 @@
|
|||||||
name: Binary build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branch:
|
|
||||||
- 'main'
|
|
||||||
- 'stable'
|
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
cross-build:
|
|
||||||
name: Publish binary builds
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
target: ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "armv7-unknown-linux-gnueabihf", "x86_64-pc-windows-gnu"]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Install rust 1.70.0
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: 1.70.0
|
|
||||||
override: true
|
|
||||||
- name: Download renamer
|
|
||||||
run: curl -sSf https://raw.githubusercontent.com/memflow/memflowup/master/target_rename.sh > target_rename.sh
|
|
||||||
- name: Build artifacts
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
use-cross: true
|
|
||||||
command: build
|
|
||||||
args: --release --all-features --workspace --verbose --target ${{ matrix.target }}
|
|
||||||
- name: Rename and collect artifacts
|
|
||||||
id: artifacts
|
|
||||||
run: echo "::set-output name=artifact::$(sh ./target_rename.sh "${{ matrix.target }}" | head -n 1)"
|
|
||||||
- name: Upload build artifacts
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
tag_name: bin-${{ github.ref_name }}
|
|
||||||
files: |
|
|
||||||
${{ steps.artifacts.outputs.artifact }}
|
|
@ -1,122 +1,75 @@
|
|||||||
name: Build and test
|
name: Build and test
|
||||||
|
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
RUST_BACKTRACE: 1
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build:
|
||||||
build_ubuntu_x86-64_bundled:
|
runs-on: ${{ matrix.os }}
|
||||||
name: Build for ubuntu-latest (x86-64) with bundled headers
|
strategy:
|
||||||
runs-on: ubuntu-latest
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
flags: [--all-features, --no-default-features]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- name: Install rust 1.70.0
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: 1.70.0
|
|
||||||
override: true
|
|
||||||
- name: install libusb-1.0
|
|
||||||
run: sudo apt-get install libusb-1.0-0-dev
|
|
||||||
- name: build
|
|
||||||
run: cargo build --workspace --verbose
|
|
||||||
- name: run tests
|
|
||||||
run: cargo test --workspace --verbose
|
|
||||||
- name: build examples
|
|
||||||
run: cargo build --workspace --examples --verbose
|
|
||||||
|
|
||||||
build_ubuntu_x86-64_bindgen:
|
|
||||||
name: Build for ubuntu-latest (x86-64) with generated headers
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- name: Install rust 1.70.0
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: 1.70.0
|
|
||||||
override: true
|
|
||||||
- name: install libusb-1.0
|
- name: install libusb-1.0
|
||||||
run: sudo apt-get install libusb-1.0-0-dev
|
run: sudo apt-get install libusb-1.0-0-dev
|
||||||
- name: build
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: cargo build --workspace --features bindgen --verbose
|
- name: install llvm and clang
|
||||||
- name: run tests
|
uses: KyleMayes/install-llvm-action@v1
|
||||||
run: cargo test --workspace --features bindgen --verbose
|
|
||||||
- name: build examples
|
|
||||||
run: cargo build --workspace --features bindgen --examples --verbose
|
|
||||||
|
|
||||||
build_windows_x86-64_bundled:
|
|
||||||
name: Build for windows-latest (x86-64) with bundled headers
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- name: Install rust 1.70.0
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
with:
|
||||||
toolchain: 1.70.0
|
version: "10.0"
|
||||||
override: true
|
directory: ${{ runner.temp }}/llvm
|
||||||
- name: build
|
if: matrix.os == 'windows-latest'
|
||||||
shell: bash
|
- name: set LIBCLANG_PATH
|
||||||
run: cargo build --workspace --verbose
|
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
|
||||||
- name: run tests
|
if: matrix.os == 'windows-latest'
|
||||||
shell: bash
|
|
||||||
run: cargo test --workspace --verbose
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
- name: build examples
|
- run: cargo build ${{ matrix.flags }} --release
|
||||||
shell: bash
|
- run: cargo build ${{ matrix.flags }} --release --examples
|
||||||
run: cargo build --workspace --examples --verbose
|
|
||||||
|
|
||||||
build_windows_x86-64_bindgen:
|
test:
|
||||||
name: Build for windows-latest (x86-64) with generated headers
|
runs-on: ${{ matrix.os }}
|
||||||
runs-on: windows-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest]
|
||||||
|
flags: [--all-features, --no-default-features]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
submodules: 'true'
|
- name: install libusb-1.0
|
||||||
- name: Install rust 1.70.0
|
run: sudo apt-get install libusb-1.0-0-dev
|
||||||
uses: actions-rs/toolchain@v1
|
if: matrix.os == 'ubuntu-latest'
|
||||||
with:
|
|
||||||
toolchain: 1.70.0
|
|
||||||
override: true
|
|
||||||
- name: install llvm and clang
|
- name: install llvm and clang
|
||||||
uses: KyleMayes/install-llvm-action@v1
|
uses: KyleMayes/install-llvm-action@v1
|
||||||
with:
|
with:
|
||||||
version: "10.0"
|
version: "10.0"
|
||||||
directory: ${{ runner.temp }}/llvm
|
directory: ${{ runner.temp }}/llvm
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
- name: set LIBCLANG_PATH
|
- name: set LIBCLANG_PATH
|
||||||
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
|
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
|
||||||
- name: build
|
if: matrix.os == 'windows-latest'
|
||||||
shell: bash
|
|
||||||
run: cargo build --workspace --features bindgen --verbose
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
- name: run tests
|
- run: cargo test ${{ matrix.flags }} --all
|
||||||
shell: bash
|
|
||||||
run: cargo test --workspace --features bindgen --verbose
|
|
||||||
- name: build examples
|
|
||||||
shell: bash
|
|
||||||
run: cargo build --workspace --features bindgen --examples --verbose
|
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- name: Install rust 1.70.0
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: 1.70.0
|
|
||||||
override: true
|
|
||||||
- name: install libusb-1.0
|
- name: install libusb-1.0
|
||||||
run: sudo apt-get install libusb-1.0-0-dev
|
run: sudo apt-get install libusb-1.0-0-dev
|
||||||
- run: rustup component add clippy
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
- name: check formatting
|
|
||||||
run: cargo fmt -- --check
|
|
||||||
- uses: actions-rs/clippy-check@v1
|
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
components: rustfmt, clippy
|
||||||
args: --all-targets
|
- run: cargo fmt -- --check
|
||||||
|
- run: cargo clippy --all-targets --all-features
|
||||||
|
@ -0,0 +1,82 @@
|
|||||||
|
name: Deploy to memflow registry
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
|
||||||
|
env:
|
||||||
|
RUST_BACKTRACE: 1
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
PLUGIN_NAME: coredump
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
|
||||||
|
runs-on: ${{ matrix.platform.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
platform:
|
||||||
|
- os_name: linux-x86_64
|
||||||
|
os: ubuntu-latest
|
||||||
|
target: x86_64-unknown-linux-gnu
|
||||||
|
- os_name: linux-aarch64
|
||||||
|
os: ubuntu-latest
|
||||||
|
target: aarch64-unknown-linux-gnu
|
||||||
|
- os_name: linux-arm
|
||||||
|
os: ubuntu-latest
|
||||||
|
target: arm-unknown-linux-gnueabi
|
||||||
|
- os_name: linux-i686
|
||||||
|
os: ubuntu-latest
|
||||||
|
target: i686-unknown-linux-gnu
|
||||||
|
- os_name: windows-aarch64
|
||||||
|
os: windows-latest
|
||||||
|
target: aarch64-pc-windows-msvc
|
||||||
|
- os_name: windows-i686
|
||||||
|
os: windows-latest
|
||||||
|
target: i686-pc-windows-msvc
|
||||||
|
- os_name: windows-x86_64
|
||||||
|
os: windows-latest
|
||||||
|
target: x86_64-pc-windows-msvc
|
||||||
|
toolchain:
|
||||||
|
- stable
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Cache cargo & target directories
|
||||||
|
uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- name: install libusb-1.0
|
||||||
|
run: sudo apt-get install libusb-1.0-0-dev
|
||||||
|
if: matrix.platform.os == 'ubuntu-latest'
|
||||||
|
- name: install llvm and clang
|
||||||
|
uses: KyleMayes/install-llvm-action@v1
|
||||||
|
with:
|
||||||
|
version: "10.0"
|
||||||
|
directory: ${{ runner.temp }}/llvm
|
||||||
|
if: matrix.platform.os == 'windows-latest'
|
||||||
|
- name: set LIBCLANG_PATH
|
||||||
|
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
|
||||||
|
if: matrix.platform.os == 'windows-latest'
|
||||||
|
|
||||||
|
- name: Build binary
|
||||||
|
uses: houseabsolute/actions-rust-cross@v0
|
||||||
|
with:
|
||||||
|
command: "build"
|
||||||
|
target: ${{ matrix.platform.target }}
|
||||||
|
toolchain: ${{ matrix.toolchain }}
|
||||||
|
args: "--locked --release --all-features"
|
||||||
|
strip: true
|
||||||
|
|
||||||
|
- name: Install memflowup
|
||||||
|
run: cargo install --git https://github.com/memflow/memflowup
|
||||||
|
- run: echo "${{ secrets.MEMFLOW_REGISTRY_SIGNING_KEY}}" > ec-secp256k1-priv-key.pem
|
||||||
|
- name: Upload plugin (linux)
|
||||||
|
run: memflowup --skip-version-check push --token ${{ secrets.MEMFLOW_REGISTRY_TOKEN }} --priv-key ec-secp256k1-priv-key.pem --file target/${{ matrix.platform.target }}/release/libmemflow_${{ env. PLUGIN_NAME}}.so
|
||||||
|
if: matrix.platform.os == 'ubuntu-latest'
|
||||||
|
- name: Upload plugin (windows)
|
||||||
|
run: memflowup --skip-version-check push --token ${{ secrets.MEMFLOW_REGISTRY_TOKEN }} --priv-key ec-secp256k1-priv-key.pem --file target/${{ matrix.platform.target }}/release/memflow_${{ env. PLUGIN_NAME}}.dll
|
||||||
|
if: matrix.platform.os == 'windows-latest'
|
||||||
|
- name: Upload plugin (mac)
|
||||||
|
run: memflowup --skip-version-check push --token ${{ secrets.MEMFLOW_REGISTRY_TOKEN }} --priv-key ec-secp256k1-priv-key.pem --file target/${{ matrix.platform.target }}/release/libmemflow_${{ env. PLUGIN_NAME}}.dylib
|
||||||
|
if: matrix.platform.os == 'macOS-latest'
|
@ -1,87 +0,0 @@
|
|||||||
name: Release binaries
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [created]
|
|
||||||
|
|
||||||
env:
|
|
||||||
CARGO_TERM_COLOR: always
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
build_ubuntu_x86-64:
|
|
||||||
name: Build artifacts for ubuntu-latest (x86-64)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- name: Install rust 1.70.0
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: 1.70.0
|
|
||||||
override: true
|
|
||||||
- name: install libusb-1.0
|
|
||||||
run: sudo apt-get install libusb-1.0-0-dev
|
|
||||||
- name: build
|
|
||||||
run: cargo build --release --workspace --verbose
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: library-ubuntu
|
|
||||||
path: target/release/*.so
|
|
||||||
|
|
||||||
build_windows_x86-64:
|
|
||||||
name: Build artifacts for windows-latest (x86-64)
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: 'true'
|
|
||||||
- name: Install rust 1.70.0
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: 1.70.0
|
|
||||||
override: true
|
|
||||||
- name: install llvm and clang
|
|
||||||
uses: KyleMayes/install-llvm-action@v1
|
|
||||||
with:
|
|
||||||
version: "10.0"
|
|
||||||
directory: ${{ runner.temp }}/llvm
|
|
||||||
- name: set LIBCLANG_PATH
|
|
||||||
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
|
|
||||||
- name: build
|
|
||||||
shell: bash
|
|
||||||
run: cargo build --release --workspace --verbose
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
name: library-windows
|
|
||||||
path: target/release/*.dll
|
|
||||||
|
|
||||||
publish_artifacts:
|
|
||||||
name: Publish artifacts for x86-64/windows-latest
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: [build_ubuntu_x86-64, build_windows_x86-64]
|
|
||||||
steps:
|
|
||||||
- uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: library-ubuntu
|
|
||||||
- name: Create archive for linux x86-64
|
|
||||||
run: zip memflow_pcileech_linux_x86-64.zip *.so
|
|
||||||
- name: Upload artifacts for linux x86-64
|
|
||||||
uses: skx/github-action-publish-binaries@master
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
args: 'memflow_pcileech_linux_x86-64.zip'
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v2
|
|
||||||
with:
|
|
||||||
name: library-windows
|
|
||||||
- name: Create archive for windows x86-64
|
|
||||||
run: zip memflow_pcileech_windows_x86-64.zip *.dll
|
|
||||||
- name: Upload artifacts for windows x86-64
|
|
||||||
uses: skx/github-action-publish-binaries@master
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
args: 'memflow_pcileech_windows_x86-64.zip'
|
|
Loading…
Reference in New Issue