Skip to content

Build and upload binaries to release #18

Build and upload binaries to release

Build and upload binaries to release #18

name: Build and upload binaries to release
on:
release:
types: [published]
jobs:
build:
name: Build for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
exe_ext: .exe
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
exe_ext: ''
- os: macos-latest
target: x86_64-apple-darwin
exe_ext: ''
- os: macos-latest
target: aarch64-apple-darwin
exe_ext: ''
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install latest Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true
- name: Add build target
run: rustup target add ${{ matrix.target }}
- name: Build binary
run: cargo +nightly build --release --target ${{ matrix.target }} --out-dir kitty-artifacts -Z unstable-options
- name: Upload binary to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: kitty-artifacts/kitty${{ matrix.exe_ext }}
asset_name: kitty-${{ matrix.target }}${{ matrix.exe_ext }}
tag: ${{ github.event.release.tag_name }}