Update rust.yml #20
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 and Release | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build (Linux) | |
run: cargo build --release --verbose | |
- name: Verify Build Output (Optional) | |
run: | | |
ls /home/runner/work/LBA2SD/LBA2SD/target/release # Adjust path based on logs | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update Rust (macOS) | |
run: rustup update stable | |
- name: Build (macOS) | |
run: cargo build --release --verbose | |
- name: Verify Build Output (Optional) | |
run: | | |
ls /Users/runner/work/LBA2SD/LBA2SD/target/release | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build (Windows) | |
run: cargo build --release --verbose | |
- name: Verify Build Output (Optional) | |
run: | | |
dir /home/runner/work/LBA2SD/LBA2SD/target/release | |
upload-artifacts: | |
needs: [build-linux, build-macos, build-windows] | |
runs-on: ubuntu-latest # Can be any OS | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Upload Linux Binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-bin | |
path: /target/release/ | |
- name: Upload macOS Binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos-bin | |
path: /target/release/ | |
- name: Upload Windows Binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-bin | |
path: \target\release\ | |
download-artifacts: # New job to download artifacts | |
needs: upload-artifacts | |
runs-on: ubuntu-latest # Can be any OS (where you want the artifacts) | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Artifacts | |
run: | | |
for os in ubuntu-latest macos-latest windows-latest; do | |
curl -LJO "https://github.com/${{ github.repository }}/actions/artifacts/${{ github.run_id }}/downloads/${os}-bin.zip" | |
done |