Skip to content

Commit

Permalink
Merge branch 'develop' into 9163-blazorui-extra-navpanel
Browse files Browse the repository at this point in the history
  • Loading branch information
msynk committed Dec 22, 2024
2 parents 2bd1c4a + cf3eda1 commit a3dcd30
Show file tree
Hide file tree
Showing 328 changed files with 9,312 additions and 3,963 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"hostRequirements": {
"cpus": 4
},
"onCreateCommand": "wget https://download.visualstudio.microsoft.com/download/pr/308f16a9-2ecf-4a42-b8bb-c1233de985fd/be6e87045ab21935bd8bb98ce69026c4/dotnet-sdk-9.0.100-linux-x64.tar.gz -O $HOME/dotnet.tar.gz && export DOTNET_ROOT=$HOME/.dotnet && mkdir -p \"$DOTNET_ROOT\" && tar zxf $HOME/dotnet.tar.gz -C \"$DOTNET_ROOT\" && export PATH=$DOTNET_ROOT:$DOTNET_ROOT/tools:$PATH && find . -type f -name '*.csproj' -exec sed -i 's/Microsoft.NET.Sdk.BlazorWebAssembly/Microsoft.NET.Sdk.Web/g' {} \\;",
"onCreateCommand": "wget https://download.visualstudio.microsoft.com/download/pr/d74fd2dd-3384-4952-924b-f5d492326e35/e91d8295d4cbe82ba3501e411d78c9b8/dotnet-sdk-9.0.101-linux-x64.tar.gz -O $HOME/dotnet.tar.gz && export DOTNET_ROOT=$HOME/.dotnet && mkdir -p \"$DOTNET_ROOT\" && tar zxf $HOME/dotnet.tar.gz -C \"$DOTNET_ROOT\" && export PATH=$DOTNET_ROOT:$DOTNET_ROOT/tools:$PATH && find . -type f -name '*.csproj' -exec sed -i 's/Microsoft.NET.Sdk.BlazorWebAssembly/Microsoft.NET.Sdk.Web/g' {} \\;",
"waitFor": "onCreateCommand",
"customizations": {
"codespaces": {
Expand Down
89 changes: 65 additions & 24 deletions .github/workflows/admin-sample.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# Project templates come equipped with CI/CD for both Azure DevOps and GitHub, providing you with a hassle-free way to get started with your new project. It is important to note that you should not depend on the contents of this file. More info at https://bitplatform.dev/templates/dev-ops

env:
API_SERVER_ADDRESS: 'https://adminpanel-api.bitplatform.dev'
WEB_SERVER_ADDRESS: 'https://adminpanel.bitplatform.dev'
SERVER_ADDRESS: 'https://adminpanel.bitplatform.dev'
APP_SERVICE_NAME: 'bit-adminpanel'

on:
Expand All @@ -29,22 +28,22 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: src/Templates/Boilerplate/Bit.Boilerplate/global.json
global-json-file: src/global.json

- name: Create project from Boilerplate
run: |
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --api Standalone --notification --captcha reCaptcha --signalR --framework net9.0
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'AdminPanel/src/Shared/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Core/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Web/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Web/appsettings.Production.json'
env:
WebAppRender.BlazorMode: BlazorWebAssembly
ServerAddress: ${{ env.API_SERVER_ADDRESS }}
ServerAddress: ${{ env.SERVER_ADDRESS }}
Logging.Sentry.Dsn: ${{ secrets.ADMINPANEL_SENTRY_DSN }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
AdsPushVapid.PublicKey: ${{ secrets.ADMINPANEL_PUBLIC_VAPIDKEY }}
Expand All @@ -61,25 +60,64 @@ jobs:
run: dotnet build AdminPanel/src/Client/AdminPanel.Client.Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" --no-restore -c Release

- name: Publish
run: dotnet publish AdminPanel/src/Server/AdminPanel.Server.Api/AdminPanel.Server.Api.csproj -c Release -p:PwaEnabled=true --self-contained -r linux-x64 -o ${{env.DOTNET_ROOT}}/server -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}"
run: dotnet publish AdminPanel/src/Server/AdminPanel.Server.Web/AdminPanel.Server.Web.csproj -c Release -p:PwaEnabled=true --self-contained -r linux-x64 -o ${{env.DOTNET_ROOT}}/server -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}"

- name: Upload server artifact
uses: actions/upload-artifact@v4
with:
name: server-bundle
path: ${{env.DOTNET_ROOT}}/server
include-hidden-files: true # Required for wwwroot/.well-known folder

deploy_blazor_wasm_standalone:
name: build blazor wasm standalone
runs-on: ubuntu-24.04

- name: Publish adminpanel blazor wasm standalone
steps:

- name: Checkout source code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json

- name: Create project from Boilerplate
run: |
sed -i 's/adminpanel.bitplatform.dev/adminpanel-api.bitplatform.dev/g' AdminPanel/src/Client/AdminPanel.Client.Web/wwwroot/index.html
dotnet publish AdminPanel/src/Client/AdminPanel.Client.Web/AdminPanel.Client.Web.csproj -c Release -p:PwaEnabled=true -o ${{env.DOTNET_ROOT}}/static -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}"
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'AdminPanel/src/Shared/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Core/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Web/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Web/appsettings.Production.json'
env:
ServerAddress: ${{ env.SERVER_ADDRESS }}
Logging.Sentry.Dsn: ${{ secrets.ADMINPANEL_SENTRY_DSN }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
AdsPushVapid.PublicKey: ${{ secrets.ADMINPANEL_PUBLIC_VAPIDKEY }}
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}

- name: Upload static artifact
uses: actions/upload-artifact@v4
- uses: actions/setup-node@v4
with:
name: static-bundle
path: ${{env.DOTNET_ROOT}}/static
include-hidden-files: true # Required for wwwroot/.well-known folder
node-version: 22

- name: Install wasm
run: cd src && dotnet workload install wasm-tools

- name: Generate CSS/JS files
run: dotnet build AdminPanel/src/Client/AdminPanel.Client.Core/AdminPanel.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" --no-restore -c Release

- name: Publish
run: dotnet publish AdminPanel/src/Client/AdminPanel.Client.Web/AdminPanel.Client.Web.csproj -c Release -p:PwaEnabled=true -o ${{env.DOTNET_ROOT}}/client -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}"

- name: Upload to asw
run: |
npm install -g @azure/static-web-apps-cli
swa deploy --deployment-token ${{ secrets.ADMINPANEL_ASW_TOKEN }} --env production --app-location ${{env.DOTNET_ROOT}}/client/wwwroot
deploy_api_blazor:
name: deploy api + blazor
Expand Down Expand Up @@ -107,6 +145,9 @@ jobs:
fileName: 'DataProtectionCertificate.pfx'
encodedString: ${{ secrets.API_DATA_PROTECTION_CERTIFICATE_FILE_BASE64 }}

- name: Retrieve AppleAuthKey.p8
run: echo "${{ secrets.APPSTORE_API_KEY_PRIVATE_KEY_ADMIN }}" > AppleAuthKey.p8

- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
Expand Down Expand Up @@ -134,7 +175,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: src\Templates\Boilerplate\Bit.Boilerplate\global.json
global-json-file: src\global.json

- uses: actions/setup-node@v4
with:
Expand All @@ -145,14 +186,14 @@ jobs:
cd src\Templates\Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ..\..\..\ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --windows --appInsights --sentry --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --captcha reCaptcha --signalR --offlineDb --framework net9.0
cd ..\..\..\ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --windows --appInsights --sentry --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --captcha reCaptcha --signalR --offlineDb --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'AdminPanel\src\Shared\appsettings.json, AdminPanel\src\Client\AdminPanel.Client.Core\appsettings.json, AdminPanel\src\Client\AdminPanel.Client.Windows\appsettings.json'
env:
ServerAddress: ${{ env.API_SERVER_ADDRESS }}
ServerAddress: ${{ env.SERVER_ADDRESS }}
Logging.Sentry.Dsn: ${{ secrets.ADMINPANEL_SENTRY_DSN }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
WindowsUpdate.FilesUrl: https://windows-adminpanel.bitplatform.dev
Expand Down Expand Up @@ -186,14 +227,14 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: src/Templates/Boilerplate/Bit.Boilerplate/global.json
global-json-file: src/global.json

- name: Create project from Boilerplate
run: |
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
- uses: actions/setup-node@v4
with:
Expand All @@ -218,7 +259,7 @@ jobs:
with:
files: 'AdminPanel/src/Shared/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Core/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Maui/appsettings.json'
env:
ServerAddress: ${{ env.API_SERVER_ADDRESS }}
ServerAddress: ${{ env.SERVER_ADDRESS }}
Logging.Sentry.Dsn: ${{ secrets.ADMINPANEL_SENTRY_DSN }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}
Expand Down Expand Up @@ -255,11 +296,11 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: src/Templates/Boilerplate/Bit.Boilerplate/global.json
global-json-file: src/global.json

- uses: maxim-lobanov/[email protected]
with:
xcode-version: '16.1'
xcode-version: '16.2'

- uses: actions/setup-node@v4
with:
Expand All @@ -270,14 +311,14 @@ jobs:
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --serverUrl ${{ env.WEB_SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
cd ../../../ && dotnet new bit-bp --name AdminPanel --database PostgreSQL --sample Admin --appInsights --sentry --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'AdminPanel/src/Shared/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Core/appsettings.json, AdminPanel/src/Client/AdminPanel.Client.Maui/appsettings.json'
env:
ServerAddress: ${{ env.API_SERVER_ADDRESS }}
ServerAddress: ${{ env.SERVER_ADDRESS }}
Logging.Sentry.Dsn: ${{ secrets.ADMINPANEL_SENTRY_DSN }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}
ApplicationInsights.ConnectionString: ${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/bit.full.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,25 +140,25 @@ jobs:

- name: Test PostgreSQL, MySql, Other database options
run: |
dotnet new bit-bp --name TestPostgreSQL --database PostgreSQL --framework net8.0
dotnet new bit-bp --name TestPostgreSQL --database PostgreSQL --framework net8.0 --signalR
cd TestPostgreSQL/src/Server/TestPostgreSQL.Server.Api/
dotnet build
cd ../../../../
dotnet new bit-bp --name TestMySql --database MySql --framework net8.0
dotnet new bit-bp --name TestMySql --database MySql --framework net8.0 --sample Admin --offlineDb
cd TestMySql/src/Server/TestMySql.Server.Api/
dotnet build
cd ../../../../
dotnet new bit-bp --name TestOther --database Other --framework net9.0
dotnet new bit-bp --name TestOther --database Other --framework net9.0 --sample Todo --sentry
cd TestOther/src/Server/TestOther.Server.Api/
dotnet build
- name: Test file storage options
run: |
dotnet new bit-bp --name TestLocal --filesStorage Local --framework net8.0
dotnet new bit-bp --name TestLocal --filesStorage Local --framework net8.0 --appInsights
cd TestLocal/src/Server/TestLocal.Server.Api/
dotnet build
cd ../../../../
dotnet new bit-bp --name TestAzureBlobStorage --filesStorage AzureBlobStorage --framework net9.0
dotnet new bit-bp --name TestAzureBlobStorage --filesStorage AzureBlobStorage --framework net9.0 --captcha reCaptcha --notification
cd TestAzureBlobStorage/src/Server/TestAzureBlobStorage.Server.Api/
dotnet build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/blazorui.demo.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:

- uses: maxim-lobanov/[email protected]
with:
xcode-version: '16.1'
xcode-version: '16.2'

- uses: actions/setup-node@v4
with:
Expand Down
55 changes: 52 additions & 3 deletions .github/workflows/todo-sample.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ jobs:

- name: Configure bswup
run: |
sed -i 's/\/\/ self.noPrerenderQuery/self.noPrerenderQuery/g' TodoSample/src/Client/TodoSample.Client.Web/wwwroot/service-worker.published.js
sed -i 's/\/\/ self.disablePassiveFirstBoot/self.disablePassiveFirstBoot/g' TodoSample/src/Client/TodoSample.Client.Web/wwwroot/service-worker.published.js
- name: Generate CSS/JS files
Expand Down Expand Up @@ -104,6 +103,9 @@ jobs:
fileName: 'DataProtectionCertificate.pfx'
encodedString: ${{ secrets.API_DATA_PROTECTION_CERTIFICATE_FILE_BASE64 }}

- name: Retrieve AppleAuthKey.p8
run: echo "${{ secrets.APPSTORE_API_KEY_PRIVATE_KEY_TODO }}" > AppleAuthKey.p8

- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
Expand All @@ -119,6 +121,53 @@ jobs:
CLOUDFLARE_ZONE: ${{ secrets.BITPLATFORM_DEV_CLOUDFLARE_ZONE }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}

deploy_blazor_wasm_standalone:
name: build blazor wasm standalone
runs-on: ubuntu-24.04

steps:

- name: Checkout source code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json

- name: Create project from Boilerplate
run: |
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --framework net9.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
with:
files: 'TodoSample/src/Shared/appsettings.json, TodoSample/src/Client/TodoSample.Client.Core/appsettings.json, TodoSample/src/Client/TodoSample.Client.Web/appsettings.json, TodoSample/src/Client/TodoSample.Client.Web/appsettings.Production.json'
env:
ServerAddress: ${{ env.SERVER_ADDRESS }}
GoogleRecaptchaSiteKey: ${{ secrets.GOOGLE_RECAPTCHA_SITE_KEY }}

- uses: actions/setup-node@v4
with:
node-version: 22

- name: Install wasm
run: cd src && dotnet workload install wasm-tools

- name: Generate CSS/JS files
run: dotnet build TodoSample/src/Client/TodoSample.Client.Core/TodoSample.Client.Core.csproj -t:BeforeBuildTasks -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" --no-restore -c Release

- name: Publish
run: dotnet publish TodoSample/src/Client/TodoSample.Client.Web/TodoSample.Client.Web.csproj -c Release -p:PwaEnabled=true -o ${{env.DOTNET_ROOT}}/client -p:Version="${{ vars.APPLICATION_DISPLAY_VERSION}}" -p:RunAOTCompilation=true -p:MultilingualEnabled=false

- name: Upload to asw
run: |
npm install -g @azure/static-web-apps-cli
swa deploy --deployment-token ${{ secrets.TODO_ASW_TOKEN }} --env production --app-location ${{env.DOTNET_ROOT}}/client/wwwroot
build_blazor_hybrid_windows:
name: build blazor hybrid (windows)
runs-on: windows-2022
Expand Down Expand Up @@ -292,14 +341,14 @@ jobs:

- uses: maxim-lobanov/[email protected]
with:
xcode-version: '16.1'
xcode-version: '16.2'

- name: Create project from Boilerplate
run: |
cd src/Templates/Boilerplate && dotnet build -c Release
dotnet pack -c Release -o . -p:ReleaseVersion=0.0.0 -p:PackageVersion=0.0.0
dotnet new install Bit.Boilerplate.0.0.0.nupkg
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --appInsights --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net8.0
cd ../../../ && dotnet new bit-bp --name TodoSample --database PostgreSQL --sample Todo --appInsights --sentry --serverUrl ${{ env.SERVER_ADDRESS }} --filesStorage AzureBlobStorage --notification --captcha reCaptcha --signalR --framework net8.0
- name: Update core appsettings.json
uses: devops-actions/[email protected]
Expand Down
Loading

0 comments on commit a3dcd30

Please sign in to comment.