You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5 KiB
YAML

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/*