From 3140e03b285f6eb96226dc67496e4e65fe84fd27 Mon Sep 17 00:00:00 2001 From: Yaser Moradi Date: Mon, 13 Nov 2023 07:52:14 +0100 Subject: [PATCH] feat(github actions): change cd pipelines to use project created by dotnet new #6008 (#6010) --- .github/workflows/adminpanel.cd.yml | 94 ++++++++++++++++++-------- .github/workflows/todotemplate.cd.yml | 96 +++++++++++++++++++-------- 2 files changed, 137 insertions(+), 53 deletions(-) diff --git a/.github/workflows/adminpanel.cd.yml b/.github/workflows/adminpanel.cd.yml index e892b43042..bbc6e9e839 100644 --- a/.github/workflows/adminpanel.cd.yml +++ b/.github/workflows/adminpanel.cd.yml @@ -31,21 +31,28 @@ jobs: with: global-json-file: src/Templates/AdminPanel/Bit.AdminPanel/global.json + - name: Create project from AdminPanel + run: | + cd src/Templates/AdminPanel && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.AdminPanel.0.0.0.nupkg + cd ../../../ && dotnet new bit-admin --name AdminPanel --database SqlServer + - uses: actions/setup-node@v3 with: node-version: 18 - name: Switch to blazor web assembly - run: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Web/AdminPanel.Client.Web.csproj + run: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' AdminPanel/src/Client/Web/AdminPanel.Client.Web.csproj - name: Install wasm run: cd src && dotnet workload install wasm-tools wasm-experimental - name: Generate CSS/JS files - run: dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Publish - run: dotnet publish src/Templates/AdminPanel/Bit.AdminPanel/src/Server/Api/AdminPanel.Server.Api.csproj -p:BlazorMode=BlazorWebAssembly -p:WebAppDeploymentType="${{ env.WEB_APP_DEPLOYMENT_TYPE }}" -p:Configuration=Release --self-contained -r linux-x64 -o ${{env.DOTNET_ROOT}}/api-web + run: dotnet publish AdminPanel/src/Server/Api/AdminPanel.Server.Api.csproj -p:BlazorMode=BlazorWebAssembly -p:WebAppDeploymentType="${{ env.WEB_APP_DEPLOYMENT_TYPE }}" -p:Configuration=Release --self-contained -r linux-x64 -o ${{env.DOTNET_ROOT}}/api-web - name: Upload api-web artifact uses: actions/upload-artifact@v3 @@ -101,6 +108,13 @@ jobs: uses: actions/setup-dotnet@v3 with: global-json-file: src/Templates/AdminPanel/Bit.AdminPanel/global.json + + - name: Create project from AdminPanel + run: | + cd src/Templates/AdminPanel && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.AdminPanel.0.0.0.nupkg + cd ../../../ && dotnet new bit-admin --name AdminPanel --database SqlServer - uses: actions/setup-node@v3 with: @@ -109,7 +123,7 @@ jobs: - name: Update appsettings.json api server address uses: microsoft/variable-substitution@v1 with: - files: 'src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/appsettings.json' + files: 'AdminPanel/src/Client/Core/appsettings.json' env: ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} @@ -117,16 +131,16 @@ jobs: run: cd src && dotnet workload install maui - name: Generate CSS/JS files - run: dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Build exe - run: dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/App/AdminPanel.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:WindowsPackageType=None -p:SelfContained=true -p:WindowsAppSDKSelfContained=true -p:GenerateAppxPackageOnBuild=false -p:RuntimeIdentifier=win10-x86 -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -p:UseRidGraph=true -f net8.0-windows10.0.19041.0 + run: dotnet build AdminPanel/src/Client/App/AdminPanel.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:WindowsPackageType=None -p:SelfContained=true -p:WindowsAppSDKSelfContained=true -p:GenerateAppxPackageOnBuild=false -p:RuntimeIdentifier=win10-x86 -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -p:UseRidGraph=true -f net8.0-windows10.0.19041.0 - name: Upload artifact uses: actions/upload-artifact@v2 with: name: win-exe-bundle - path: src/Templates/AdminPanel/Bit.AdminPanel/src/Client/App/bin/release/net8.0-windows10.0.19041.0/win10-x86 + path: AdminPanel/src/Client/App/bin/release/net8.0-windows10.0.19041.0/win10-x86 build_blazor_hybrid_android: name: build blazor hybrid (android) @@ -142,6 +156,13 @@ jobs: with: global-json-file: src/Templates/AdminPanel/Bit.AdminPanel/global.json + - name: Create project from AdminPanel + run: | + cd src/Templates/AdminPanel && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.AdminPanel.0.0.0.nupkg + cd ../../../ && dotnet new bit-admin --name AdminPanel --database SqlServer + - uses: actions/setup-node@v3 with: node-version: 18 @@ -149,14 +170,14 @@ jobs: - name: Extract Android signing key from env uses: timheuer/base64-to-file@v1 with: - fileDir: './src/Templates/AdminPanel/Bit.AdminPanel/src/Client/App/' + fileDir: './AdminPanel/src/Client/App/' fileName: 'AdminPanel.keystore' encodedString: ${{ secrets.ANDROID_RELEASE_KEYSTORE_FILE_BASE64 }} - name: Update appsettings.json api server address uses: microsoft/variable-substitution@v1 with: - files: 'src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/appsettings.json' + files: 'AdminPanel/src/Client/Core/appsettings.json' env: ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} @@ -164,16 +185,16 @@ jobs: run: cd src && dotnet workload install maui-android - name: Generate CSS/JS files - run: dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Build aab - run: dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/App/AdminPanel.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:AndroidPackageFormat=aab -p:AndroidKeyStore=true -p:AndroidSigningKeyStore="AdminPanel.keystore" -p:AndroidSigningKeyAlias=bitplatform -p:AndroidSigningKeyPass="${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }}" -p:AndroidSigningStorePass="${{ secrets.ANDROID_RELEASE_SIGNING_PASSWORD }}" -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-android + run: dotnet build AdminPanel/src/Client/App/AdminPanel.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:AndroidPackageFormat=aab -p:AndroidKeyStore=true -p:AndroidSigningKeyStore="AdminPanel.keystore" -p:AndroidSigningKeyAlias=bitplatform -p:AndroidSigningKeyPass="${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }}" -p:AndroidSigningStorePass="${{ secrets.ANDROID_RELEASE_SIGNING_PASSWORD }}" -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-android - name: Upload artifact uses: actions/upload-artifact@v2 with: name: android-bundle - path: src/Templates/AdminPanel/Bit.AdminPanel/src/Client/App/bin/Release/net8.0-android/*-Signed.* + path: AdminPanel/src/Client/App/bin/Release/net8.0-android/*-Signed.* build_blazor_hybrid_maccatalyst: name: build blazor hybrid (maccatalyst) @@ -192,11 +213,18 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + + - name: Create project from AdminPanel + run: | + cd src/Templates/AdminPanel && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.AdminPanel.0.0.0.nupkg + cd ../../../ && dotnet new bit-admin --name AdminPanel --database SqlServer - name: Update appsettings.json api server address uses: microsoft/variable-substitution@v1 with: - files: 'src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/appsettings.json' + files: 'AdminPanel/src/Client/Core/appsettings.json' env: ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} @@ -204,16 +232,16 @@ jobs: run: cd src && dotnet workload install maui - name: Generate CSS/JS files - run: dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Build pkg - run: dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/App/AdminPanel.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:CreatePackage=true -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-maccatalyst + run: dotnet build AdminPanel/src/Client/App/AdminPanel.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:CreatePackage=true -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-maccatalyst - name: Upload artifact uses: actions/upload-artifact@v2 with: name: mac-pkg-bundle - path: src/Templates/AdminPanel/Bit.AdminPanel/src/Client/App/bin/release/net8.0-maccatalyst/*.pkg + path: AdminPanel/src/Client/App/bin/release/net8.0-maccatalyst/*.pkg build_blazor_hybrid_ios: name: build blazor hybrid (ios) @@ -236,11 +264,18 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + + - name: Create project from AdminPanel + run: | + cd src/Templates/AdminPanel && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.AdminPanel.0.0.0.nupkg + cd ../../../ && dotnet new bit-admin --name AdminPanel --database SqlServer - name: Update appsettings.json api server address uses: microsoft/variable-substitution@v1 with: - files: 'src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/appsettings.json' + files: 'AdminPanel/src/Client/Core/appsettings.json' env: ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} @@ -269,16 +304,16 @@ jobs: api-private-key: ${{ secrets.APPSTORE_API_KEY_PRIVATE_KEY }} - name: Generate CSS/JS files - run: dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Build ipa - run: dotnet publish src/Templates/AdminPanel/Bit.AdminPanel/src/Client/App/AdminPanel.Client.App.csproj -p:RuntimeIdentifier=ios-arm64 -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:ArchiveOnBuild=true -p:CodesignKey="iPhone Distribution" -p:CodesignProvision="AdminPanel" -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-ios + run: dotnet publish AdminPanel/src/Client/App/AdminPanel.Client.App.csproj -p:RuntimeIdentifier=ios-arm64 -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:ArchiveOnBuild=true -p:CodesignKey="iPhone Distribution" -p:CodesignProvision="AdminPanel" -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-ios - name: Upload artifact uses: actions/upload-artifact@v2 with: name: ios-bundle - path: src/Templates/AdminPanel/Bit.AdminPanel/src/Client/App/bin/release/net8.0-ios/ios-arm64/publish/*.ipa + path: AdminPanel/src/Client/App/bin/release/net8.0-ios/ios-arm64/publish/*.ipa build_blazor_electron_linux: name: build blazor electron (linux) @@ -294,6 +329,13 @@ jobs: with: global-json-file: src/Templates/AdminPanel/Bit.AdminPanel/global.json + - name: Create project from AdminPanel + run: | + cd src/Templates/AdminPanel && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.AdminPanel.0.0.0.nupkg + cd ../../../ && dotnet new bit-admin --name AdminPanel --database SqlServer + - name: Setup .NET for Electron.NET uses: actions/setup-dotnet@v3 with: @@ -306,24 +348,24 @@ jobs: - name: Update appsettings.json api server address uses: microsoft/variable-substitution@v1 with: - files: 'src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/appsettings.json' + files: 'AdminPanel/src/Client/Core/appsettings.json' env: ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} - name: Switch to BlazorElectron - run: awk '//{sub(">.*BlazorElectron temp.xml && mv temp.xml src/Templates/AdminPanel/Bit.AdminPanel/src/Directory.Build.props + run: awk '//{sub(">.*BlazorElectron temp.xml && mv temp.xml AdminPanel/src/Directory.Build.props - name: Generate CSS/JS files - run: dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build AdminPanel/src/Client/Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Restore electron .net - run: dotnet build src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Web/AdminPanel.Client.Web.csproj -t:BeforeBuildTasks + run: dotnet build AdminPanel/src/Client/Web/AdminPanel.Client.Web.csproj -t:BeforeBuildTasks - name: Build app image - run: cd src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Web/ && dotnet electronize build /target linux + run: cd AdminPanel/src/Client/Web/ && dotnet electronize build /target linux - name: Upload artifact uses: actions/upload-artifact@v2 with: name: linux-app-image - path: src/Templates/AdminPanel/Bit.AdminPanel/src/Client/Web/bin/Desktop/linux-unpacked \ No newline at end of file + path: AdminPanel/src/Client/Web/bin/Desktop/linux-unpacked \ No newline at end of file diff --git a/.github/workflows/todotemplate.cd.yml b/.github/workflows/todotemplate.cd.yml index 7f6a5ac465..f96d389d9f 100644 --- a/.github/workflows/todotemplate.cd.yml +++ b/.github/workflows/todotemplate.cd.yml @@ -34,17 +34,24 @@ jobs: with: node-version: 18 + - name: Create project from TodoTemplate + run: | + cd src/Templates/TodoTemplate && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.TodoTemplate.0.0.0.nupkg + cd ../../../ && dotnet new bit-todo --name TodoTemplate --database SqlServer + - name: Switch to blazor web assembly - run: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Web/TodoTemplate.Client.Web.csproj + run: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' TodoTemplate/src/Client/Web/TodoTemplate.Client.Web.csproj - name: Install wasm run: cd src && dotnet workload install wasm-tools wasm-experimental - name: Generate CSS/JS files - run: dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Publish - run: dotnet publish src/Templates/TodoTemplate/Bit.TodoTemplate/src/Server/Api/TodoTemplate.Server.Api.csproj -p:BlazorMode=BlazorWebAssembly -p:WebAppDeploymentType="${{ env.WEB_APP_DEPLOYMENT_TYPE }}" -p:Configuration=Release --self-contained -r linux-x64 -o ${{env.DOTNET_ROOT}}/api-web + run: dotnet publish TodoTemplate/src/Server/Api/TodoTemplate.Server.Api.csproj -p:BlazorMode=BlazorWebAssembly -p:WebAppDeploymentType="${{ env.WEB_APP_DEPLOYMENT_TYPE }}" -p:Configuration=Release --self-contained -r linux-x64 -o ${{env.DOTNET_ROOT}}/api-web - name: Upload api-web artifact uses: actions/upload-artifact@v3 @@ -104,11 +111,18 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + + - name: Create project from TodoTemplate + run: | + cd src/Templates/TodoTemplate && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.TodoTemplate.0.0.0.nupkg + cd ../../../ && dotnet new bit-todo --name TodoTemplate --database SqlServer - name: Update appsettings.json api server address uses: microsoft/variable-substitution@v1 with: - files: 'src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/appsettings.json' + files: 'TodoTemplate/src/Client/Core/appsettings.json' env: ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} @@ -116,16 +130,16 @@ jobs: run: cd src && dotnet workload install maui - name: Generate CSS/JS files - run: dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Build exe - run: dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/App/TodoTemplate.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:WindowsPackageType=None -p:SelfContained=true -p:WindowsAppSDKSelfContained=true -p:GenerateAppxPackageOnBuild=false -p:RuntimeIdentifier=win10-x86 -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -p:UseRidGraph=true -f net8.0-windows10.0.19041.0 + run: dotnet build TodoTemplate/src/Client/App/TodoTemplate.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:WindowsPackageType=None -p:SelfContained=true -p:WindowsAppSDKSelfContained=true -p:GenerateAppxPackageOnBuild=false -p:RuntimeIdentifier=win10-x86 -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -p:UseRidGraph=true -f net8.0-windows10.0.19041.0 - name: Upload artifact uses: actions/upload-artifact@v2 with: name: win-exe-bundle - path: src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/App/bin/release/net8.0-windows10.0.19041.0/win10-x86 + path: TodoTemplate/src/Client/App/bin/release/net8.0-windows10.0.19041.0/win10-x86 build_blazor_hybrid_android: name: build blazor hybrid (android) @@ -144,18 +158,25 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + + - name: Create project from TodoTemplate + run: | + cd src/Templates/TodoTemplate && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.TodoTemplate.0.0.0.nupkg + cd ../../../ && dotnet new bit-todo --name TodoTemplate --database SqlServer - name: Extract Android signing key from env uses: timheuer/base64-to-file@v1 with: - fileDir: './src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/App/' + fileDir: './TodoTemplate/src/Client/App/' fileName: 'TodoTemplate.keystore' encodedString: ${{ secrets.ANDROID_RELEASE_KEYSTORE_FILE_BASE64 }} - name: Update appsettings.json api server address uses: microsoft/variable-substitution@v1 with: - files: 'src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/appsettings.json' + files: 'TodoTemplate/src/Client/Core/appsettings.json' env: ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} @@ -163,16 +184,16 @@ jobs: run: cd src && dotnet workload install maui-android - name: Generate CSS/JS files - run: dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Build aab - run: dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/App/TodoTemplate.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:AndroidPackageFormat=aab -p:AndroidKeyStore=true -p:AndroidSigningKeyStore="TodoTemplate.keystore" -p:AndroidSigningKeyAlias=bitplatform -p:AndroidSigningKeyPass="${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }}" -p:AndroidSigningStorePass="${{ secrets.ANDROID_RELEASE_SIGNING_PASSWORD }}" -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-android + run: dotnet build TodoTemplate/src/Client/App/TodoTemplate.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:AndroidPackageFormat=aab -p:AndroidKeyStore=true -p:AndroidSigningKeyStore="TodoTemplate.keystore" -p:AndroidSigningKeyAlias=bitplatform -p:AndroidSigningKeyPass="${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }}" -p:AndroidSigningStorePass="${{ secrets.ANDROID_RELEASE_SIGNING_PASSWORD }}" -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-android - name: Upload artifact uses: actions/upload-artifact@v2 with: name: android-bundle - path: src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/App/bin/Release/net8.0-android/*-Signed.* + path: TodoTemplate/src/Client/App/bin/Release/net8.0-android/*-Signed.* build_blazor_hybrid_maccatalyst: name: build blazor hybrid (maccatalyst) @@ -191,11 +212,18 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + + - name: Create project from TodoTemplate + run: | + cd src/Templates/TodoTemplate && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.TodoTemplate.0.0.0.nupkg + cd ../../../ && dotnet new bit-todo --name TodoTemplate --database SqlServer - name: Update appsettings.json api server address uses: microsoft/variable-substitution@v1 with: - files: 'src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/appsettings.json' + files: 'TodoTemplate/src/Client/Core/appsettings.json' env: ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} @@ -203,16 +231,16 @@ jobs: run: cd src && dotnet workload install maui - name: Generate CSS/JS files - run: dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Build pkg - run: dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/App/TodoTemplate.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:CreatePackage=true -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-maccatalyst + run: dotnet build TodoTemplate/src/Client/App/TodoTemplate.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:CreatePackage=true -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-maccatalyst - name: Upload artifact uses: actions/upload-artifact@v2 with: name: mac-pkg-bundle - path: src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/App/bin/release/net8.0-maccatalyst/*.pkg + path: TodoTemplate/src/Client/App/bin/release/net8.0-maccatalyst/*.pkg build_blazor_hybrid_ios: name: build blazor hybrid (ios) @@ -235,11 +263,18 @@ jobs: - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: '15' + + - name: Create project from TodoTemplate + run: | + cd src/Templates/TodoTemplate && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.TodoTemplate.0.0.0.nupkg + cd ../../../ && dotnet new bit-todo --name TodoTemplate --database SqlServer - name: Update appsettings.json api server address uses: microsoft/variable-substitution@v1 with: - files: 'src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/appsettings.json' + files: 'TodoTemplate/src/Client/Core/appsettings.json' env: ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} @@ -268,16 +303,16 @@ jobs: api-private-key: ${{ secrets.APPSTORE_API_KEY_PRIVATE_KEY }} - name: Generate CSS/JS files - run: dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Build ipa - run: dotnet publish src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/App/TodoTemplate.Client.App.csproj -p:RuntimeIdentifier=ios-arm64 -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:ArchiveOnBuild=true -p:CodesignKey="iPhone Distribution" -p:CodesignProvision="TodoTemplate" -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-ios + run: dotnet publish TodoTemplate/src/Client/App/TodoTemplate.Client.App.csproj -p:RuntimeIdentifier=ios-arm64 -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:ArchiveOnBuild=true -p:CodesignKey="iPhone Distribution" -p:CodesignProvision="TodoTemplate" -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-ios - name: Upload artifact uses: actions/upload-artifact@v2 with: name: ios-bundle - path: src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/App/bin/release/net8.0-ios/ios-arm64/publish/*.ipa + path: TodoTemplate/src/Client/App/bin/release/net8.0-ios/ios-arm64/publish/*.ipa build_blazor_electron_linux: name: build blazor electron (linux) @@ -301,28 +336,35 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 - + + - name: Create project from TodoTemplate + run: | + cd src/Templates/TodoTemplate && dotnet build -c Release + dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0 + dotnet new install Bit.TodoTemplate.0.0.0.nupkg + cd ../../../ && dotnet new bit-todo --name TodoTemplate --database SqlServer + - name: Update appsettings.json api server address uses: microsoft/variable-substitution@v1 with: - files: 'src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/appsettings.json' + files: 'TodoTemplate/src/Client/Core/appsettings.json' env: ApiServerAddress: ${{ env.API_SERVER_ADDRESS }} - name: Switch to BlazorElectron - run: awk '//{sub(">.*BlazorElectron temp.xml && mv temp.xml src/Templates/TodoTemplate/Bit.TodoTemplate/src/Directory.Build.props + run: awk '//{sub(">.*BlazorElectron temp.xml && mv temp.xml TodoTemplate/src/Directory.Build.props - name: Generate CSS/JS files - run: dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore + run: dotnet build TodoTemplate/src/Client/Core/TodoTemplate.Client.Core.csproj -t:BeforeBuildTasks --no-restore - name: Restore electron .net - run: dotnet build src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Web/TodoTemplate.Client.Web.csproj -t:BeforeBuildTasks + run: dotnet build TodoTemplate/src/Client/Web/TodoTemplate.Client.Web.csproj -t:BeforeBuildTasks - name: Build app image - run: cd src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Web/ && dotnet electronize build /target linux + run: cd TodoTemplate/src/Client/Web/ && dotnet electronize build /target linux - name: Upload artifact uses: actions/upload-artifact@v2 with: name: linux-app-image - path: src/Templates/TodoTemplate/Bit.TodoTemplate/src/Client/Web/bin/Desktop/linux-unpacked \ No newline at end of file + path: TodoTemplate/src/Client/Web/bin/Desktop/linux-unpacked \ No newline at end of file