Skip to content

Update How_To_Build.md #21

Update How_To_Build.md

Update How_To_Build.md #21

name: Build_HydraUSB3_USB_benchmark
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
defaults:
run:
working-directory: HydraUSB3_USB_benchmark
jobs:
HydraUSB3_USB_benchmark_Ubuntu:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout
run: git fetch --prune --unshallow
- name: Install pkg-config libusb-1.0-0-dev
run: sudo apt-get install pkg-config libusb-1.0-0-dev
- name: Get build timestamp
id: id_date
shell: bash
run: echo "timestamp=$(date +%Y-%m-%d-%H-%M-%S)" >> $GITHUB_OUTPUT
- name: Get app version + timestamp
id: id_version
run: echo "app_version=$(git describe --tags HEAD)-${{steps.id_date.outputs.timestamp}}" >> $GITHUB_OUTPUT
- name: Build app
shell: bash
run: |
make
- name: Upload artifact
env:
APP_VERSION: "${{steps.id_version.outputs.app_version}}"
uses: actions/upload-artifact@v3
with:
name: HydraUSB3_USB_benchmark_Ubuntu-${{steps.id_version.outputs.app_version}}
path: ./
HydraUSB3_USB_benchmark_Windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: git mingw-w64-x86_64-make mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc mingw-w64-x86_64-libusb
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout
run: git fetch --prune --unshallow
- name: Get build timestamp
id: id_date
shell: bash
run: echo "timestamp=$(date +%Y-%m-%d-%H-%M-%S)" >> $GITHUB_OUTPUT
- name: Get app version + timestamp
id: id_version
run: echo "app_version=$(git describe --tags HEAD)-${{steps.id_date.outputs.timestamp}}" >> $GITHUB_OUTPUT
- name: Build app
shell: msys2 {0}
run: |
cd HydraUSB3_USB_benchmark
mingw32-make
cp /mingw64/bin/libusb-1.0.dll ./
- name: Upload artifact
env:
APP_VERSION: "${{steps.id_version.outputs.app_version}}"
uses: actions/upload-artifact@v3
with:
name: HydraUSB3_USB_benchmark_Windows-${{steps.id_version.outputs.app_version}}
path: ./