Fix Android camera selection using index-based stable IDs #384
This file contains hidden or 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 Core | |
| on: | |
| pull_request: | |
| push: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| name: Build | |
| env: | |
| NUPKG_MAJOR: 0.999 | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Setup NuGet 5.x | |
| uses: nuget/setup-nuget@v1 | |
| with: | |
| nuget-version: '5.x' | |
| - name: Setup MAUI | |
| shell: pwsh | |
| run: | | |
| & dotnet workload install maui ios android maccatalyst | |
| - name: Build | |
| run: dotnet build --configuration Release --verbosity normal | |
| # - name: Test | |
| # run: dotnet test --configuration Release | |
| - name: Package NuGets | |
| shell: pwsh | |
| run: | | |
| $VERSION="$env:NUPKG_MAJOR-ci$env:GITHUB_RUN_ID" | |
| if ($env:GITHUB_EVENT_NAME -eq "release") { | |
| $VERSION = $env:GITHUB_REF.Substring($env:GITHUB_REF.LastIndexOf('/') + 1) | |
| } | |
| echo "PACKAGE VERSION: $VERSION" | |
| New-Item -ItemType Directory -Force -Path .\artifacts | |
| # Pack with --no-build since we already built, and add error handling | |
| Write-Host "Packing ZXing.Net.MAUI..." | |
| dotnet pack --output ./artifacts --configuration Release --no-build --verbosity normal -p:Version=$VERSION -p:PackageVersion=$VERSION ./ZXing.Net.MAUI/ZXing.Net.MAUI.csproj | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| Write-Host "Packing ZXing.Net.MAUI.Controls..." | |
| dotnet pack --output ./artifacts --configuration Release --no-build --verbosity normal -p:Version=$VERSION -p:PackageVersion=$VERSION ./ZXing.Net.MAUI.Controls/ZXing.Net.MAUI.Controls.csproj | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| - name: Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NuGet | |
| path: ./artifacts | |
| publish: | |
| name: Publish | |
| needs: build | |
| runs-on: windows-latest | |
| if: github.event_name == 'release' | |
| steps: | |
| - name: Download Artifacts | |
| id: download-artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: NuGet | |
| - name: Setup .NET Core | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Push NuGet | |
| run: | | |
| dotnet nuget push ${{ steps.download-artifacts.outputs.download-path }}\*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_API_KEY }} |