Skip to content

Commit 25a75e3

Browse files
Setting up build process
1 parent 993a38c commit 25a75e3

File tree

13 files changed

+233
-2
lines changed

13 files changed

+233
-2
lines changed

Directory.Build.props

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<Project>
2+
<PropertyGroup>
3+
<TargetFramework>net9.0</TargetFramework>
4+
<Nullable>enable</Nullable>
5+
<Company>Umbraco HQ</Company>
6+
<Authors>Umbraco</Authors>
7+
<Copyright>Copyright © Umbraco $([System.DateTime]::Today.ToString('yyyy'))</Copyright>
8+
<Product>Umbraco Commerce Cart</Product>
9+
<PackageProjectUrl>https://github.com/umbraco/Umbraco.Commerce.Cart</PackageProjectUrl>
10+
<PackageIcon>logo-128.png</PackageIcon>
11+
<PackageTags>umbraco commerce cart umbraco-marketplace</PackageTags>
12+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
13+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
14+
<NeutralLanguage>en-US</NeutralLanguage>
15+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
16+
<AnalysisMode>All</AnalysisMode>
17+
</PropertyGroup>
18+
19+
<!-- NuGet packages lock -->
20+
<PropertyGroup>
21+
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
22+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
23+
<DefaultItemExcludes>$(DefaultItemExcludes);packages.lock.json</DefaultItemExcludes>
24+
</PropertyGroup>
25+
26+
<!-- SourceLink -->
27+
<PropertyGroup>
28+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
29+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
30+
<IncludeSymbols>true</IncludeSymbols>
31+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
32+
</PropertyGroup>
33+
34+
<!-- Package validation -->
35+
<PropertyGroup>
36+
<EnablePackageValidation>false</EnablePackageValidation>
37+
<PackageValidationBaselineVersion>15.0.0</PackageValidationBaselineVersion>
38+
<EnableStrictModeForCompatibleFrameworksInPackage>true</EnableStrictModeForCompatibleFrameworksInPackage>
39+
<EnableStrictModeForCompatibleTfms>true</EnableStrictModeForCompatibleTfms>
40+
</PropertyGroup>
41+
42+
<ItemGroup>
43+
<Content Include="$(MSBuildThisFileDirectory)\assets\logo-128.png" Pack="true" PackagePath="" Visible="false" />
44+
<Content Include="$(MSBuildThisFileDirectory)\LICENSE.md" Pack="true" PackagePath="" Visible="false" />
45+
</ItemGroup>
46+
47+
<PropertyGroup>
48+
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
49+
</PropertyGroup>
50+
</Project>

Directory.Packages.props

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project>
2+
<PropertyGroup>
3+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
7+
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" />
8+
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507" />
9+
<GlobalPackageReference Include="Umbraco.Code" Version="[2.2.0, 3)" />
10+
<GlobalPackageReference Include="Umbraco.GitVersioning.Extensions" Version="0.2.0" />
11+
</ItemGroup>
12+
<ItemGroup>
13+
<PackageVersion Include="Umbraco.Commerce.Cms" Version="[15, 15.999.999)" />
14+
</ItemGroup>
15+
</Project>

LICENSE renamed to LICENSE.md

File renamed without changes.

assets/cart.png

295 KB
Loading

assets/logo-128.png

6.27 KB
Loading

assets/logo-320.png

13.3 KB
Loading

assets/logo-64.png

3.69 KB
Loading

