Skip to content

Commit

Permalink
Merge PR #22 from parhamsaremi/new-with-zxing
Browse files Browse the repository at this point in the history
Embedded ZXing.Net.Maui lib and made it work with GTK.
  • Loading branch information
knocte authored May 25, 2023
2 parents 512ed6d + e57d304 commit bc8eb6b
Show file tree
Hide file tree
Showing 82 changed files with 3,904 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/build-gtk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
run: |
dotnet build src/Controls/src/SourceGen/Controls.SourceGen.csproj
dotnet build Microsoft.Maui.Gtk.slnf
- name: Build ZXing.Net.Maui
run: |
dotnet build ./src/ZXing.Net.Maui/ZXing.Net.MAUI/ZXing.Net.MAUI.csproj --framework=net6.0-gtk
dotnet build ./src/ZXing.Net.Maui/ZXing.Net.MAUI.Controls/ZXing.Net.MAUI.Controls.csproj --framework=net6.0-gtk
dotnet-format:
needs: build_and_test
Expand All @@ -50,6 +54,6 @@ jobs:

- name: Run dotnet format
run: |
dotnet format whitespace ./src --folder --exclude Templates/src
dotnet format whitespace ./src --folder --exclude Templates/src --exclude ZXing.Net.Maui
git diff --exit-code
76 changes: 76 additions & 0 deletions src/ZXing.Net.Maui/.github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: .NET Core

on:
pull_request:
push:
release:
types: [published]

jobs:
build:
name: Build
env:
NUPKG_MAJOR: 0.999
CODESIGN_PFX: ${{ secrets.CODESIGN_PFX }}
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.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
# - 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 "::set-output name=pkgverci::$VERSION"
echo "PACKAGE VERSION: $VERSION"
New-Item -ItemType Directory -Force -Path .\artifacts
dotnet pack --output ./artifacts --configuration Release -p:PackageVersion=$VERSION ./ZXing.Net.MAUI/ZXing.Net.MAUI.csproj
dotnet pack --output ./artifacts --configuration Release -p:PackageVersion=$VERSION ./ZXing.Net.MAUI.Controls/ZXing.Net.MAUI.Controls.csproj
dotnet pack --output ./artifacts --configuration Release -p:PackageVersion=$VERSION ./ZXing.Net.MAUI.Comet/ZXing.Net.MAUI.Comet.csproj
$pfxPath = Join-Path -Path $pwd -ChildPath "codesigncert.pfx"
[IO.File]::WriteAllBytes("$pfxPath", [System.Convert]::FromBase64String($env:CODESIGN_PFX))
nuget sign .\artifacts\*.nupkg -CertificatePath $pfxPath -Timestamper http://timestamp.entrust.net/TSS/RFC3161sha2TS
- name: Artifacts
uses: actions/upload-artifact@v1
with:
name: NuGet
path: ./artifacts

publish:
name: Publish
needs: build
runs-on: windows-latest
if: github.event_name == 'release'
steps:
- name: Download Artifacts
uses: actions/download-artifact@v1
with:
name: NuGet
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Push NuGet
run: |
dotnet nuget push NuGet\*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_API_KEY }}
Loading

0 comments on commit bc8eb6b

Please sign in to comment.