Skip to content

Towards greater heights #5

Towards greater heights

Towards greater heights #5

name: Build for release
on:
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
build-and-upload:
name: Build and archive the artifacts
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
cross: true
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
cross: false
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
cross: true
- os: windows-latest
target: x86_64-pc-windows-msvc
cross: false
- os: macos-latest
target: x86_64-apple-darwin
cross: false
- os: macos-latest
target: aarch64-apple-darwin
cross: false
runs-on: ${{matrix.os}}
steps:
- name: Rust Cache
uses: Swatinem/[email protected]
with:
key: ${{matrix.os}}
shared-key: release
- uses: actions-rs/toolchain@v1
if: ${{!matrix.cross}}
with:
toolchain: stable
target: ${{matrix.target}}
- uses: actions/checkout@v3
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: ${{matrix.cross}}
command: build
args: --target ${{matrix.target}} --release
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: elv-${{github.ref_name}}-${{matrix.target}}
path: |
target/${{matrix.target}}/release/elv
target/${{matrix.target}}/release/elv.exe