azure-pipelines.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
2+
3+
trigger:
4+
branches:
5+
include:
6+
- dev
7+
- release/*
8+
- hotfix/*
9+
- support/*
10+
tags:
11+
include:
12+
- release-*
13+
14+
parameters:
15+
- name: cache_npm
16+
displayName: Cache NPM packages
17+
type: boolean
18+
default: true
19+
- name: cache_nuget
20+
displayName: Cache NuGet packages
21+
type: boolean
22+
default: false
23+
24+
variables:
25+
nodeVersion: 20.x
26+
solution: Umbraco.Commerce.Cart.sln
27+
buildConfiguration: Release
28+
DOTNET_NOLOGO: true
29+
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
30+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
31+
DOTNET_CLI_TELEMETRY_OPTOUT: true
32+
33+
stages:
34+
- stage: Build
35+
variables:
36+
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
37+
npm_config_cache: $(Pipeline.Workspace)/.npm_client
38+
jobs:
39+
- job: Build
40+
pool:
41+
vmImage: ubuntu-latest
42+
steps:
43+
# Checkout source (avoid shallow clone to calculate version height)
44+
- checkout: self
45+
fetchDepth: 0
46+
47+
# Setup build environment
48+
- task: NuGetAuthenticate@1
49+
displayName: Authenticate NuGet
50+
51+
- task: NodeTool@0
52+
displayName: Use Node.js $(nodeVersion)
53+
inputs:
54+
versionSpec: $(nodeVersion)
55+
56+
- task: UseDotNet@2
57+
displayName: Use .NET SDK from global.json
58+
inputs:
59+
useGlobalJson: true
60+
61+
# Cache and restore NPM packages
62+
- task: Cache@2
63+
condition: ${{ parameters.cache_npm }}
64+
displayName: Cache NPM packages
65+
inputs:
66+
key: 'npm | "$(Agent.OS)" | **/package-lock.json, !**/node_modules/**'
67+
restoreKeys: |
68+
npm | "$(Agent.OS)"
69+
npm
70+
path: $(npm_config_cache)
71+
72+
- task: CmdLine@2
73+
displayName: 'Install NPM packages'
74+
inputs:
75+
script: 'npm ci --no-fund --no-audit --prefer-offline'
76+
workingDirectory: '$(Build.SourcesDirectory)/src/Umbraco.Commerce.Cart/Client'
77+
78+
- task: CmdLine@2
79+
displayName: 'Build frontend'
80+
inputs:
81+
workingDirectory: $(Build.SourcesDirectory)/src/Umbraco.Commerce.Cart/Client
82+
script: 'npm run build'
83+
84+
# Cache and restore NuGet packages
85+
- task: Cache@2
86+
condition: ${{ parameters.cache_nuget }}
87+
displayName: Cache NuGet packages
88+
inputs:
89+
key: 'nuget | "$(Agent.OS)" | **/packages.lock.json, !**/bin/**, !**/obj/**'
90+
restoreKeys: |
91+
nuget | "$(Agent.OS)"
92+
nuget
93+
path: $(NUGET_PACKAGES)
94+
95+
- script: dotnet restore $(solution) --locked-mode
96+
displayName: Restore NuGet packages
97+
98+
# Build
99+
- script: dotnet build $(solution) --configuration $(buildConfiguration) --no-restore -p:ContinuousIntegrationBuild=true
100+
displayName: Run dotnet build
101+
102+
# Pack
103+
- script: dotnet pack $(solution) --configuration $(buildConfiguration) --no-build --output $(Build.ArtifactStagingDirectory)/nupkg
104+
displayName: Run dotnet pack
105+
106+
# Publish
107+
- task: PublishPipelineArtifact@1
108+
displayName: Publish NuGet packages
109+
inputs:
110+
targetPath: $(Build.ArtifactStagingDirectory)/nupkg
111+
artifactName: nupkg
112+
113+
- task: PublishPipelineArtifact@1
114+
displayName: Publish build output
115+
inputs:
116+
targetPath: $(Build.SourcesDirectory)
117+
artifactName: build_output

global.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"sdk": {
3+
"version": "9.0.100",
4+
"rollForward": "latestFeature"
5+
}
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"id": "Umbraco.Commerce.Cart",
3+
"name": "Umbraco Commerce Cart",
4+
"version": "15.0.0",
5+
"allowPackageTelemetry": true,
6+
"extensions": [ ]
7+
}

0 commit comments

Comments
 (0)