Add github action workflows for build, test, release, check #1
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: Artifact build | |
on: | |
pull_request: | |
push: | |
branches: | |
- develop | |
- master | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
binary: tcli.exe | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
binary: tcli | |
name: Build artifacts for ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- name: Restore cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: cargo build --target ${{ matrix.target }} --release | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tcli-${{ matrix.target }} | |
path: ./target/${{ matrix.target }}/release/${{ matrix.binary }} |