mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
208 lines
7.1 KiB
YAML
208 lines
7.1 KiB
YAML
name: Build
|
|
|
|
on: [ push, pull_request ]
|
|
|
|
env:
|
|
VELOPACK_GITHUB_TEST_TOKEN: ${{ secrets.VELOPACK_GITHUB_TEST_TOKEN }}
|
|
VELOPACK_B2_TEST_TOKEN: ${{ secrets.VELOPACK_B2_TEST_TOKEN }}
|
|
|
|
jobs:
|
|
test-rust-bins:
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
include:
|
|
- os: windows-latest
|
|
rust_flags: "--target i686-pc-windows-msvc --features windows"
|
|
- os: ubuntu-latest
|
|
rust_flags: "--target x86_64-unknown-linux-gnu"
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: "rust-test-${{ matrix.os }}"
|
|
workspaces: "src/Rust -> target"
|
|
- name: Install cargo-llvm-cov
|
|
uses: taiki-e/install-action@cargo-llvm-cov
|
|
- name: Install NBGV
|
|
run: dotnet tool install -g nbgv
|
|
if: ${{ matrix.os == 'macos-latest' }}
|
|
continue-on-error: true
|
|
- name: Test Rust
|
|
working-directory: src/Rust
|
|
run: cargo llvm-cov ${{ matrix.rust_flags }} --cobertura --output-path ../../test/coverage.rust.${{ matrix.os }}.xml
|
|
- name: Upload Coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
with:
|
|
directory: ./test
|
|
fail_ci_if_error: true
|
|
|
|
build-rust-bins:
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
include:
|
|
- os: windows-latest
|
|
rust_flags: "--target i686-pc-windows-msvc --features windows"
|
|
- os: ubuntu-latest
|
|
rust_flags: "--target x86_64-unknown-linux-gnu"
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: "rust-build-${{ matrix.os }}"
|
|
workspaces: "src/Rust -> target"
|
|
- name: Install NBGV
|
|
run: dotnet tool install -g nbgv
|
|
if: ${{ matrix.os == 'macos-latest' }}
|
|
continue-on-error: true
|
|
- name: Build Rust
|
|
working-directory: src/Rust
|
|
run: cargo build --release ${{ matrix.rust_flags }}
|
|
- name: Collect Rust Binaries (Windows)
|
|
working-directory: src/Rust/target
|
|
run: |
|
|
copy i686-pc-windows-msvc\release\*.exe release
|
|
copy i686-pc-windows-msvc\release\*.pdb release
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
- name: Collect Rust Binaries (Linux)
|
|
working-directory: src/Rust/target
|
|
run: cp ./x86_64-unknown-linux-gnu/release/update ./release/UpdateNix
|
|
if: ${{ matrix.os == 'ubuntu-latest' }}
|
|
- name: Collect Rust Binaries (OSX)
|
|
working-directory: src/Rust/target/release
|
|
run: cp update UpdateMac
|
|
if: ${{ matrix.os == 'macos-latest' }}
|
|
- name: Upload Rust Build Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: rust-${{ matrix.os }}
|
|
path: |
|
|
src/Rust/target/release/UpdateNix
|
|
src/Rust/target/release/UpdateMac
|
|
src/Rust/target/release/*.exe
|
|
src/Rust/target/release/*.pdb
|
|
|
|
# build-dotnet:
|
|
# strategy:
|
|
# matrix:
|
|
# os: [macos-latest, windows-latest, ubuntu-latest]
|
|
# runs-on: ${{ matrix.os }}
|
|
# steps:
|
|
# - name: Print dotnet version
|
|
# run: dotnet --info
|
|
# - uses: actions/checkout@v4
|
|
# with:
|
|
# fetch-depth: 0
|
|
# - name: Build .NET
|
|
# run: dotnet build -c Release
|
|
# - name: Upload Dotnet Build Artifacts
|
|
# uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: dotnet-${{ matrix.os }}
|
|
# path: build/**
|
|
|
|
test-dotnet:
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
# needs: [build-rust-bins, build-dotnet]
|
|
needs: [build-rust-bins]
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: ${{ github.workspace }}/.nuget/packages
|
|
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-nuget-
|
|
- name: Install NBGV
|
|
run: dotnet tool install -g nbgv
|
|
if: ${{ matrix.os == 'macos-latest' }}
|
|
continue-on-error: true
|
|
- name: Install dotnet-coverage
|
|
run: dotnet tool install -g dotnet-coverage
|
|
- name: Download Rust Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: rust-${{ matrix.os }}
|
|
path: src/Rust/target/release
|
|
# - name: Download Dotnet Artifacts
|
|
# uses: actions/download-artifact@v4
|
|
# with:
|
|
# name: dotnet-${{ matrix.os }}
|
|
# path: build
|
|
- name: Build .NET
|
|
run: dotnet build -c Release
|
|
- name: Test .NET Velopack.Tests
|
|
run: dotnet test --no-build -c Release -l "console;verbosity=detailed" test/Velopack.Tests/Velopack.Tests.csproj
|
|
- name: Test .NET Velopack.Packaging.Tests
|
|
run: dotnet test --no-build -c Release -l "console;verbosity=detailed" test/Velopack.Packaging.Tests/Velopack.Packaging.Tests.csproj
|
|
- name: Test .NET Velopack.CommandLine.Tests
|
|
run: dotnet test --no-build -c Release -l "console;verbosity=detailed" test/Velopack.CommandLine.Tests/Velopack.CommandLine.Tests.csproj
|
|
- name: Upload Coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
with:
|
|
directory: ./test
|
|
fail_ci_if_error: true
|
|
|
|
# clean-artifacts:
|
|
# if: ${{ always() }}
|
|
# needs: [build-dotnet, test-dotnet]
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - name: Delete Dotnet Artifacts
|
|
# uses: geekyeggo/delete-artifact@v5
|
|
# with:
|
|
# name: dotnet-*
|
|
|
|
package:
|
|
runs-on: ubuntu-latest
|
|
needs: [build-rust-bins]
|
|
steps:
|
|
- name: Print dotnet version
|
|
run: dotnet --info
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Download Rust OSX
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: rust-macos-latest
|
|
path: src/Rust/target/release
|
|
- name: Download Rust Windows
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
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
|
|
- name: Upload Package Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: packages
|
|
path: build/Release/*.nupkg
|
|
|
|
# - name: Publish to GitHub Packages
|
|
# shell: pwsh
|
|
# run: dotnet nuget push build/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate |