Add github action to build binaries
Signed-off-by: trivernis <trivernis@protonmail.com>main
parent
28f750b062
commit
ed51d413b2
@ -0,0 +1,53 @@
|
|||||||
|
name: "Build"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, develop, actions]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Set up toolchain
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: nightly
|
||||||
|
override: true
|
||||||
|
- name: Set up MinGW
|
||||||
|
uses: egor-tensin/setup-mingw@v1
|
||||||
|
with:
|
||||||
|
platform: x64
|
||||||
|
- name: Cache cargo builds
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
target
|
||||||
|
~/.cargo/
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-cargo-
|
||||||
|
- name: Test
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: --all
|
||||||
|
- name: Build Release
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
use-cross: false
|
||||||
|
command: build
|
||||||
|
args: --release --all-features -Zmultitarget --target x86_64-unknown-linux-gnu --target x86_64-pc-windows-gnu
|
||||||
|
- name: Create directories
|
||||||
|
run: mkdir bin && mkdir bin/linux && mkdir bin/windows
|
||||||
|
- name: Move binaries
|
||||||
|
run: mv target/x86_64-unknown-linux-gnu/release/{uwuencode,uwudecode} bin/linux && mv target/x86_64-pc-windows-gnu/release/{uwuencode,uwudecode}.exe bin/windows
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: uwucodec
|
||||||
|
path: bin/*
|
@ -0,0 +1,6 @@
|
|||||||
|
[toolchain]
|
||||||
|
channel = "nightly"
|
||||||
|
targets = [
|
||||||
|
"x86_64-unknown-linux-gnu",
|
||||||
|
"x86_64-pc-windows-gnu",
|
||||||
|
]
|
Loading…
Reference in New Issue