Skip to content

Commit

Permalink
Fixed Rust release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-e authored Sep 20, 2024
1 parent f8bf0c0 commit 0ff3178
Showing 1 changed file with 5 additions and 37 deletions.
42 changes: 5 additions & 37 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,17 @@ on:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Rust
- name: Set up Rust for Windows
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.os == 'windows-latest' && 'x86_64-pc-windows-msvc' || 'x86_64-unknown-linux-gnu' || 'x86_64-apple-darwin' }}
target: x86_64-pc-windows-msvc

- name: Install dependencies
run: cargo fetch
Expand All @@ -28,57 +25,28 @@ jobs:
run: cargo build --release

- name: Upload artifact (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: windows-latest-build
path: target/release/arnis.exe

- name: Upload artifact (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: ubuntu-latest-build
path: target/release/arnis

- name: Upload artifact (MacOS)
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: macos-latest-build
path: target/release/arnis

release:
runs-on: ubuntu-latest
runs-on: windows-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download build artifacts (Ubuntu)
uses: actions/download-artifact@v3
with:
name: ubuntu-latest-build
path: ./builds/ubuntu

- name: Download build artifacts (Windows)
- name: Download Windows build artifact
uses: actions/download-artifact@v3
with:
name: windows-latest-build
path: ./builds/windows

- name: Download build artifacts (MacOS)
uses: actions/download-artifact@v3
with:
name: macos-latest-build
path: ./builds/macos

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
builds/ubuntu/arnis
builds/windows/arnis.exe
builds/macos/arnis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0ff3178

Please sign in to comment.