Upgraded to .NET 10 #162
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 build and test | |
| env: | |
| CURRENT_VERSION: 3.0.${{ github.run_number }} | |
| LAST_COMMIT_MESSAGE: ${{ github.event.head_commit.message }} | |
| PACKAGENAME: "com.codeuctivity.LockPDFy" | |
| DOTNET_NOLOGO: true # Disable the .NET logo | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry | |
| # @Forkers: add secrets in github SIGN_CERT, ANDROID_SIGN_CERT_PASSWORD use https://devblogs.microsoft.com/dotnet/devops-for-dotnet-maui/ | |
| on: | |
| push: | |
| paths-ignore: | |
| - '**/*.md' | |
| - '**/*.gitignore' | |
| - '**/*.gitattributes' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| # Parts got from https://github.com/irongut/MauiBeach/blob/master/.github/workflows/ci-build.yml | |
| # Create Base64 encoded version of keystore | |
| # certutil.exe -encode .\GooglePlayStore.keystore .\GooglePlayStore.keystore.base64 | |
| # drop the primer and end stuff | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-latest] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Restore MAUI workloads | |
| run: dotnet workload restore | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build .\LockPDFyGithubActionsFriendly.slnf --no-restore --configuration Release -p:Version=${{ env.CURRENT_VERSION }} | |
| - name: Build maui windows | |
| run: dotnet build .\LockPDFyMaui --configuration Release -f net10.0-windows10.0.19041.0 -p:Version=${{ env.CURRENT_VERSION }} | |
| - name: Test | |
| run: dotnet test .\LockPDFyGithubActionsFriendly.slnf --no-restore --no-build --verbosity normal --configuration Release | |
| - name: Build maui android | |
| env: | |
| ANDROID_SIGN_KEY: ${{ secrets.ANDROID_SIGN_KEY }} | |
| if: env.ANDROID_SIGN_KEY != '' | |
| run: dotnet publish LockPDFyMaui -f net10.0-android -c Release -p:Version=${{ env.CURRENT_VERSION }} -p:ApplicationId=$PACKAGENAME -p:AndroidKeyStore=true -p:AndroidSigningKeyStore=$PWD/myapp.keystore -p:AndroidSigningKeyAlias=myapp -p:AndroidSigningKeyPass=${{ secrets.ANDROID_SIGN_KEY }} -p:AndroidSigningStorePass=${{ secrets.ANDROID_SIGN_KEY }} | |
| - name: Github release | |
| shell: bash | |
| env: | |
| GITHUB_TOKEN: ${{ github.TOKEN }} | |
| if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release') && env.GITHUB_TOKEN != '' }} | |
| run: | | |
| gh release create ${{env.CURRENT_VERSION}} ./LockPDFyMaui/bin/Release/net10.0-android/publish/*.apk --generate-notes | |
| - name: Github prerelease | |
| shell: bash | |
| env: | |
| GITHUB_TOKEN: ${{ github.TOKEN }} | |
| if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release') == false && env.GITHUB_TOKEN != '' }} | |
| run: | | |
| gh release create ${{env.CURRENT_VERSION}} ./LockPDFyMaui/bin/Release/net10.0-android/publish/*.apk --prerelease --generate-notes |