Skip to content

Commit

Permalink
feat: update to bit 8.2.0 #31 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi authored Dec 4, 2023
1 parent 4dfcb05 commit 6faa810
Show file tree
Hide file tree
Showing 372 changed files with 3,650 additions and 4,854 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"hostRequirements": {
"cpus": 4
},
"onCreateCommand": "wget https://download.visualstudio.microsoft.com/download/pr/5226a5fa-8c0b-474f-b79a-8984ad7c5beb/3113ccbf789c9fd29972835f0f334b7a/dotnet-sdk-8.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 && dotnet dev-certs https --trust && dotnet tool install --global dotnet-ef --version 8.0.0 && dotnet ef database update --project src/Server/Api/Bit.TemplatePlayground.Server.Api.csproj && dotnet build src/Client/Web/Bit.TemplatePlayground.Client.Web.csproj -t:BeforeBuildTasks --no-restore",
"onCreateCommand": "wget https://download.visualstudio.microsoft.com/download/pr/5226a5fa-8c0b-474f-b79a-8984ad7c5beb/3113ccbf789c9fd29972835f0f334b7a/dotnet-sdk-8.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 && dotnet dev-certs https --trust && sudo dotnet workload install wasm-tools wasm-experimental && dotnet tool install --global dotnet-ef --version 8.0.0 && 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",
"waitFor": "onCreateCommand",
"customizations": {
"codespaces": {
"openFiles": [
"src/Client/Core/Pages/HomePage.razor"
"src/Client/Bit.TemplatePlayground.Client.Core/Components/Pages/HomePage.razor"
]
},
"vscode": {
Expand Down
118 changes: 33 additions & 85 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Bit.TemplatePlayground CD
# https://bitplatform.dev/templates/dev-ops

env:
WEB_APP_DEPLOYMENT_TYPE: 'Spa'
API_SERVER_ADDRESS: 'https://bp.bitplatform.dev/api/'
APP_SERVICE_NAME: 'app-service-bp-test'
IOS_CODE_SIGN_PROVISION: 'Bit.TemplatePlayground'
Expand All @@ -18,8 +17,8 @@ permissions:

jobs:

build_blazor_api_wasm:
name: build blazor api + web assembly
build_api_blazor:
name: build api + blazor
runs-on: ubuntu-22.04

steps:
Expand All @@ -39,52 +38,49 @@ jobs:
- name: Update appsettings.json api server address
uses: microsoft/variable-substitution@v1
with:
files: 'src/Client/Core/appsettings.json'
files: 'src/Client/Bit.TemplatePlayground.Client.Core/appsettings.json'
env:
ApiServerAddress: ${{ env.API_SERVER_ADDRESS }}

- name: Switch to blazor web assembly
run: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' src/Client/Web/Bit.TemplatePlayground.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/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:BeforeBuildTasks --no-restore

- name: Publish
run: dotnet publish src/Server/Api/Bit.TemplatePlayground.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 src/Bit.TemplatePlayground.Server/Bit.TemplatePlayground.Server.csproj -c Release --self-contained -r linux-x64 -o ${{env.DOTNET_ROOT}}/server

- name: Build migrations bundle
run: |
cd src/Server/Api/ && dotnet tool restore && dotnet ef migrations bundle --self-contained -r linux-x64 --project Bit.TemplatePlayground.Server.Api.csproj
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
with:
name: migrations-bundle
path: src/Server/Api/efbundle
path: src/Bit.TemplatePlayground.Server/efbundle

- name: Upload api-web artifact
- name: Upload server artifact
uses: actions/upload-artifact@v3
with:
name: api-web-bundle
path: ${{env.DOTNET_ROOT}}/api-web
name: server-bundle
path: ${{env.DOTNET_ROOT}}/server

deploy_blazor_api_wasm:
name: deploy blazor api + web assembly
needs: build_blazor_api_wasm
deploy_api_blazor:
name: deploy api + blazor
needs: build_api_blazor
runs-on: ubuntu-22.04
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:

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

- name: Retrieve migrations bundle
uses: actions/download-artifact@v2
Expand Down Expand Up @@ -146,24 +142,24 @@ jobs:
- name: Update appsettings.json api server address
uses: microsoft/variable-substitution@v1
with:
files: 'src/Client/Core/appsettings.json'
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: Generate CSS/JS files
run: dotnet build src/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:BeforeBuildTasks --no-restore

- name: Build exe
run: dotnet build src/Client/App/Bit.TemplatePlayground.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:UseRidGraph=true -f net8.0-windows10.0.19041.0
run: dotnet build src/Client/Bit.TemplatePlayground.Client.Maui/Bit.TemplatePlayground.Client.Maui.csproj -c Release -p:WindowsPackageType=None -p:SelfContained=true -p:WindowsAppSDKSelfContained=true -p:GenerateAppxPackageOnBuild=false -p:RuntimeIdentifier=win10-x86 -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/Client/App/bin/release/net8.0-windows10.0.19041.0/win10-x86
path: src/Client/Bit.TemplatePlayground.Client.Maui/bin/release/net8.0-windows10.0.19041.0/win10-x86

build_blazor_hybrid_android:
name: build blazor hybrid (android)
Expand All @@ -186,34 +182,34 @@ jobs:
- name: Extract Android signing key from env
uses: timheuer/base64-to-file@v1
with:
fileDir: './src/Client/App/'
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
with:
files: 'src/Client/Core/appsettings.json'
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-android

- name: Generate CSS/JS files
run: dotnet build src/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:BeforeBuildTasks --no-restore

- name: Build aab
run: dotnet build src/Client/App/Bit.TemplatePlayground.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=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
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

- name: Build apk
run: dotnet build src/Client/App/Bit.TemplatePlayground.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=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
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
with:
name: android-bundle
path: src/Client/App/bin/Release/net8.0-android/*-Signed.*
path: src/Client/Bit.TemplatePlayground.Client.Maui/bin/Release/net8.0-android/*-Signed.*

build_blazor_hybrid_maccatalyst:
name: build blazor hybrid (maccatalyst)
Expand All @@ -236,24 +232,24 @@ jobs:
- name: Update appsettings.json api server address
uses: microsoft/variable-substitution@v1
with:
files: 'src/Client/Core/appsettings.json'
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: Generate CSS/JS files
run: dotnet build src/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:BeforeBuildTasks --no-restore

- name: Build pkg
run: dotnet build src/Client/App/Bit.TemplatePlayground.Client.App.csproj -p:BlazorMode=BlazorHybrid -p:Configuration=Release -p:CreatePackage=true -f net8.0-maccatalyst
run: dotnet build src/Client/Bit.TemplatePlayground.Client.Maui/Bit.TemplatePlayground.Client.Maui.csproj -c Release -p:CreatePackage=true -f net8.0-maccatalyst

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: mac-pkg-bundle
path: src/Client/App/bin/release/net8.0-maccatalyst/*.pkg
path: src/Client/Bit.TemplatePlayground.Client.Maui/bin/release/net8.0-maccatalyst/*.pkg

build_blazor_hybrid_iOS:
name: build blazor hybrid (iOS)
Expand All @@ -280,7 +276,7 @@ jobs:
- name: Update appsettings.json api server address
uses: microsoft/variable-substitution@v1
with:
files: 'src/Client/Core/appsettings.json'
files: 'src/Client/Bit.TemplatePlayground.Client.Core/appsettings.json'
env:
ApiServerAddress: ${{ env.API_SERVER_ADDRESS }}

Expand Down Expand Up @@ -309,61 +305,13 @@ jobs:
api-private-key: ${{ secrets.APPSTORE_API_KEY_PRIVATE_KEY }}

- name: Generate CSS/JS files
run: dotnet build src/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:BeforeBuildTasks --no-restore

- name: Build ipa
run: dotnet publish src/Client/App/Bit.TemplatePlayground.Client.App.csproj -p:RuntimeIdentifier=ios-arm64 -p:BlazorMode=BlazorHybrid -p:Configuration=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
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
with:
name: iOS-bundle
path: src/Client/App/bin/release/net8.0-ios/ios-arm64/publish/*.ipa

build_blazor_electron_linux:
name: build blazor electron (linux)
runs-on: ubuntu-22.04

steps:

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

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

- name: Setup .NET for Electron.NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.x.x'

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

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

- name: Switch to BlazorElectron
run: awk '/<BlazorMode>/{sub(">.*</", ">BlazorElectron</")}1' src/Directory.Build.props > temp.xml && mv temp.xml src/Directory.Build.props

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

- name: Restore electron .net
run: dotnet build src/Client/Web/Bit.TemplatePlayground.Client.Web.csproj -t:BeforeBuildTasks

- name: Build app image
run: cd src/Client/Web/ && dotnet electronize build /target linux

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: linux-app-image
path: src/Client/Web/bin/Desktop/linux-unpacked
path: src/Client/Bit.TemplatePlayground.Client.Maui/bin/release/net8.0-ios/ios-arm64/publish/*.ipa
Loading

0 comments on commit 6faa810

Please sign in to comment.