add build file #3
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 Project | |
on: | |
push: | |
branches: | |
- main | |
- release | |
jobs: | |
build: | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
platform: [ubuntu-latest] | |
steps: | |
# Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Install Rust | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
# Build the project | |
- name: Build the project | |
run: cargo build --release | |
# Upload the binary as an artifact, correctly naming it based on platform | |
- name: Upload binary artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.platform }}-binary | |
path: | | |
target/release/runlike${{ matrix.platform == 'windows-latest' && '.exe' || '' }} |