Skip to content

Commit

Permalink
Use matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Legend-Master committed Jan 15, 2024
1 parent 035215d commit d766688
Showing 1 changed file with 19 additions and 31 deletions.
50 changes: 19 additions & 31 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,20 @@ env:
CARGO_TERM_COLOR: always

jobs:
# build-windows:
# runs-on: windows-latest

# steps:
# - uses: actions/checkout@v4

# - name: Install Rust toolchain
# run: |
# rustup toolchain install nightly
# rustup component add rust-src --toolchain nightly

# - name: Build
# run: cargo +nightly build -Z build-std=std,panic_abort --target x86_64-pc-windows-msvc --release

# - uses: actions/upload-artifact@v4
# with:
# name: windows-client
# path: ./target/release/client.exe

# - uses: actions/upload-artifact@v4
# with:
# name: windows-server
# path: ./target/release/server.exe

build-linux:
runs-on: ubuntu-latest
build-release:
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
include:
- os: windows-latest
os-name: windows
target: x86_64-pc-windows-msvc
executable-extension: .exe
- os: ubuntu-latest
os-name: linux
target: x86_64-unknown-linux-gnu

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
Expand All @@ -43,14 +31,14 @@ jobs:
rustup component add rust-src --toolchain nightly
- name: Build
run: cargo +nightly build -Z build-std=std,panic_abort --target x86_64-unknown-linux-gnu --release
run: cargo +nightly build -Z build-std=std,panic_abort --target ${{ matrix.target }} --release

- uses: actions/upload-artifact@v4
with:
name: linux-client
path: ./target/x86_64-unknown-linux-gnu/release/client
name: ${{ matrix.os-name }}-client
path: ./target/${{ matrix.target }}/release/client${{ matrix.executable-extension }}

- uses: actions/upload-artifact@v4
with:
name: linux-server
path: ./target/x86_64-unknown-linux-gnu/release/server
name: ${{ matrix.os-name }}-server
path: ./target/${{ matrix.target }}/release/server${{ matrix.executable-extension }}

0 comments on commit d766688

Please sign in to comment.