52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
name: build
|
|
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
tags: '*'
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-18.04, ubuntu-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Prep build for ${{ matrix.os }}
|
|
run: sudo apt-get install libudev-dev
|
|
- name: Build for ${{ matrix.os }}
|
|
run: cargo build --verbose --release
|
|
- name: Run tests for ${{ matrix.os }}
|
|
run: cargo test --verbose
|
|
- name: Create Release for ${{ matrix.os }}
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
continue-on-error: true
|
|
if: startsWith(github.ref, 'refs/tags')
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: Release ${{ github.ref }}
|
|
draft: false
|
|
prerelease: false
|
|
- name: Upload binaries to release for ${{ matrix.os }}
|
|
uses: svenstaro/upload-release-action@v2
|
|
if: startsWith(github.ref, 'refs/tags')
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: target/release/xbnet
|
|
asset_name: xbnet-${{ matrix.os }}.bin
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
body: ""
|