diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b6299db..3608def 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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 @@ -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: @@ -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