init dotnet9 branch #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET Framework Build | |
on: | |
push: | |
tags: | |
- '*' | |
branches-ignore: | |
- "dotnet6" | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
include: | |
- msbuild_target: x64 | |
lowercase_target: x64 | |
crossbuild_target: x86_x64 | |
- msbuild_target: x86 | |
lowercase_target: x86 | |
crossbuild_target: x86 | |
- msbuild_target: ARM64 | |
lowercase_target: arm64 | |
crossbuild_target: x86_arm64 | |
dotnet_version: [6.0, 7.0, 8.0, 9.0] | |
env: | |
TARGET_PLATFORM: ${{ matrix.msbuild_target }} | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Setup dotnet SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet_version }}.x | |
# Build libwebp | |
# mkdir libwebp\\${{ matrix.msbuild_target }}build | |
- name: Checkout libwebp | |
shell: cmd | |
run: | | |
git clone -b 1.4.0 https://github.com/webmproject/libwebp.git libwebp-140 | |
cd libwebp-140 | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.crossbuild_target }} | |
nmake /f Makefile.vc CFG=release-dynamic RTLIBCFG=dynamic ARCH=${{ matrix.lowercase_target }} OBJDIR=output | |
cp output/release-dynamic/${{ matrix.lowercase_target }}/bin/*.dll ../libwebp/${{ matrix.msbuild_target }}build/ | |
# Restore NuGet packages | |
- name: Restore NuGet packages | |
run: dotnet restore | |
# Build the solution | |
- name: Build | |
run: dotnet build mvlView.sln -c Release -f net${{ matrix.dotnet_version }}-windows7.0 /p:Platform="${{ matrix.lowercase_target }}" | |
# Publish the artifacts | |
- name: Publish Artifact | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MvlView_${{ matrix.lowercase_target }}_net${{ matrix.dotnet_version }} | |
path: mvlView/bin/${{ matrix.lowercase_target }}/Release/net${{ matrix.dotnet_version }}-windows7.0 | |
release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download from Github | |
uses: actions/download-artifact@v4 | |
with: | |
path: assets | |
- name: Re-zip artifacts | |
run: | | |
cd assets | |
for dir in */ ; do | |
zip -r "${dir%/}.zip" "$dir" | |
done | |
shell: bash | |
- name: Release to Github | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
assets/*.zip |