Skip to content

Commit b1ffccd

Browse files
authored
Create rust.yml
1 parent ba0962e commit b1ffccd

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/rust.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
pull_request:
6+
release:
7+
types: [published]
8+
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
os: [x86_64-unknown-linux-musl, arm-unknown-linux-musleabihf]
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: nightly
25+
default: true
26+
components: clippy
27+
28+
- uses: actions-rs/clippy-check@v1
29+
name: Clippy
30+
with:
31+
use-cross: true
32+
name: clippy-${{ matrix.os }}
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
args: --all-features --target ${{ matrix.os }}
35+
36+
- name: Build Binary
37+
uses: actions-rs/cargo@v1
38+
with:
39+
use-cross: true
40+
command: build
41+
args: --target ${{ matrix.os }} --release
42+
43+
- name: Save Artifact
44+
uses: actions/upload-artifact@v2
45+
with:
46+
name: nethex-${{ matrix.os }}
47+
path: target/${{ matrix.os }}/release/net_hex
48+
49+
50+
- name: Upload binary
51+
if: github.event_name == 'release'
52+
uses: actions/upload-release-asset@v1
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
asset_name: nethex-${{ matrix.os }}
57+
asset_path: target/${{ matrix.os }}/release/net_hex
58+
upload_url: ${{ github.event.release.upload_url }}
59+
asset_content_type: application/octet-stream
60+
61+

0 commit comments

Comments
 (0)