Created
December 21, 2021 17:45
-
-
Save kibibites/d8537ec7d0906dcff2ebbbe513d38915 to your computer and use it in GitHub Desktop.
Build rust program on linux, macos and windows with caching
This file contains hidden or 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: Rust | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build-UNIX: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/[email protected] | |
with: | |
path: './target/*' | |
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.*') }} | |
restore-keys: ${{ runner.os }}-rust- | |
- run: cargo build --release --verbose | |
- uses: actions/[email protected] | |
with: | |
name: ${{ runner.os }}-Executable | |
path: "./target/release/mod_updater" | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/[email protected] | |
with: | |
path: '.\\target\\*' | |
key: ${{ runner.os }}-rust-${{ hashFiles('**\\Cargo.*') }} | |
restore-keys: ${{ runner.os }}-rust- | |
- run: cargo build --release --verbose | |
- uses: actions/[email protected] | |
with: | |
name: "Windows-Executable" | |
path: ".\\target\\release\\*.exe" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment