From fc9b742331c6444fcecd044e970a286e9b15633e Mon Sep 17 00:00:00 2001 From: Caelan Sayler Date: Wed, 10 Jan 2024 23:20:43 +0000 Subject: [PATCH] Add ubuntu to matrix build --- .github/workflows/build.yml | 34 ++++++++++++++++++++-------- src/Velopack.Vpk/Velopack.Vpk.csproj | 8 +++++-- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d650af22..392f80df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: build: strategy: matrix: - os: [macos-latest, windows-latest] + os: [macos-latest, windows-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - name: Print dotnet version @@ -33,8 +33,7 @@ jobs: with: path: ~/.nuget/packages key: ${{ runner.os }}-test-nuget-${{ hashFiles('**/packages.lock.json') }} - restore-keys: | - ${{ runner.os }}-test-nuget- + restore-keys: ${{ runner.os }}-test-nuget- - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov @@ -49,22 +48,31 @@ jobs: - name: Set Windows Feature shell: pwsh - run: Add-Content -Path $env:GITHUB_ENV -Value "rust_features=--features windows" + run: Add-Content -Path $env:GITHUB_ENV -Value "EXTRA_RUST_FLAGS=--features windows" if: ${{ matrix.os == 'windows-latest' }} + - name: Set Linux Target + run: echo "EXTRA_RUST_FLAGS=--target x86_64-unknown-linux-gnu" >> "$GITHUB_ENV" + if: ${{ matrix.os == 'ubuntu-latest' }} + - name: Build Rust working-directory: src/Rust - run: cargo build --release ${{ env.rust_features }} + run: cargo build --release ${{ env.EXTRA_RUST_FLAGS }} - name: Test Rust working-directory: src/Rust - run: cargo llvm-cov ${{ env.rust_features }} --cobertura --output-path ../../test/coverage.rust.${{ matrix.os }}.xml + run: cargo llvm-cov ${{ env.EXTRA_RUST_FLAGS }} --cobertura --output-path ../../test/coverage.rust.${{ matrix.os }}.xml - name: Rename OSX Binary working-directory: src/Rust/target/release - run: cp update updatemac + run: cp update UpdateMac if: ${{ matrix.os == 'macos-latest' }} + - name: Rename Linux Binary + working-directory: src/Rust/target/release + run: cp update UpdateNix + if: ${{ matrix.os == 'ubuntu-latest' }} + - name: Build .NET run: dotnet build -c Release @@ -82,7 +90,8 @@ jobs: with: name: rust-${{ matrix.os }} path: | - src/Rust/target/release/updatemac + src/Rust/target/release/UpdateNix + src/Rust/target/release/UpdateMac src/Rust/target/release/*.exe - name: Upload Coverage to Codecov @@ -108,8 +117,7 @@ jobs: with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} - restore-keys: | - ${{ runner.os }}-nuget- + restore-keys: ${{ runner.os }}-nuget- - name: Download Rust Windows uses: actions/download-artifact@v4 @@ -123,6 +131,12 @@ jobs: name: rust-windows-latest path: src/Rust/target/release + - name: Download Rust Linux + uses: actions/download-artifact@v4 + with: + name: rust-ubuntu-latest + path: src/Rust/target/release + - name: Build .NET run: dotnet build -c Release /p:PackRustAssets=true diff --git a/src/Velopack.Vpk/Velopack.Vpk.csproj b/src/Velopack.Vpk/Velopack.Vpk.csproj index 0af29492..c66922c7 100644 --- a/src/Velopack.Vpk/Velopack.Vpk.csproj +++ b/src/Velopack.Vpk/Velopack.Vpk.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net6.0;net8.0 true vpk vpk @@ -37,10 +37,14 @@ - + + + + +