-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathazure-pipelines.yml
92 lines (77 loc) · 2.9 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: $(version).$(Build.BuildId)
variables:
WEB_APP_DEPLOYMENT_TYPE: 'DefaultDeploymentType'
jobs:
- job: build_blazor_api_wasm
displayName: 'build blazor api + web assembly'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Assembly-Info-NetCore@3
displayName: 'Set Assembly Manifest Data'
inputs:
Company: Cs Internship
Product: Cs System
VersionNumber: '$(Build.BuildNumber)'
FileVersionNumber: '$(Build.BuildNumber)'
InformationalVersion: '$(Build.BuildNumber)'
PackageVersion: '$(Build.BuildNumber)'
- task: UseDotNet@2
displayName: 'Setup .NET'
inputs:
useGlobalJson: true
workingDirectory: 'src'
- task: UseDotNet@2
displayName: 'Use dotnet sdk 6.x for LibSassBuilder'
inputs:
version: 6.x
- task: Bash@3
displayName: 'Restore workloads'
inputs:
targetType: 'inline'
script: 'dotnet workload restore src/CrystallineSociety/Client/Web/CrystallineSociety.Client.Web.csproj -p:BlazorMode=BlazorWebAssembly'
- task: Bash@3
displayName: 'Switch to blazor web assembly'
inputs:
targetType: 'inline'
script: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' src/CrystallineSociety/Client/Web/CrystallineSociety.Client.Web.csproj
- task: Bash@3
displayName: 'Build migrations bundle'
inputs:
targetType: 'inline'
script: |
dotnet tool install --global dotnet-ef --version 7.0.0
dotnet ef migrations bundle --self-contained -r linux-x64 --project src/CrystallineSociety/Server/Api/CrystallineSociety.Server.Api.csproj
failOnStderr: true
- task: Bash@3
displayName: 'Install wasm-tools'
inputs:
targetType: 'inline'
script: dotnet workload install wasm-tools
- task: Bash@3
displayName: 'Build (To generate CSS/JS files)'
inputs:
targetType: 'inline'
script: 'dotnet build src/CrystallineSociety/Client/Web/CrystallineSociety.Client.Web.csproj -p:Configuration=Release -p:BlazorMode=BlazorWebAssembly -p:WebAppDeploymentType="${{ variables.WEB_APP_DEPLOYMENT_TYPE }}"'
- task: Bash@3
displayName: 'Publish'
inputs:
targetType: 'inline'
script: 'dotnet publish src/CrystallineSociety/Server/Api/CrystallineSociety.Server.Api.csproj -p:BlazorMode=BlazorWebAssembly -p:WebAppDeploymentType="${{ variables.WEB_APP_DEPLOYMENT_TYPE }}" -p:Configuration=Release -o api-web'
- task: PublishPipelineArtifact@1
displayName: Upload api-web artifact
inputs:
targetPath: 'api-web'
artifact: 'api-web-bundle'
publishLocation: 'pipeline'
- task: PublishPipelineArtifact@1
displayName: Upload ef migrations bundle
inputs:
targetPath: 'efbundle'
artifact: 'migrations-bundle'
publishLocation: 'pipeline'
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'Dockerfile'
artifact: 'Docker'
publishLocation: 'pipeline'