diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25f75b7..a99d369 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,21 +58,31 @@ jobs: if: contains(matrix.project, 'Plugin.Maui.OCR') run: dotnet workload install maui-android maui-ios maui-maccatalyst + - name: Determine Version + id: minver + run: | + dotnet tool install --global minver-cli + minver > version.txt + $version = Get-Content version.txt + echo "##vso[task.setvariable variable=PACKAGE_VERSION]$version" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Restore NuGet packages for Xamarin if: contains(matrix.project, 'Plugin.Xamarin.OCR') run: msbuild /t:Restore ${{ matrix.project }} -maxcpucount - name: Build Xamarin if: contains(matrix.project, 'Plugin.Xamarin.OCR') - run: msbuild /m /t:Build ${{ matrix.project }} /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:GeneratePackageOnBuild=true /p:OutputPath=${{ env.NuGetDirectory }} /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:RestorePackages=false -maxcpucount + run: msbuild /m /t:Build ${{ matrix.project }} /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:GeneratePackageOnBuild=true /p:PackageVersion=${{ env.PACKAGE_VERSION }} /p:OutputPath=${{ env.NuGetDirectory }} /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:RestorePackages=false -maxcpucount - name: Build MAUI if: contains(matrix.project, 'Plugin.Maui.OCR') - run: dotnet build ${{ matrix.project }} -c ${{ env.BUILD_CONFIGURATION }} + run: dotnet build ${{ matrix.project }} -c ${{ env.BUILD_CONFIGURATION }} -p:Version=${{ env.PACKAGE_VERSION }} - name: Pack MAUI NuGet Package if: contains(matrix.project, 'Plugin.Maui.OCR') - run: dotnet pack ${{ matrix.project }} --configuration ${{ env.BUILD_CONFIGURATION }} --output ${{ env.NuGetDirectory }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg + run: dotnet pack ${{ matrix.project }} --configuration ${{ env.BUILD_CONFIGURATION }} --output ${{ env.NuGetDirectory }} -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:Version=${{ env.PACKAGE_VERSION }} # Step to prepare the artifacts by copying *.nupkg and *.snpkg files to a temporary directory - name: Prepare Artifacts diff --git a/Directory.build.props b/Directory.build.props index df35cd4..48701b1 100644 --- a/Directory.build.props +++ b/Directory.build.props @@ -1,52 +1,46 @@ - - true - false - - - Copyright (c) Kori Francis - Kori Francis - Kori Francis - - true - https://github.com/kfrancis/ocr - git - en - - AnyCPU - $(AssemblyName) ($(TargetFramework)) - - $(NoWarn);1591;1701;1702;1705;VSX1000;NU1603 - - - $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - true - true - - MIT - false - - https://github.com/kfrancis/ocr - icon.png - - Plugin which provides the ability to perform OCR on an image using platform API. - true - true - - - - true - true - true - portable - - - - portable - true - - - - - + + true + false + minor + build + v + normal + + + Copyright (c) Kori Francis + Kori Francis + Kori Francis + true + https://github.com/kfrancis/ocr + git + en + AnyCPU + $(AssemblyName) ($(TargetFramework)) + $(NoWarn);1591;1701;1702;1705;VSX1000;NU1603 + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + true + true + MIT + false + https://github.com/kfrancis/ocr + icon.png + Plugin which provides the ability to perform OCR on an image using platform API. + true + true + + + true + true + true + portable + + + portable + true + + + + diff --git a/samples/Plugin.Maui.OCR.Sample.sln b/samples/Plugin.Maui.OCR.Sample.sln index 1707e9b..9925fda 100644 --- a/samples/Plugin.Maui.OCR.Sample.sln +++ b/samples/Plugin.Maui.OCR.Sample.sln @@ -11,7 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ..\.editorconfig = ..\.editorconfig ..\.gitattributes = ..\.gitattributes ..\.gitignore = ..\.gitignore - ..\.github\workflows\ci-sample.yml = ..\.github\workflows\ci-sample.yml ..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml ..\Directory.build.props = ..\Directory.build.props ..\Directory.build.targets = ..\Directory.build.targets diff --git a/src/Plugin.Maui.OCR/Plugin.Maui.OCR.csproj b/src/Plugin.Maui.OCR/Plugin.Maui.OCR.csproj index b9ad8eb..441dbd6 100644 --- a/src/Plugin.Maui.OCR/Plugin.Maui.OCR.csproj +++ b/src/Plugin.Maui.OCR/Plugin.Maui.OCR.csproj @@ -105,6 +105,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + all