Skip to content

Commit

Permalink
feat: update to bit 8.9.0 #51 (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi authored Jun 9, 2024
1 parent b75dd1c commit 567b428
Show file tree
Hide file tree
Showing 209 changed files with 9,450 additions and 2,948 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/656a3402-6889-400f-927f-7f956856e58b/93750973d6eedd17c6d963658e7ec214/dotnet-sdk-8.0.203-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 && dotnet dev-certs https --trust && sudo dotnet workload install wasm-tools wasm-experimental && dotnet tool install --global dotnet-ef --version 8.0.3 && dotnet ef database update --project src/Bit.TemplatePlayground.Server/Bit.TemplatePlayground.Server.csproj && dotnet build src/Client/Bit.TemplatePlayground.Client.Core/Bit.TemplatePlayground.Client.Core.csproj -t:BeforeBuildTasks --no-restore",
"onCreateCommand": "wget https://download.visualstudio.microsoft.com/download/pr/86497c4f-3dc8-4ee7-9f6a-9e0464059427/293d074c28bbfd9410f4db8e021fa290/dotnet-sdk-8.0.301-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 && dotnet dev-certs https --trust && sudo dotnet workload install wasm-tools wasm-experimental && dotnet tool install --global dotnet-ef --version 8.0.6 && dotnet ef database update --project src/Bit.TemplatePlayground.Server/Bit.TemplatePlayground.Server.csproj && dotnet build src/Client/Bit.TemplatePlayground.Client.Core/Bit.TemplatePlayground.Client.Core.csproj -t:InstallNodejsDependencies,BeforeBuildTasks --no-restore",
"waitFor": "onCreateCommand",
"customizations": {
"codespaces": {
Expand Down
103 changes: 50 additions & 53 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Bit.TemplatePlayground CD
# https://bitplatform.dev/templates/dev-ops

env:
API_SERVER_ADDRESS: 'https://bp.bitplatform.dev/'
API_SERVER_ADDRESS: 'https://use-your-server-url-here.com/'
APP_SERVICE_NAME: 'app-service-bp-test'
IOS_CODE_SIGN_PROVISION: 'Bit.TemplatePlayground'

Expand All @@ -24,22 +24,22 @@ jobs:
steps:

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

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

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

# - name: Enable pre rendering
# run: sed -i 's/public static readonly bool PrerenderEnabled = false;/public static readonly bool PrerenderEnabled = true;/g' src/Client/Bit.TemplatePlayground.Client.Core/Services/AppRenderMode.cs

- name: Update appsettings.json api server address
uses: microsoft/variable-substitution@v1
uses: devops-actions/variable-substitution@v1.2
with:
files: 'src/Client/Bit.TemplatePlayground.Client.Core/appsettings.json'
env:
Expand All @@ -49,7 +49,7 @@ jobs:
run: cd src && dotnet workload install wasm-tools wasm-experimental

- name: Generate CSS/JS files
run: dotnet build src/Client/Bit.TemplatePlayground.Client.Core/Bit.TemplatePlayground.Client.Core.csproj -t:BeforeBuildTasks --no-restore
run: dotnet build src/Client/Bit.TemplatePlayground.Client.Core/Bit.TemplatePlayground.Client.Core.csproj -t:InstallNodejsDependencies,BeforeBuildTasks --no-restore

- name: Publish
run: dotnet publish src/Bit.TemplatePlayground.Server/Bit.TemplatePlayground.Server.csproj -c Release --self-contained -r linux-x64 -o ${{env.DOTNET_ROOT}}/server
Expand All @@ -59,13 +59,13 @@ jobs:
cd src/Bit.TemplatePlayground.Server/ && dotnet tool restore && dotnet ef migrations bundle --self-contained -r linux-x64 --project Bit.TemplatePlayground.Server.csproj
- name: Upload ef migrations bundle
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: migrations-bundle
path: src/Bit.TemplatePlayground.Server/efbundle

- name: Upload server artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: server-bundle
path: ${{env.DOTNET_ROOT}}/server
Expand All @@ -81,29 +81,29 @@ jobs:
steps:

- name: Retrieve server bundle
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: server-bundle

- name: Retrieve migrations bundle
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: migrations-bundle

- name: Update appsettings.json
uses: microsoft/variable-substitution@v1
uses: devops-actions/variable-substitution@v1.2
with:
files: 'appsettings.json'
env:
ConnectionStrings.SqlServerConnectionString: ${{ secrets.DB_CONNECTION_STRING }}
AppSettings.IdentitySettings.IdentityCertificatePassword: ${{ secrets.API_IDENTITY_CERTIFICATE_PASSWORD }}
ConnectionStrings_SqlServerConnectionString: ${{ secrets.DB_CONNECTION_STRING }}
AppSettings_IdentitySettings_IdentityCertificatePassword: ${{ secrets.API_IDENTITY_CERTIFICATE_PASSWORD }}

- name: Delete IdentityCertificate.pfx
run: |
rm IdentityCertificate.pfx
- name: Extract identity certificate from env
uses: timheuer/base64-to-file@v1
uses: timheuer/base64-to-file@v1.2
with:
fileDir: './'
fileName: 'IdentityCertificate.pfx'
Expand All @@ -117,7 +117,7 @@ jobs:
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
uses: azure/webapps-deploy@v3
with:
app-name: ${{ env.APP_SERVICE_NAME }}
slot-name: 'production'
Expand All @@ -131,27 +131,27 @@ jobs:
steps:

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

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

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Update appsettings.json api server address
uses: microsoft/variable-substitution@v1
uses: devops-actions/variable-substitution@v1.2
with:
files: 'src\Client\Bit.TemplatePlayground.Client.Core\appsettings.json'
env:
ApiServerAddress: ${{ env.API_SERVER_ADDRESS }}
WindowsUpdateSettings.FilesUrl: https://windows-bit.templateplayground.bitplatform.dev
WindowsUpdateSettings.FilesUrl: 'https://use-your-server-url-here.com/windows' # Deploy the published Windows application files to your desired hosting location and use the host url here.

- name: Generate CSS/JS files
run: dotnet build src\Client\Bit.TemplatePlayground.Client.Core\Bit.TemplatePlayground.Client.Core.csproj -t:BeforeBuildTasks --no-restore
run: dotnet build src\Client\Bit.TemplatePlayground.Client.Core\Bit.TemplatePlayground.Client.Core.csproj -t:InstallNodejsDependencies,BeforeBuildTasks --no-restore

- name: Publish
run: |
Expand All @@ -169,10 +169,10 @@ jobs:
echo A | xcopy .\bin\publish-x64 .\publish-result /s /e /h
echo A | xcopy .\bin\publish .\publish-result /s /e /h
dotnet tool restore
dotnet vpk pack -u Bit.TemplatePlayground.Client.Windows -v "${{ vars.APPLICATION_DISPLAY_VERSION }}" -p .\publish-result -e Bit.TemplatePlayground.Client.Windows-x86.exe -r win-x86 --framework net8.0.2-x86-desktop,webview2 --icon .\wwwroot\favicon.ico --packTitle 'Bit.TemplatePlayground'
dotnet vpk pack -u Bit.TemplatePlayground.Client.Windows -v "${{ vars.APPLICATION_DISPLAY_VERSION }}" -p .\publish-result -e Bit.TemplatePlayground.Client.Windows-x86.exe -r win-x86 --framework net8.0.6-x86-desktop,net8.0.6-x86-aspnetcore,webview2 --icon .\wwwroot\favicon.ico --packTitle 'Bit.TemplatePlayground'
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: win-exe-bundle
path: src\Client\Bit.TemplatePlayground.Client.Windows\Releases
Expand All @@ -184,26 +184,26 @@ jobs:
steps:

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

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

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Extract Android signing key from env
uses: timheuer/base64-to-file@v1
uses: timheuer/base64-to-file@v1.2
with:
fileDir: './src/Client/Bit.TemplatePlayground.Client.Maui/'
fileName: 'Bit.TemplatePlayground.keystore'
encodedString: ${{ secrets.ANDROID_RELEASE_KEYSTORE_FILE_BASE64 }}

- name: Update appsettings.json api server address
uses: microsoft/variable-substitution@v1
uses: devops-actions/variable-substitution@v1.2
with:
files: 'src/Client/Bit.TemplatePlayground.Client.Core/appsettings.json'
env:
Expand All @@ -216,7 +216,9 @@ jobs:
run: ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT "platform-tools"

- name: Generate CSS/JS files
run: dotnet build src/Client/Bit.TemplatePlayground.Client.Core/Bit.TemplatePlayground.Client.Core.csproj -t:BeforeBuildTasks --no-restore
run: |
dotnet build src/Client/Bit.TemplatePlayground.Client.Core/Bit.TemplatePlayground.Client.Core.csproj -t:InstallNodejsDependencies,BeforeBuildTasks --no-restore
dotnet build src/Client/Bit.TemplatePlayground.Client.Maui/Bit.TemplatePlayground.Client.Maui.csproj -t:BeforeBuildTasks --no-restore
- name: Build aab
run: dotnet build src/Client/Bit.TemplatePlayground.Client.Maui/Bit.TemplatePlayground.Client.Maui.csproj -c Release -p:AndroidPackageFormat=aab -p:AndroidKeyStore=true -p:AndroidSigningKeyStore="Bit.TemplatePlayground.keystore" -p:AndroidSigningKeyAlias=Bit.TemplatePlayground -p:AndroidSigningKeyPass="${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }}" -p:AndroidSigningStorePass="${{ secrets.ANDROID_RELEASE_SIGNING_PASSWORD }}" -f net8.0-android
Expand All @@ -225,72 +227,67 @@ jobs:
run: dotnet build src/Client/Bit.TemplatePlayground.Client.Maui/Bit.TemplatePlayground.Client.Maui.csproj -c Release -p:AndroidKeyStore=true -p:AndroidSigningKeyStore="Bit.TemplatePlayground.keystore" -p:AndroidSigningKeyAlias=Bit.TemplatePlayground -p:AndroidSigningKeyPass="${{ secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD }}" -p:AndroidSigningStorePass="${{ secrets.ANDROID_RELEASE_SIGNING_PASSWORD }}" -f net8.0-android

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: android-bundle
path: src/Client/Bit.TemplatePlayground.Client.Maui/bin/Release/net8.0-android/*-Signed.*

build_blazor_hybrid_iOS:
name: build blazor hybrid (iOS-macOS)
runs-on: macos-13
runs-on: macos-14

steps:

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

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

- uses: maxim-lobanov/setup-xcode@v1
- uses: maxim-lobanov/setup-xcode@v1.6.0
with:
xcode-version: '15'
xcode-version: '15.3'

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Update appsettings.json api server address
uses: microsoft/variable-substitution@v1
uses: devops-actions/variable-substitution@v1.2
with:
files: 'src/Client/Bit.TemplatePlayground.Client.Core/appsettings.json'
env:
ApiServerAddress: ${{ env.API_SERVER_ADDRESS }}

- name: Install maui
run: cd src && dotnet workload install maui

- name: Extract iOS code signing certificate from env
uses: timheuer/base64-to-file@v1
with:
fileDir: './'
fileName: 'DistributionCert.p12'
encodedString: ${{ secrets.APPSTORE_CODE_SIGNING_CERTIFICATE_FILE_BASE64 }}

- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v1
uses: apple-actions/import-codesign-certs@v3
with:
p12-filepath: './DistributionCert.p12'
p12-file-base64: ${{ secrets.APPSTORE_CODE_SIGNING_CERTIFICATE_FILE_BASE64 }}
p12-password: ${{ secrets.APPSTORE_CODE_SIGNING_CERTIFICATE_FILE_PASSWORD }}

- name: Download Apple Provisioning Profiles
uses: Apple-Actions/download-provisioning-profiles@v1
uses: Apple-Actions/download-provisioning-profiles@v3
with:
bundle-id: 'com.companyname.bit.templateplayground'
issuer-id: ${{ secrets.APPSTORE_API_KEY_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_API_KEY_PRIVATE_KEY }}

- name: Generate CSS/JS files
run: dotnet build src/Client/Bit.TemplatePlayground.Client.Core/Bit.TemplatePlayground.Client.Core.csproj -t:BeforeBuildTasks --no-restore
run: |
dotnet build src/Client/Bit.TemplatePlayground.Client.Core/Bit.TemplatePlayground.Client.Core.csproj -t:InstallNodejsDependencies,BeforeBuildTasks --no-restore
dotnet build src/Client/Bit.TemplatePlayground.Client.Maui/Bit.TemplatePlayground.Client.Maui.csproj -t:BeforeBuildTasks --no-restore
- name: Build ipa
run: dotnet publish src/Client/Bit.TemplatePlayground.Client.Maui/Bit.TemplatePlayground.Client.Maui.csproj -p:RuntimeIdentifier=ios-arm64 -c Release -p:ArchiveOnBuild=true -p:CodesignKey="iPhone Distribution" -p:CodesignProvision="${{ env.IOS_CODE_SIGN_PROVISION }}" -p:ApplicationDisplayVersion="${{ vars.APPLICATION_DISPLAY_VERSION }}" -p:ApplicationVersion="${{ vars.APPLICATION_VERSION }}" -f net8.0-ios

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: iOS-bundle
path: src/Client/Bit.TemplatePlayground.Client.Maui/bin/release/net8.0-ios/ios-arm64/publish/*.ipa
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ jobs:
steps:

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

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

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Build
run: dotnet build Bit.TemplatePlayground.sln -c Release
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.203",
"rollForward": "disable"
"version": "8.0.301",
"rollForward": "disable"
}
}
12 changes: 1 addition & 11 deletions src/Bit.TemplatePlayground.Iac/AppStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,8 @@ public AppStack()
AppCommandLine = "dotnet Bit.TemplatePlayground.Server.dll",
AppSettings = new()
{
new NameValuePairArgs { Name = "ApplicationInsights__InstrumentationKey", Value = appInsights.InstrumentationKey },
new NameValuePairArgs { Name = "APPINSIGHTS_INSTRUMENTATIONKEY", Value = appInsights.InstrumentationKey },
new NameValuePairArgs { Name = "ASPNETCORE_ENVIRONMENT", Value = stackName == "test" ? "Test" : "Production" },
new NameValuePairArgs { Name = "APPLICATIONINSIGHTS_CONNECTION_STRING", Value = appInsights.ConnectionString },
new NameValuePairArgs { Name = "APPINSIGHTS_PROFILERFEATURE_VERSION", Value = "disabled" },
new NameValuePairArgs { Name = "APPINSIGHTS_SNAPSHOTFEATURE_VERSION", Value = "disabled" },
new NameValuePairArgs { Name = "ApplicationInsightsAgent_EXTENSION_VERSION", Value = "~3" },
new NameValuePairArgs { Name = "XDT_MicrosoftApplicationInsights_BaseExtensions", Value = "~1" },
new NameValuePairArgs { Name = "InstrumentationEngine_EXTENSION_VERSION", Value = "~1" },
new NameValuePairArgs { Name = "SnapshotDebugger_EXTENSION_VERSION", Value = "disabled"},
new NameValuePairArgs { Name = "XDT_MicrosoftApplicationInsights_Mode", Value = "recommended" },
new NameValuePairArgs { Name = "XDT_MicrosoftApplicationInsights_PreemptSdk", Value = "disabled" },
new NameValuePairArgs { Name = "APPLICATIONINSIGHTS_CONNECTIONSTRING", Value = appInsights.ConnectionString },
new NameValuePairArgs { Name = "AppSettings__EmailSettings__DefaultFromEmail", Value = defaultEmailFrom },
new NameValuePairArgs { Name = "AppSettings__EmailSettings__Host", Value = emailServerHost },
new NameValuePairArgs { Name = "AppSettings__EmailSettings__Port", Value = emailServerPort },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pulumi.AzureNative" Version="2.34.0" />
<PackageReference Include="Pulumi.AzureNative" Version="2.42.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.3",
"version": "8.0.6",
"commands": [
"dotnet-ef"
]
Expand Down
Loading

0 comments on commit 567b428

Please sign in to comment.