Skip to content

Commit

Permalink
Update rust.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Melechtna authored Apr 30, 2024
1 parent 2c2831c commit abc289c
Showing 1 changed file with 33 additions and 44 deletions.
77 changes: 33 additions & 44 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,54 @@
name: Build and Release
name: Rust

on:
push:
branches: [ main ]
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build-linux:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build (Linux)
run: cargo build --release

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

- name: Build
run: cargo build --verbose --release
- uses: actions/upload-artifact@v4
with:
name: Linux
path: target/release/*
compression-level: 0
build-windows:

runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build (Windows)
run: cargo build --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
- name: Build
run: cargo build --verbose --release
- uses: actions/upload-artifact@v4
with:
name: linux-bin
path: target/release
name: Windows
path: target/release/*
compression-level: 0

- name: Upload macOS Binary
uses: actions/upload-artifact@v3
with:
name: macos-bin
path: target/release
build-macos:

- name: Upload Windows Binary
uses: actions/upload-artifact@v3
with:
name: windows-bin
path: target/release
runs-on: macos-latest

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
- name: update
run: rustup update stable
- name: Build
run: cargo build --verbose --release
- uses: actions/upload-artifact@v4
with:
name: MacOS
path: target/release/*
compression-level: 0

0 comments on commit abc289c

Please sign in to comment.