From c9d9485feaf36e3b15f24c0f3fb2ea348c3684bc Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 01:03:43 +0000 Subject: [PATCH 01/11] update pr workflow --- .github/workflows/pullrequest_windows.yml | 43 ++++++++++------------- Nuget.config | 8 +++++ 2 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 Nuget.config diff --git a/.github/workflows/pullrequest_windows.yml b/.github/workflows/pullrequest_windows.yml index 2bb53242..a531965c 100644 --- a/.github/workflows/pullrequest_windows.yml +++ b/.github/workflows/pullrequest_windows.yml @@ -15,44 +15,37 @@ jobs: build-windows: runs-on: windows-2022 name: Windows Build - steps: + steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Setup .NET 6 + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.* + include-prerelease: true + - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.1 with: vs-prerelease: true - msbuild-architecture: x64 - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.200-preview.22055.15 - include-prerelease: true - - - run: dotnet tool update -g dotnet-vs - - run: vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools - + - name: Install MAUI Workloads run: | dotnet workload install maui --ignore-failed-sources - dotnet workload install maui-desktop --ignore-failed-sources - dotnet workload install maui-mobile --ignore-failed-sources - dotnet workload install maui-windows --ignore-failed-sources - name: Restore Dependencies - run: dotnet restore TransactionMobile.Maui.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json + run: dotnet restore TransactionMobile.Maui.sln - name: Build Code - run: | - "C:/Program Files/Microsoft Visual Studio/2022/Preview/MSBuild/Current/Bin/MSBuild.exe TransactionMobile.Maui/TransactionMobile.Maui.csproj -r -p:Configuration=Release -p:RestorePackages=true -p:TargetFramework=net6.0-windows10.0.19041 /p:RestoreSources=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" + run: msbuild TransactionMobile.Maui/TransactionMobile.Maui.csproj -r -p:Configuration=Release -p:RestorePackages=true -p:TargetFramework=net6.0-windows10.0.19041 /p:GenerateAppxPackageOnBuild=true - name: Run Unit Tests run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj - - # #- name: Upload Windows Artifact - # # uses: actions/upload-artifact@v2.3.1 - # # with: - # # name: windows-ci-build - # # path: src/MauiBeach/bin/Release/net6.0-windows*/**/MauiBeach*.msix + + - name: Upload Windows Artifact + uses: actions/upload-artifact@v2.3.1 + with: + name: windows-ci-build + path: | + *.msix diff --git a/Nuget.config b/Nuget.config new file mode 100644 index 00000000..37d08ff0 --- /dev/null +++ b/Nuget.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From 9e2f20f79ab041f6ce46b7e3c447ab38b3544541 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 01:05:23 +0000 Subject: [PATCH 02/11] :| --- .github/workflows/pullrequest_windows.yml | 2 +- TransactionMobile.Maui.sln | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pullrequest_windows.yml b/.github/workflows/pullrequest_windows.yml index a531965c..78d11b2d 100644 --- a/.github/workflows/pullrequest_windows.yml +++ b/.github/workflows/pullrequest_windows.yml @@ -15,7 +15,7 @@ jobs: build-windows: runs-on: windows-2022 name: Windows Build - steps: + steps: - name: Checkout uses: actions/checkout@v3 diff --git a/TransactionMobile.Maui.sln b/TransactionMobile.Maui.sln index d4c164e4..456c08b5 100644 --- a/TransactionMobile.Maui.sln +++ b/TransactionMobile.Maui.sln @@ -13,7 +13,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransactionMobile.Maui.Busi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransactionMobile.Maui.BusinessLogic", "TransactionMobile.Maui.BusinessLogic\TransactionMobile.Maui.BusinessLogic.csproj", "{902D54CF-CD5F-4932-B1DC-01A3937AC054}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TransactionMobile.Maui.Database", "TransactionMobile.Maui.Database\TransactionMobile.Maui.Database.csproj", "{692DD081-BA36-4289-9A81-96C9F604E864}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransactionMobile.Maui.Database", "TransactionMobile.Maui.Database\TransactionMobile.Maui.Database.csproj", "{692DD081-BA36-4289-9A81-96C9F604E864}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{354A147A-375C-4002-9019-215F84AC389C}" + ProjectSection(SolutionItems) = preProject + Nuget.config = Nuget.config + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From 7653cf4a031abe023af4912687511168d2e0da86 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 07:34:37 +0000 Subject: [PATCH 03/11] .. --- .github/workflows/pullrequest_windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pullrequest_windows.yml b/.github/workflows/pullrequest_windows.yml index 78d11b2d..4c75caa7 100644 --- a/.github/workflows/pullrequest_windows.yml +++ b/.github/workflows/pullrequest_windows.yml @@ -38,7 +38,7 @@ jobs: run: dotnet restore TransactionMobile.Maui.sln - name: Build Code - run: msbuild TransactionMobile.Maui/TransactionMobile.Maui.csproj -r -p:Configuration=Release -p:RestorePackages=true -p:TargetFramework=net6.0-windows10.0.19041 /p:GenerateAppxPackageOnBuild=true + run: msbuild TransactionMobile.Maui/TransactionMobile.Maui.csproj -r -p:Configuration=Release -p:RestorePackages=false -p:TargetFramework=net6.0-windows10.0.19041 /p:GenerateAppxPackageOnBuild=true - name: Run Unit Tests run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj From 7ce313d3f283bb1ff14af17270d1caab21801032 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 07:43:25 +0000 Subject: [PATCH 04/11] :| --- .../Database/DatabaseContext.cs | 88 +++++++++++++++++++ .../Database/IDatabaseContext.cs | 28 ++++++ .../Database/LogMessage.cs | 76 ++++++++++++++++ .../Database/TransactionRecord.cs | 42 +++++++++ ...ransactionMobile.Maui.BusinessLogic.csproj | 11 +-- 5 files changed, 240 insertions(+), 5 deletions(-) create mode 100644 TransactionMobile.Maui.BusinessLogic/Database/DatabaseContext.cs create mode 100644 TransactionMobile.Maui.BusinessLogic/Database/IDatabaseContext.cs create mode 100644 TransactionMobile.Maui.BusinessLogic/Database/LogMessage.cs create mode 100644 TransactionMobile.Maui.BusinessLogic/Database/TransactionRecord.cs diff --git a/TransactionMobile.Maui.BusinessLogic/Database/DatabaseContext.cs b/TransactionMobile.Maui.BusinessLogic/Database/DatabaseContext.cs new file mode 100644 index 00000000..52bb35ad --- /dev/null +++ b/TransactionMobile.Maui.BusinessLogic/Database/DatabaseContext.cs @@ -0,0 +1,88 @@ +namespace TransactionMobile.Maui.Database +{ + using SQLite; + + public class DatabaseContext : IDatabaseContext + { + private readonly SQLiteConnection Connection; + + private readonly Func LogLevelResolver; + + public DatabaseContext(String connectionString, Func logLevelResolver) + { + this.Connection = new SQLiteConnection(connectionString); + this.LogLevelResolver = logLevelResolver; + } + + public async Task InitialiseDatabase() + { + this.Connection.CreateTable(); + this.Connection.CreateTable(); + } + + public async Task CreateTransaction(TransactionRecord transactionRecord) + { + this.Connection.Insert(transactionRecord); + + return SQLite3.LastInsertRowid(this.Connection.Handle); + } + + public async Task UpdateTransaction(TransactionRecord transactionRecord) + { + this.Connection.Update(transactionRecord); + } + + public async Task> GetTransactions() + { + return this.Connection.Table().ToList(); + } + + public async Task ClearStoredTransactions(List transactionRecords) + { + foreach (var transactionRecord in transactionRecords) + { + this.Connection.Delete(transactionRecord.TransactionNumber); + } + } + + public async Task> GetLogMessages(int batchSize) + { + if (this.Connection == null) + return new List(); + + List messages = this.Connection.Table().OrderBy(l => l.EntryDateTime).Take(batchSize).ToList(); + + return messages; + } + + public async Task InsertLogMessage(LogMessage logMessage) + { + if (this.Connection == null) + return; + + LogLevel messageLevel = (LogLevel)Enum.Parse(typeof(LogLevel), logMessage.LogLevel, true); + if (messageLevel <= this.LogLevelResolver()) + { + this.Connection.Insert(logMessage); + } + } + + public async Task InsertLogMessages(List logMessages) + { + foreach (LogMessage logMessage in logMessages) + { + await this.InsertLogMessage(logMessage); + } + } + + public async Task RemoveUploadedMessages(List logMessagesToRemove) + { + if (this.Connection == null) + return; + foreach (LogMessage logMessage in logMessagesToRemove) + { + this.Connection.Delete(logMessage); + } + } + } +} diff --git a/TransactionMobile.Maui.BusinessLogic/Database/IDatabaseContext.cs b/TransactionMobile.Maui.BusinessLogic/Database/IDatabaseContext.cs new file mode 100644 index 00000000..7800d2ca --- /dev/null +++ b/TransactionMobile.Maui.BusinessLogic/Database/IDatabaseContext.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TransactionMobile.Maui.Database +{ + public interface IDatabaseContext + { + Task InitialiseDatabase(); + + Task CreateTransaction(TransactionRecord transactionRecord); + + Task UpdateTransaction(TransactionRecord transactionRecord); + + Task> GetTransactions(); + Task ClearStoredTransactions(List transactionRecords); + + Task> GetLogMessages(Int32 batchSize); + + Task InsertLogMessage(LogMessage logMessage); + + Task InsertLogMessages(List logMessages); + + Task RemoveUploadedMessages(List logMessagesToRemove); + } +} diff --git a/TransactionMobile.Maui.BusinessLogic/Database/LogMessage.cs b/TransactionMobile.Maui.BusinessLogic/Database/LogMessage.cs new file mode 100644 index 00000000..8549e23f --- /dev/null +++ b/TransactionMobile.Maui.BusinessLogic/Database/LogMessage.cs @@ -0,0 +1,76 @@ +namespace TransactionMobile.Maui.Database +{ + using SQLite; + public class LogMessage + { + #region Properties + + /// + /// Gets or sets the entry date time. + /// + /// + /// The entry date time. + /// + public DateTime EntryDateTime { get; set; } + + /// + /// Gets or sets the identifier. + /// + /// + /// The identifier. + /// + [PrimaryKey, AutoIncrement] + public Int32 Id { get; set; } + + /// + /// Gets or sets the log level. + /// + /// + /// The log level. + /// + public String LogLevel { get; set; } + + /// + /// Gets or sets the message. + /// + /// + /// The message. + /// + public String Message { get; set; } + + #endregion + } + + public enum LogLevel + { + /// + /// The fatal + /// + Fatal, + + /// + /// The error + /// + Error, + + /// + /// The warn + /// + Warn, + + /// + /// The information + /// + Info, + + /// + /// The debug + /// + Debug, + + /// + /// The trace + /// + Trace + } +} diff --git a/TransactionMobile.Maui.BusinessLogic/Database/TransactionRecord.cs b/TransactionMobile.Maui.BusinessLogic/Database/TransactionRecord.cs new file mode 100644 index 00000000..3b45c5cd --- /dev/null +++ b/TransactionMobile.Maui.BusinessLogic/Database/TransactionRecord.cs @@ -0,0 +1,42 @@ +namespace TransactionMobile.Maui.Database +{ + using SQLite; + + public class TransactionRecord + { + public String ApplicationVersion { get; set; } + + public Guid ContractId { get; set; } + + public String CustomerAccountNumber { get; set; } + + public String CustomerEmailAddress { get; set; } + + public String DeviceIdentifier { get; set; } + + public String OperatorIdentifier { get; set; } + + public Guid ProductId { get; set; } + + public Decimal Amount { get; set; } + + public DateTime TransactionDateTime { get; set; } + + [PrimaryKey, AutoIncrement] + public Int32 TransactionNumber { get; set; } + + public String RecipientMobileNumber { get; set; } + public String RecipientEmailAddress { get; set; } + + public Int32 TransactionType { get; set; } + + public Guid EstateId { get; set; } + public Guid MerchantId { get; set; } + public Boolean IsSuccessful { get; set; } + + public String ResponseMessage { get; set; } + + public Boolean IsTrainingMode { get; set; } + + } +} diff --git a/TransactionMobile.Maui.BusinessLogic/TransactionMobile.Maui.BusinessLogic.csproj b/TransactionMobile.Maui.BusinessLogic/TransactionMobile.Maui.BusinessLogic.csproj index 7c2fc753..eafdbbfd 100644 --- a/TransactionMobile.Maui.BusinessLogic/TransactionMobile.Maui.BusinessLogic.csproj +++ b/TransactionMobile.Maui.BusinessLogic/TransactionMobile.Maui.BusinessLogic.csproj @@ -1,4 +1,4 @@ - + net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst @@ -23,9 +23,10 @@ - - - - + + + + + From 20c4b0d9cd5432f144b8f3d848288cfa14c0a4e0 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 07:51:41 +0000 Subject: [PATCH 05/11] ... --- .github/workflows/pullrequest_windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pullrequest_windows.yml b/.github/workflows/pullrequest_windows.yml index 4c75caa7..81a4b7e4 100644 --- a/.github/workflows/pullrequest_windows.yml +++ b/.github/workflows/pullrequest_windows.yml @@ -48,4 +48,4 @@ jobs: with: name: windows-ci-build path: | - *.msix + TransactionMobile.Maui/bin/Release/net6.0-windows*/**/TransactionMobile.Maui*.msix From c9f6cd1db0b34d7ffec6654a01f806548e06043c Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 07:58:52 +0000 Subject: [PATCH 06/11] ios --- .github/workflows/createrelease_android.yml | 60 ------------------- .github/workflows/createrelease_ios.yml | 51 ---------------- .../workflows/createrelease_maccatalyst.yml | 54 ----------------- .github/workflows/createrelease_windows.yml | 50 ---------------- .github/workflows/pullrequest_ios.yml | 26 ++++---- 5 files changed, 10 insertions(+), 231 deletions(-) delete mode 100644 .github/workflows/createrelease_android.yml delete mode 100644 .github/workflows/createrelease_ios.yml delete mode 100644 .github/workflows/createrelease_maccatalyst.yml delete mode 100644 .github/workflows/createrelease_windows.yml diff --git a/.github/workflows/createrelease_android.yml b/.github/workflows/createrelease_android.yml deleted file mode 100644 index c05ccf72..00000000 --- a/.github/workflows/createrelease_android.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Release - Android - -on: - release: - types: [published] - -env: - 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 - -jobs: - # MAUI Android Build - release-android: - runs-on: windows-2022 - name: Android Release - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.1 - with: - vs-prerelease: true - msbuild-architecture: x64 - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.200-preview.22055.15 - include-prerelease: true - - - uses: actions/setup-java@v2 - with: - distribution: 'microsoft' - java-version: '11' - - - name: Install MAUI Workloads - run: | - dotnet workload install maui --ignore-failed-sources - dotnet workload install maui-android --ignore-failed-sources - dotnet workload install maui-desktop --ignore-failed-sources - dotnet workload install maui-ios --ignore-failed-sources - dotnet workload install maui-mobile --ignore-failed-sources - dotnet workload install maui-windows --ignore-failed-sources - - - name: Restore Dependencies - run: dotnet restore TransactionMobile.Maui.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json - - - name: Build Code - run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net6.0-android --no-restore - - - name: Run Unit Tests - run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj - - - name: Upload Android Artifact - uses: actions/upload-artifact@v2.3.1 - with: - name: android-ci-build - path: TransactionMobile.Maui/bin/Release/net6.0-android/*Signed.a* diff --git a/.github/workflows/createrelease_ios.yml b/.github/workflows/createrelease_ios.yml deleted file mode 100644 index d961618b..00000000 --- a/.github/workflows/createrelease_ios.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Release - iOS - -on: - release: - types: [published] - -env: - 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 - -jobs: -# MAUI iOS Build - release-ios: - runs-on: macos-11 - name: iOS Release - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.200-preview.22055.15 - include-prerelease: true - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - include-prerelease: true - - - name: Install MAUI Workloads - run: | - dotnet workload install ios --ignore-failed-sources - dotnet workload install maui --ignore-failed-sources - - - name: Restore Dependencies - run: dotnet restore TransactionMobile.Maui.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json - - - name: Build Code - run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net6.0-ios --no-restore - - - name: Run Unit Tests - run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj - - - name: Upload iOS Artifact - uses: actions/upload-artifact@v2.3.1 - with: - name: ios-ci-build - path: TransactionMobile.Maui/bin/Release/net6.0-ios/**/*.app/ diff --git a/.github/workflows/createrelease_maccatalyst.yml b/.github/workflows/createrelease_maccatalyst.yml deleted file mode 100644 index 3a914272..00000000 --- a/.github/workflows/createrelease_maccatalyst.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Release - MacCatalyst - -on: - release: - types: [published] - -env: - 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 - -jobs: - # MAUI MacCatalyst Build - release-mac: - runs-on: macos-11 - name: MacCatalyst Release - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.200-preview.22055.15 - include-prerelease: true - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - include-prerelease: true - - #- run: dotnet tool update -g dotnet-vs - - - name: Install MAUI Workloads - run: | - dotnet workload install maccatalyst --ignore-failed-sources - dotnet workload install maui --ignore-failed-sources - - - name: Restore Dependencies - run: dotnet restore TransactionMobile.Maui.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json - - - name: Build Code - run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net6.0-maccatalyst --no-restore - - - name: Run Unit Tests - run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj - - - name: Upload MacCatalyst Artifact - uses: actions/upload-artifact@v2.3.1 - with: - name: macos-ci-build - path: TransactionMobile.Maui/bin/Release/net6.0-maccatalyst/**/*.app/ - diff --git a/.github/workflows/createrelease_windows.yml b/.github/workflows/createrelease_windows.yml deleted file mode 100644 index f12cb27f..00000000 --- a/.github/workflows/createrelease_windows.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Release - Windows - -on: - release: - types: [published] - -env: - 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 - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - -jobs: - release-windows: - runs-on: windows-2022 - name: Windows Release - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v2 - with: - dotnet-version: 6.0.* - include-prerelease: true - - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v1.1 - with: - vs-prerelease: true - - - name: Install MAUI Workloads - run: | - dotnet workload install maui --ignore-failed-sources - - - name: Restore Dependencies - run: dotnet restore TransactionMobile.Maui.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json - - - name: Build Code - run: msbuild TransactionMobile.Maui/TransactionMobile.Maui.csproj -r -p:Configuration=Release -p:RestorePackages=true -p:TargetFramework=net6.0-windows10.0.19041 /p:GenerateAppxPackageOnBuild=true /p:RestoreSources=https://api.nuget.org/v3/index.json /p:RestoreSources=https://www.myget.org/F/transactionprocessing/api/v3/index.json /p:RestoreSources=https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json - - - name: Run Unit Tests - run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj - - - name: Upload Windows Artifact - uses: actions/upload-artifact@v2.3.1 - with: - name: windows-ci-build - path: | - *.msix diff --git a/.github/workflows/pullrequest_ios.yml b/.github/workflows/pullrequest_ios.yml index b1b19c6e..5bcaf61d 100644 --- a/.github/workflows/pullrequest_ios.yml +++ b/.github/workflows/pullrequest_ios.yml @@ -17,19 +17,13 @@ jobs: name: iOS Build steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v2 with: - dotnet-version: 6.0.200-preview.22055.15 - include-prerelease: true - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - include-prerelease: true + dotnet-version: 6.0.* + include-prerelease: true - name: Install MAUI Workloads run: | @@ -37,7 +31,7 @@ jobs: dotnet workload install maui --ignore-failed-sources - name: Restore Dependencies - run: dotnet restore TransactionMobile.Maui.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json + run: dotnet restore TransactionMobile.Maui.sln - name: Build Code run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net6.0-ios --no-restore @@ -45,8 +39,8 @@ jobs: - name: Run Unit Tests run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj -# #- name: Upload iOS Artifact -# # uses: actions/upload-artifact@v2.3.1 -# # with: -# # name: ios-ci-build -# # path: src/MauiBeach/bin/Release/net6.0-ios/**/*.app/ + - name: Upload iOS Artifact + uses: actions/upload-artifact@v2.3.1 + with: + name: ios-ci-build + path: src/TransactionMobile.Maui/bin/Release/net6.0-ios/**/*.app/ From 8569e1cf4a04f03ec5f81c4878ee07030209bd17 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 08:05:03 +0000 Subject: [PATCH 07/11] ... --- .../DatabaseContext.cs | 88 ------------------- .../IDatabaseContext.cs | 28 ------ TransactionMobile.Maui.Database/LogMessage.cs | 76 ---------------- .../TransactionMobile.Maui.Database.csproj | 17 ---- .../TransactionRecord.cs | 42 --------- TransactionMobile.Maui.sln | 7 -- 6 files changed, 258 deletions(-) delete mode 100644 TransactionMobile.Maui.Database/DatabaseContext.cs delete mode 100644 TransactionMobile.Maui.Database/IDatabaseContext.cs delete mode 100644 TransactionMobile.Maui.Database/LogMessage.cs delete mode 100644 TransactionMobile.Maui.Database/TransactionMobile.Maui.Database.csproj delete mode 100644 TransactionMobile.Maui.Database/TransactionRecord.cs diff --git a/TransactionMobile.Maui.Database/DatabaseContext.cs b/TransactionMobile.Maui.Database/DatabaseContext.cs deleted file mode 100644 index 52bb35ad..00000000 --- a/TransactionMobile.Maui.Database/DatabaseContext.cs +++ /dev/null @@ -1,88 +0,0 @@ -namespace TransactionMobile.Maui.Database -{ - using SQLite; - - public class DatabaseContext : IDatabaseContext - { - private readonly SQLiteConnection Connection; - - private readonly Func LogLevelResolver; - - public DatabaseContext(String connectionString, Func logLevelResolver) - { - this.Connection = new SQLiteConnection(connectionString); - this.LogLevelResolver = logLevelResolver; - } - - public async Task InitialiseDatabase() - { - this.Connection.CreateTable(); - this.Connection.CreateTable(); - } - - public async Task CreateTransaction(TransactionRecord transactionRecord) - { - this.Connection.Insert(transactionRecord); - - return SQLite3.LastInsertRowid(this.Connection.Handle); - } - - public async Task UpdateTransaction(TransactionRecord transactionRecord) - { - this.Connection.Update(transactionRecord); - } - - public async Task> GetTransactions() - { - return this.Connection.Table().ToList(); - } - - public async Task ClearStoredTransactions(List transactionRecords) - { - foreach (var transactionRecord in transactionRecords) - { - this.Connection.Delete(transactionRecord.TransactionNumber); - } - } - - public async Task> GetLogMessages(int batchSize) - { - if (this.Connection == null) - return new List(); - - List messages = this.Connection.Table().OrderBy(l => l.EntryDateTime).Take(batchSize).ToList(); - - return messages; - } - - public async Task InsertLogMessage(LogMessage logMessage) - { - if (this.Connection == null) - return; - - LogLevel messageLevel = (LogLevel)Enum.Parse(typeof(LogLevel), logMessage.LogLevel, true); - if (messageLevel <= this.LogLevelResolver()) - { - this.Connection.Insert(logMessage); - } - } - - public async Task InsertLogMessages(List logMessages) - { - foreach (LogMessage logMessage in logMessages) - { - await this.InsertLogMessage(logMessage); - } - } - - public async Task RemoveUploadedMessages(List logMessagesToRemove) - { - if (this.Connection == null) - return; - foreach (LogMessage logMessage in logMessagesToRemove) - { - this.Connection.Delete(logMessage); - } - } - } -} diff --git a/TransactionMobile.Maui.Database/IDatabaseContext.cs b/TransactionMobile.Maui.Database/IDatabaseContext.cs deleted file mode 100644 index 7800d2ca..00000000 --- a/TransactionMobile.Maui.Database/IDatabaseContext.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace TransactionMobile.Maui.Database -{ - public interface IDatabaseContext - { - Task InitialiseDatabase(); - - Task CreateTransaction(TransactionRecord transactionRecord); - - Task UpdateTransaction(TransactionRecord transactionRecord); - - Task> GetTransactions(); - Task ClearStoredTransactions(List transactionRecords); - - Task> GetLogMessages(Int32 batchSize); - - Task InsertLogMessage(LogMessage logMessage); - - Task InsertLogMessages(List logMessages); - - Task RemoveUploadedMessages(List logMessagesToRemove); - } -} diff --git a/TransactionMobile.Maui.Database/LogMessage.cs b/TransactionMobile.Maui.Database/LogMessage.cs deleted file mode 100644 index 8549e23f..00000000 --- a/TransactionMobile.Maui.Database/LogMessage.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace TransactionMobile.Maui.Database -{ - using SQLite; - public class LogMessage - { - #region Properties - - /// - /// Gets or sets the entry date time. - /// - /// - /// The entry date time. - /// - public DateTime EntryDateTime { get; set; } - - /// - /// Gets or sets the identifier. - /// - /// - /// The identifier. - /// - [PrimaryKey, AutoIncrement] - public Int32 Id { get; set; } - - /// - /// Gets or sets the log level. - /// - /// - /// The log level. - /// - public String LogLevel { get; set; } - - /// - /// Gets or sets the message. - /// - /// - /// The message. - /// - public String Message { get; set; } - - #endregion - } - - public enum LogLevel - { - /// - /// The fatal - /// - Fatal, - - /// - /// The error - /// - Error, - - /// - /// The warn - /// - Warn, - - /// - /// The information - /// - Info, - - /// - /// The debug - /// - Debug, - - /// - /// The trace - /// - Trace - } -} diff --git a/TransactionMobile.Maui.Database/TransactionMobile.Maui.Database.csproj b/TransactionMobile.Maui.Database/TransactionMobile.Maui.Database.csproj deleted file mode 100644 index 1003f9ad..00000000 --- a/TransactionMobile.Maui.Database/TransactionMobile.Maui.Database.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/TransactionMobile.Maui.Database/TransactionRecord.cs b/TransactionMobile.Maui.Database/TransactionRecord.cs deleted file mode 100644 index 3b45c5cd..00000000 --- a/TransactionMobile.Maui.Database/TransactionRecord.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace TransactionMobile.Maui.Database -{ - using SQLite; - - public class TransactionRecord - { - public String ApplicationVersion { get; set; } - - public Guid ContractId { get; set; } - - public String CustomerAccountNumber { get; set; } - - public String CustomerEmailAddress { get; set; } - - public String DeviceIdentifier { get; set; } - - public String OperatorIdentifier { get; set; } - - public Guid ProductId { get; set; } - - public Decimal Amount { get; set; } - - public DateTime TransactionDateTime { get; set; } - - [PrimaryKey, AutoIncrement] - public Int32 TransactionNumber { get; set; } - - public String RecipientMobileNumber { get; set; } - public String RecipientEmailAddress { get; set; } - - public Int32 TransactionType { get; set; } - - public Guid EstateId { get; set; } - public Guid MerchantId { get; set; } - public Boolean IsSuccessful { get; set; } - - public String ResponseMessage { get; set; } - - public Boolean IsTrainingMode { get; set; } - - } -} diff --git a/TransactionMobile.Maui.sln b/TransactionMobile.Maui.sln index 456c08b5..5a1818ea 100644 --- a/TransactionMobile.Maui.sln +++ b/TransactionMobile.Maui.sln @@ -13,8 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransactionMobile.Maui.Busi EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransactionMobile.Maui.BusinessLogic", "TransactionMobile.Maui.BusinessLogic\TransactionMobile.Maui.BusinessLogic.csproj", "{902D54CF-CD5F-4932-B1DC-01A3937AC054}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TransactionMobile.Maui.Database", "TransactionMobile.Maui.Database\TransactionMobile.Maui.Database.csproj", "{692DD081-BA36-4289-9A81-96C9F604E864}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{354A147A-375C-4002-9019-215F84AC389C}" ProjectSection(SolutionItems) = preProject Nuget.config = Nuget.config @@ -40,10 +38,6 @@ Global {902D54CF-CD5F-4932-B1DC-01A3937AC054}.Debug|Any CPU.Build.0 = Debug|Any CPU {902D54CF-CD5F-4932-B1DC-01A3937AC054}.Release|Any CPU.ActiveCfg = Release|Any CPU {902D54CF-CD5F-4932-B1DC-01A3937AC054}.Release|Any CPU.Build.0 = Release|Any CPU - {692DD081-BA36-4289-9A81-96C9F604E864}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {692DD081-BA36-4289-9A81-96C9F604E864}.Debug|Any CPU.Build.0 = Debug|Any CPU - {692DD081-BA36-4289-9A81-96C9F604E864}.Release|Any CPU.ActiveCfg = Release|Any CPU - {692DD081-BA36-4289-9A81-96C9F604E864}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -52,7 +46,6 @@ Global {73668181-7A26-435D-83E3-CF141AC8FD0B} = {1CBEF4C1-7D90-4A78-AA55-D81F1447A70E} {0894F054-5C4D-4DDD-A8E9-636416189234} = {AB312EE3-CBA4-469A-8694-67C5466298C5} {902D54CF-CD5F-4932-B1DC-01A3937AC054} = {1CBEF4C1-7D90-4A78-AA55-D81F1447A70E} - {692DD081-BA36-4289-9A81-96C9F604E864} = {1CBEF4C1-7D90-4A78-AA55-D81F1447A70E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} From f4056564114a717d20f0dedd14b32e684dcd4d90 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 08:40:27 +0000 Subject: [PATCH 08/11] pr updates --- .github/workflows/pullrequest_android.yml | 16 ++++++---------- .github/workflows/pullrequest_ios.yml | 12 ++++++------ .github/workflows/pullrequest_maccatalyst.yml | 16 ++++------------ .github/workflows/pullrequest_windows.yml | 2 +- 4 files changed, 17 insertions(+), 29 deletions(-) diff --git a/.github/workflows/pullrequest_android.yml b/.github/workflows/pullrequest_android.yml index d9b97781..f5185673 100644 --- a/.github/workflows/pullrequest_android.yml +++ b/.github/workflows/pullrequest_android.yml @@ -1,4 +1,4 @@ -name: Build & Test Pull Requests +name: Build & Test Pull Requests - Android on: pull_request: @@ -17,7 +17,7 @@ jobs: name: Android Build steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.1 @@ -26,9 +26,9 @@ jobs: msbuild-architecture: x64 - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v2 with: - dotnet-version: 6.0.200-preview.22055.15 + dotnet-version: 6.0.* include-prerelease: true - uses: actions/setup-java@v2 @@ -38,12 +38,8 @@ jobs: - name: Install MAUI Workloads run: | - dotnet workload install maui --ignore-failed-sources - dotnet workload install maui-android --ignore-failed-sources - dotnet workload install maui-desktop --ignore-failed-sources - dotnet workload install maui-ios --ignore-failed-sources - dotnet workload install maui-mobile --ignore-failed-sources - dotnet workload install maui-windows --ignore-failed-sources + dotnet workload install android --ignore-failed-sources + dotnet workload install maui --ignore-failed-sources - name: Restore Dependencies run: dotnet restore TransactionMobile.Maui.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json diff --git a/.github/workflows/pullrequest_ios.yml b/.github/workflows/pullrequest_ios.yml index 5bcaf61d..3db5c786 100644 --- a/.github/workflows/pullrequest_ios.yml +++ b/.github/workflows/pullrequest_ios.yml @@ -1,4 +1,4 @@ -name: Build & Test Pull Requests +name: Build & Test Pull Requests - iOS on: pull_request: @@ -39,8 +39,8 @@ jobs: - name: Run Unit Tests run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj - - name: Upload iOS Artifact - uses: actions/upload-artifact@v2.3.1 - with: - name: ios-ci-build - path: src/TransactionMobile.Maui/bin/Release/net6.0-ios/**/*.app/ + #- name: Upload iOS Artifact + # uses: actions/upload-artifact@v2.3.1 + # with: + # name: ios-ci-build + # path: src/TransactionMobile.Maui/bin/Release/net6.0-ios/**/*.app/ diff --git a/.github/workflows/pullrequest_maccatalyst.yml b/.github/workflows/pullrequest_maccatalyst.yml index 376c565d..1c034769 100644 --- a/.github/workflows/pullrequest_maccatalyst.yml +++ b/.github/workflows/pullrequest_maccatalyst.yml @@ -1,4 +1,4 @@ -name: Build & Test Pull Requests +name: Build & Test Pull Requests - MacCatalyst on: pull_request: @@ -17,29 +17,21 @@ jobs: name: MacCatalyst Build steps: - name: Checkout - uses: actions/checkout@v2 - - - name: Setup .NET 6 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.200-preview.22055.15 - include-prerelease: true + uses: actions/checkout@v3 - name: Setup .NET 6 uses: actions/setup-dotnet@v1 with: dotnet-version: 6.0.x include-prerelease: true - - #- run: dotnet tool update -g dotnet-vs - + - name: Install MAUI Workloads run: | dotnet workload install maccatalyst --ignore-failed-sources dotnet workload install maui --ignore-failed-sources - name: Restore Dependencies - run: dotnet restore TransactionMobile.Maui.sln --source https://api.nuget.org/v3/index.json --source https://www.myget.org/F/transactionprocessing/api/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json + run: dotnet restore TransactionMobile.Maui.sln - name: Build Code run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net6.0-maccatalyst --no-restore diff --git a/.github/workflows/pullrequest_windows.yml b/.github/workflows/pullrequest_windows.yml index 81a4b7e4..f17ddcb5 100644 --- a/.github/workflows/pullrequest_windows.yml +++ b/.github/workflows/pullrequest_windows.yml @@ -1,4 +1,4 @@ -name: Build & Test Pull Requests +name: Build & Test Pull Requests - Windows on: pull_request: From 5fa3ecc68d7bb79ef8224626404f3500f67c83d5 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 10:09:38 +0000 Subject: [PATCH 09/11] .. --- TransactionMobile.Maui/TransactionMobile.Maui.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TransactionMobile.Maui/TransactionMobile.Maui.csproj b/TransactionMobile.Maui/TransactionMobile.Maui.csproj index 9b36d9af..c9047353 100644 --- a/TransactionMobile.Maui/TransactionMobile.Maui.csproj +++ b/TransactionMobile.Maui/TransactionMobile.Maui.csproj @@ -192,7 +192,7 @@ false - ios-arm64 + true From 2da781cedff36332cdda2783728d0175b798c70a Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 10:33:53 +0000 Subject: [PATCH 10/11] added release worflow --- .github/workflows/createrelease.yml | 179 ++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 .github/workflows/createrelease.yml diff --git a/.github/workflows/createrelease.yml b/.github/workflows/createrelease.yml new file mode 100644 index 00000000..021c490b --- /dev/null +++ b/.github/workflows/createrelease.yml @@ -0,0 +1,179 @@ +name: Release + +on: + release: + types: [published] + +env: + 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 + +jobs: + release_android: + runs-on: windows-2022 + name: "Android Release" + env: + ASPNETCORE_ENVIRONMENT: "Production" + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.1 + with: + vs-prerelease: true + msbuild-architecture: x64 + + - name: Setup .NET 6 + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.* + include-prerelease: true + + - uses: actions/setup-java@v2 + with: + distribution: 'microsoft' + java-version: '11' + + - name: Install MAUI Workloads + run: | + dotnet workload install android --ignore-failed-sources + dotnet workload install maui --ignore-failed-sources + + - name: Restore Dependencies + run: dotnet restore TransactionMobile.Maui.sln + + - name: Build Code + run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net6.0-android --no-restore + + - name: Run Unit Tests + run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj + + - name: Upload Android Artifact + uses: actions/upload-artifact@v2.3.1 + with: + name: android-ci-build + path: TransactionMobile.Maui/bin/Release/net6.0-android/*Signed.a* + + release_windows: + runs-on: windows-2022 + name: "Windows Release" + env: + ASPNETCORE_ENVIRONMENT: "Production" + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.1 + with: + vs-prerelease: true + msbuild-architecture: x64 + + - name: Setup .NET 6 + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.* + include-prerelease: true + + - uses: actions/setup-java@v2 + with: + distribution: 'microsoft' + java-version: '11' + + - name: Install MAUI Workloads + run: | + dotnet workload install maui --ignore-failed-sources + + - name: Restore Dependencies + run: dotnet restore TransactionMobile.Maui.sln + + - name: Build Code + run: msbuild TransactionMobile.Maui/TransactionMobile.Maui.csproj -r -p:Configuration=Release -p:RestorePackages=false -p:TargetFramework=net6.0-windows10.0.19041 /p:GenerateAppxPackageOnBuild=true + + - name: Run Unit Tests + run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj + + - name: Upload Windows Artifact + uses: actions/upload-artifact@v2.3.1 + with: + name: windows-ci-build + path: | + TransactionMobile.Maui/bin/Release/net6.0-windows*/**/TransactionMobile.Maui*.msix + + released-mac: + runs-on: macos-11 + name: MacCatalyst Release + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET 6 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + include-prerelease: true + + - name: Install MAUI Workloads + run: | + dotnet workload install maccatalyst --ignore-failed-sources + dotnet workload install maui --ignore-failed-sources + + - name: Restore Dependencies + run: dotnet restore TransactionMobile.Maui.sln + + - name: Build Code + run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net6.0-maccatalyst --no-restore + + - name: Run Unit Tests + run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj + + - name: Upload MacCatalyst Artifact + uses: actions/upload-artifact@v2.3.1 + with: + name: macos-ci-build + path: TransactionMobile.Maui/bin/Release/net6.0-maccatalyst/**/*.app/ + + release-ios: + runs-on: macos-11 + name: iOS Release + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup .NET 6 + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.* + include-prerelease: true + + - name: Install MAUI Workloads + run: | + dotnet workload install ios --ignore-failed-sources + dotnet workload install maui --ignore-failed-sources + + - name: Restore Dependencies + run: dotnet restore TransactionMobile.Maui.sln + + - name: Build Code + run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net6.0-ios --no-restore + + - name: Run Unit Tests + run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj + + - name: Upload iOS Artifact + uses: actions/upload-artifact@v2.3.1 + with: + name: ios-ci-build + path: TransactionMobile.Maui/bin/Release/net6.0-ios/**/*.app/ From 5a8c30d4e2d197276ddc9d876cbeee62876709a8 Mon Sep 17 00:00:00 2001 From: Stuart Ferguson Date: Sat, 26 Mar 2022 10:38:23 +0000 Subject: [PATCH 11/11] release workflow tweaks --- .github/workflows/createrelease.yml | 72 ++++++++++++++--------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/createrelease.yml b/.github/workflows/createrelease.yml index 021c490b..77d1c350 100644 --- a/.github/workflows/createrelease.yml +++ b/.github/workflows/createrelease.yml @@ -20,44 +20,44 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Setup MSBuild + - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.1 with: vs-prerelease: true msbuild-architecture: x64 - - name: Setup .NET 6 - uses: actions/setup-dotnet@v2 - with: + - name: Setup .NET 6 + uses: actions/setup-dotnet@v2 + with: dotnet-version: 6.0.* include-prerelease: true - - uses: actions/setup-java@v2 - with: + - uses: actions/setup-java@v2 + with: distribution: 'microsoft' java-version: '11' - - name: Install MAUI Workloads - run: | + - name: Install MAUI Workloads + run: | dotnet workload install android --ignore-failed-sources dotnet workload install maui --ignore-failed-sources - - name: Restore Dependencies - run: dotnet restore TransactionMobile.Maui.sln + - name: Restore Dependencies + run: dotnet restore TransactionMobile.Maui.sln - - name: Build Code - run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net6.0-android --no-restore + - name: Build Code + run: dotnet build TransactionMobile.Maui/TransactionMobile.Maui.csproj -c Release -f net6.0-android --no-restore - - name: Run Unit Tests - run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj + - name: Run Unit Tests + run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj - - name: Upload Android Artifact - uses: actions/upload-artifact@v2.3.1 - with: + - name: Upload Android Artifact + uses: actions/upload-artifact@v2.3.1 + with: name: android-ci-build path: TransactionMobile.Maui/bin/Release/net6.0-android/*Signed.a* @@ -71,39 +71,39 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - - name: Setup MSBuild + - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.1 with: vs-prerelease: true msbuild-architecture: x64 - - name: Setup .NET 6 - uses: actions/setup-dotnet@v2 - with: + - name: Setup .NET 6 + uses: actions/setup-dotnet@v2 + with: dotnet-version: 6.0.* include-prerelease: true - - uses: actions/setup-java@v2 - with: + - uses: actions/setup-java@v2 + with: distribution: 'microsoft' java-version: '11' - - name: Install MAUI Workloads + - name: Install MAUI Workloads run: | dotnet workload install maui --ignore-failed-sources - - name: Restore Dependencies - run: dotnet restore TransactionMobile.Maui.sln + - name: Restore Dependencies + run: dotnet restore TransactionMobile.Maui.sln - - name: Build Code - run: msbuild TransactionMobile.Maui/TransactionMobile.Maui.csproj -r -p:Configuration=Release -p:RestorePackages=false -p:TargetFramework=net6.0-windows10.0.19041 /p:GenerateAppxPackageOnBuild=true + - name: Build Code + run: msbuild TransactionMobile.Maui/TransactionMobile.Maui.csproj -r -p:Configuration=Release -p:RestorePackages=false -p:TargetFramework=net6.0-windows10.0.19041 /p:GenerateAppxPackageOnBuild=true - - name: Run Unit Tests - run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj + - name: Run Unit Tests + run: dotnet test TransactionMobile.Maui.BusinessLogic.Tests/TransactionMobile.Maui.BusinessLogic.Tests.csproj - name: Upload Windows Artifact uses: actions/upload-artifact@v2.3.1