Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Artifacts | |
on: | |
push: | |
branches: | |
- build | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Rust and Cross | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
source $HOME/.cargo/env | |
rustup component add rustfmt | |
cargo install cross | |
- name: Install Docker | |
run: | | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
sudo sh get-docker.sh | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Build artifacts for Linux | |
run: | | |
sudo apt-get update | |
sudo apt-get install musl-tools | |
rustup target add x86_64-unknown-linux-musl | |
cross build --target x86_64-unknown-linux-musl --release | |
env: | |
PKG_CONFIG_ALLOW_CROSS: 1 | |
- name: Set up Docker | |
uses: docker/setup-docker@v1 | |
- name: Build artifacts for Windows | |
run: docker run --rm -v $PWD:/workspace -w /workspace -e PKG_CONFIG_ALLOW_CROSS=1 rust:1.55-cross bash -c "apt-get update && apt-get install -y mingw-w64 && rustup target add x86_64-pc-windows-gnu && cross build --target x86_64-pc-windows-gnu --release --no-default-features --features vendored" | |
env: | |
PKG_CONFIG_ALLOW_CROSS: 1 | |
- name: Build artifacts for Mac | |
run: cross build --target x86_64-apple-darwin --release | |
env: | |
PKG_CONFIG_ALLOW_CROSS: 1 | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: artifacts | |
path: | | |
target/x86_64-pc-windows-gnu/release/ | |
target/x86_64-apple-darwin/release/ | |
target/x86_64-unknown-linux-musl/release/ |