Skip to content

Commit

Permalink
chore: Update Rust workflow to support multiple operating systems
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarburgues committed May 15, 2024
1 parent 35060bf commit 92c233d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ env:
jobs:
build:

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

strategy:
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v4
Expand All @@ -21,10 +25,11 @@ jobs:
with:
toolchain: stable
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --release --verbose
run: cargo build --release


- name: Create Release
if: github.event_name == 'push'
id: create_release
uses: actions/create-release@v1
env:
Expand All @@ -34,12 +39,14 @@ jobs:
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false

- name: Upload Release Asset
if: github.event_name == 'push'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/release/ml2pdf
asset_name: ml2pdf
asset_path: ${{ matrix.os == 'windows-latest' && 'target/release/ml2pdf.exe' || 'target/release/ml2pdf' }}
asset_name: ${{ matrix.os == 'windows-latest' && 'ml2pdf.exe' || 'ml2pdf' }}
asset_content_type: application/octet-stream

0 comments on commit 92c233d

Please sign in to comment.