Skip to content

Commit 1db9fcd

Browse files
authored
Merge pull request #48 from umbraco/feature/build-on-mac
Remove v8, build on Mac and update to v15
2 parents fb6b70e + b9483de commit 1db9fcd

File tree

189 files changed

+12563
-8045
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+12563
-8045
lines changed

.github/workflows/build.yml

+17-21
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,50 @@ name: Build
33
on:
44
push:
55
branches:
6-
- master
76
- main
7+
- develop
8+
- support/*
9+
tags:
10+
- v*
811
pull_request:
912
branches:
10-
- master
1113
- main
14+
- develop
15+
- support/*
1216
workflow_call:
1317

1418
env:
1519
DOTNET_NOLOGO: true
1620
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
1721
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
18-
PROJECT: ./src/Our.Umbraco.UiExamples/Our.Umbraco.UiExamples.csproj
19-
OUTPUT: ./dist
22+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
2023

2124
jobs:
2225
build:
2326
name: Build
24-
runs-on: windows-latest
27+
runs-on: ubuntu-latest
2528

2629
steps:
2730
- name: Checkout
28-
uses: actions/checkout@v2
31+
uses: actions/checkout@v4
2932
with:
3033
fetch-depth: 0
3134

32-
- name: Cache NuGet packages
33-
uses: actions/cache@v1
35+
- uses: actions/setup-dotnet@v4
3436
with:
35-
path: ~/.nuget/packages
36-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
37-
restore-keys: |
38-
${{ runner.os }}-nuget-
37+
cache: true
38+
cache-dependency-path: '**/package-lock.json'
3939

4040
- name: Restore
41-
run: dotnet restore ${{ env.PROJECT }} --locked-mode
41+
run: dotnet restore --locked-mode
4242

4343
- name: Build
44-
run: dotnet build ${{ env.PROJECT }} -c Release -p:ContinuousIntegrationBuild=true --no-restore
45-
46-
- name: Setup UmbPack
47-
run: dotnet tool install --tool-path $(Split-Path ${{ env.PROJECT }}) Umbraco.Tools.Packages
44+
run: dotnet build --configuration Release --property:ContinuousIntegrationBuild=true --no-restore
4845

4946
- name: Pack
50-
run: dotnet pack ${{ env.PROJECT }} -c Release -o ${{ env.OUTPUT }} --no-restore --no-build
47+
run: dotnet pack --configuration Release --no-restore --no-build --output ./artifacts/
5148

5249
- name: Upload artifacts
53-
uses: actions/upload-artifact@v2
50+
uses: actions/upload-artifact@v4
5451
with:
55-
name: packages
56-
path: ${{ env.OUTPUT }}
52+
path: ./artifacts/

.github/workflows/prepare-release.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ on:
77
description: 'The prerelease tag to apply on the release branch (if any). If not specified, any existing prerelease tag will be removed.'
88
required: false
99
default: ''
10-
type: choice
11-
options:
12-
- ''
13-
- 'beta'
14-
- 'rc'
10+
type: string
1511
versionIncrement:
1612
description: 'Overrides the versionIncrement setting set in version.json for determining the next version of the current branch.'
1713
required: false
@@ -31,11 +27,11 @@ env:
3127
jobs:
3228
prepare-release:
3329
name: Prepare release
34-
runs-on: windows-latest
30+
runs-on: ubuntu-latest
3531

3632
steps:
3733
- name: Checkout
38-
uses: actions/checkout@v2
34+
uses: actions/checkout@v4
3935
with:
4036
fetch-depth: 0
4137

@@ -45,14 +41,14 @@ jobs:
4541
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
4642
4743
- name: Setup Nerdbank.GitVersioning
48-
run: dotnet tool install --tool-path . nbgv
44+
run: dotnet tool install nbgv --tool-path ./artifacts/
4945

5046
- name: Prepare release
5147
run: |
5248
if ("${{ github.event.inputs.versionIncrement }}") {
53-
./nbgv prepare-release ${{ github.event.inputs.tag }} -p src --versionIncrement ${{ github.event.inputs.versionIncrement }}
49+
./artifacts/nbgv prepare-release ${{ github.event.inputs.tag }} --versionIncrement ${{ github.event.inputs.versionIncrement }}
5450
} else {
55-
./nbgv prepare-release ${{ github.event.inputs.tag }} -p src
51+
./artifacts/nbgv prepare-release ${{ github.event.inputs.tag }}
5652
}
5753
5854
- name: Push commit (and new branch)

.github/workflows/publish-release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ env:
1111
jobs:
1212
publish-release:
1313
name: Publish release
14-
runs-on: windows-latest
14+
runs-on: ubuntu-latest
1515

1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
2121

@@ -25,10 +25,10 @@ jobs:
2525
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
2626
2727
- name: Setup Nerdbank.GitVersioning
28-
run: dotnet tool install --tool-path . nbgv
28+
run: dotnet tool install nbgv --tool-path ./artifacts/
2929

3030
- name: Tag release
31-
run: ./nbgv tag -p src
31+
run: ./artifacts/nbgv tag
3232

3333
- name: Push git tags
3434
run: git push --tags

.github/workflows/publish.yml

+3-17
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,16 @@ env:
1212
jobs:
1313
build:
1414
name: Build
15-
uses: umbraco/UI-Examples/.github/workflows/build.yml@master
15+
uses: umbraco/UI-Examples/.github/workflows/build.yml@${GITHUB_REF}
1616

1717
publish:
1818
name: Publish
1919
needs: build
20-
runs-on: windows-latest
20+
runs-on: ubuntu-latest
2121

2222
steps:
2323
- name: Download artifacts
24-
uses: actions/download-artifact@v2
25-
with:
26-
name: packages
27-
28-
- name: Get Umbraco package file name
29-
id: get_package
30-
run: echo "::set-output name=PACKAGE::$(Get-Item *.zip | Select-Object -First 1 -ExpandProperty Name)"
31-
32-
- name: Setup UmbPack
33-
if: steps.get_package.outputs.PACKAGE
34-
run: dotnet tool install --tool-path . Umbraco.Tools.Packages
35-
36-
- name: Push to Our.Umbraco
37-
if: steps.get_package.outputs.PACKAGE
38-
run: ./umbpack push ${{ steps.get_package.outputs.PACKAGE }} -k ${{ secrets.OURUMBRACO_API_KEY }} -a *
24+
uses: actions/download-artifact@v4
3925

4026
- name: Push to NuGet
4127
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate

.gitignore

+4-5
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,7 @@ FodyWeavers.xsd
380380
**/Media/**
381381
!**/Media/Web.config
382382

383-
# Ignore the copied App_Plugins folder
384-
samples/*/App_Plugins/uiexamples/*
385-
/samples/Umbraco14.Website/App_Plugins
386-
387-
/samples/Umbraco14.Website/App_Plugins/Example.UI
383+
# Ignore the copied App_Plugins folder and appsettings-schema.json files
384+
/examples/*/App_Plugins/**
385+
/examples/*/appsettings-schema.json
386+
/examples/*/appsettings-schema.*.json

CONTRIBUTING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ If you want to add more UI examples to this package, please [raise an issue](./i
33

44
## Working locally
55
Open the solution file `UI Examples.sln` in Visual Studio. You will see three projects:
6-
- `Our.Umbraco.UiExamples` is the main project containing the files that you will be working with
7-
- `Umbraco8.Website` is an Umbraco v8 test site
8-
- `Umbraco9.Website` is an Umbraco v9 test site
9-
- `Umbraco14.Website` is an Umbraco v14 test site
6+
- `Our.Umbraco.UiExamples.v13` is the main project containing the files that you will be working with for v13
7+
- `Our.Umbraco.UiExamples.v15` is the main project containing the files that you will be working with for v15
8+
- `Umbraco13.Website` is an Umbraco v13 LTS test site
9+
- `Umbraco15.Website` is an Umbraco v15 STS test site
1010

1111
Steps to get the test sites working:
1212
- Build the solution
@@ -15,7 +15,7 @@ Steps to get the test sites working:
1515
- Username: [email protected]
1616
- Password: 1234567890
1717

18-
For v14 you will also need to run `npm ci` within the `src\Our.Umbraco.UiExamples.v14` directory, and then `npm run dev` to start the development batch job. This will copy the files from the package into `samples\Umbraco14.Website` ready to see in the backoffice.
18+
For v115 you will also need to run `npm ci` within the `src\Our.Umbraco.UiExamples.v15` directory, and then `npm run dev` to start the development batch job. This will copy the files from the package into `examples\Umbraco15.Website` ready to see in the backoffice.
1919

2020
## Making changes
2121
The files you will be working on are in the `App_Plugins` folder in the main `Our.Umbraco.UiExamples` project. Changed files need to be copied into the test websites so you can confirm they work, which is automatically done when building the test websites (using a MSBuild target).

Directory.Build.props

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<PropertyGroup>
4+
<Title>Umbraco UI Examples</Title>
5+
<Description>A collection of backoffice elements designed to help Umbraco developers extend the backoffice.</Description>
6+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
7+
<PackageTags>umbraco ui examples</PackageTags>
8+
<RepositoryUrl>https://github.com/umbraco/UI-Examples</RepositoryUrl>
9+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
10+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
11+
<IncludeSymbols>true</IncludeSymbols>
12+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
13+
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
14+
</PropertyGroup>
15+
<PropertyGroup>
16+
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
17+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
18+
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
19+
</PropertyGroup>
20+
</Project>

Directory.Packages.props

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
</PropertyGroup>
6+
<!-- Global packages (private, build-time packages for all projects) -->
7+
<ItemGroup>
8+
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.7.115" />
9+
</ItemGroup>
10+
</Project>

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Umbraco UI Examples
22
> [!IMPORTANT]
3-
> Hey you! Are you looking to get involved in development of the Umbraco 14 version? Head over to the [issues tagged with Umbraco 14](https://github.com/umbraco/UI-Examples/issues?q=is%3Aissue+is%3Aopen+label%3A%22Umbraco+14%22) ripe for the picking.
3+
> Hey you! Are you looking to get involved in development of the Umbraco 14 version? Head over to the [issues tagged with Umbraco 15](https://github.com/umbraco/UI-Examples/issues?q=is%3Aissue+is%3Aopen+label%3A%22Umbraco+15%22) ripe for the picking.
44
55
UI Examples is a package that adds a new 'UI Examples' section to your Umbraco instance with working examples of how to customise the backoffice. During installation the Administrators user group will be given access to the section.
66

UI Examples.sln

+24-21
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,38 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{318FCC8D-7A91-4CAB-BA56-DBDC730BD532}"
7+
ProjectSection(SolutionItems) = preProject
8+
examples\README.md = examples\README.md
9+
EndProjectSection
10+
EndProject
11+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco13.Website", "examples\Umbraco13.Website\Umbraco13.Website.csproj", "{7C6C2FFA-25A4-4CC4-9AA1-49B2DFB68DFC}"
12+
EndProject
13+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco15.Website", "examples\Umbraco15.Website\Umbraco15.Website.csproj", "{D9B26368-94C2-4A90-B84C-506411254F9D}"
14+
EndProject
615
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6C66805F-8D60-40A9-AD57-856E38793846}"
716
ProjectSection(SolutionItems) = preProject
817
.gitattributes = .gitattributes
918
.gitignore = .gitignore
10-
.github\workflows\build.yml = .github\workflows\build.yml
1119
CONTRIBUTING.md = CONTRIBUTING.md
12-
.github\workflows\prepare-release.yml = .github\workflows\prepare-release.yml
13-
.github\workflows\publish-release.yml = .github\workflows\publish-release.yml
14-
.github\workflows\publish.yml = .github\workflows\publish.yml
20+
Directory.Build.props = Directory.Build.props
21+
Directory.Packages.props = Directory.Packages.props
22+
global.json = global.json
23+
nuget.config = nuget.config
1524
README.md = README.md
16-
src\version.json = src\version.json
25+
version.json = version.json
1726
EndProjectSection
1827
EndProject
19-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Our.Umbraco.UiExamples", "src\Our.Umbraco.UiExamples\Our.Umbraco.UiExamples.csproj", "{027820BF-156B-476F-A7AF-2E6A747D292E}"
28+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Our.Umbraco.UiExamples.v13", "src\Our.Umbraco.UiExamples.v13\Our.Umbraco.UiExamples.v13.csproj", "{027820BF-156B-476F-A7AF-2E6A747D292E}"
2029
EndProject
21-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco8.Website", "samples\Umbraco8.Website\Umbraco8.Website.csproj", "{278F12BA-8B25-46AE-8BB0-A0B9AB50EEA4}"
22-
EndProject
23-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco9.Website", "samples\Umbraco9.Website\Umbraco9.Website.csproj", "{7C6C2FFA-25A4-4CC4-9AA1-49B2DFB68DFC}"
24-
EndProject
25-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco14.Website", "samples\Umbraco14.Website\Umbraco14.Website.csproj", "{D9B26368-94C2-4A90-B84C-506411254F9D}"
26-
EndProject
27-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Our.Umbraco.UiExamples.v14", "src\Our.Umbraco.UiExamples.v14\Our.Umbraco.UiExamples.v14.csproj", "{E99F9B42-9A45-4008-8BD7-002444460335}"
30+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Our.Umbraco.UiExamples.v15", "src\Our.Umbraco.UiExamples.v15\Our.Umbraco.UiExamples.v15.csproj", "{E99F9B42-9A45-4008-8BD7-002444460335}"
2831
EndProject
2932
Global
3033
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3134
Debug|Any CPU = Debug|Any CPU
3235
Release|Any CPU = Release|Any CPU
3336
EndGlobalSection
3437
GlobalSection(ProjectConfigurationPlatforms) = postSolution
35-
{027820BF-156B-476F-A7AF-2E6A747D292E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36-
{027820BF-156B-476F-A7AF-2E6A747D292E}.Debug|Any CPU.Build.0 = Debug|Any CPU
37-
{027820BF-156B-476F-A7AF-2E6A747D292E}.Release|Any CPU.ActiveCfg = Release|Any CPU
38-
{027820BF-156B-476F-A7AF-2E6A747D292E}.Release|Any CPU.Build.0 = Release|Any CPU
39-
{278F12BA-8B25-46AE-8BB0-A0B9AB50EEA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
40-
{278F12BA-8B25-46AE-8BB0-A0B9AB50EEA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
41-
{278F12BA-8B25-46AE-8BB0-A0B9AB50EEA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
42-
{278F12BA-8B25-46AE-8BB0-A0B9AB50EEA4}.Release|Any CPU.Build.0 = Release|Any CPU
4338
{7C6C2FFA-25A4-4CC4-9AA1-49B2DFB68DFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4439
{7C6C2FFA-25A4-4CC4-9AA1-49B2DFB68DFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
4540
{7C6C2FFA-25A4-4CC4-9AA1-49B2DFB68DFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -48,6 +43,10 @@ Global
4843
{D9B26368-94C2-4A90-B84C-506411254F9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
4944
{D9B26368-94C2-4A90-B84C-506411254F9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
5045
{D9B26368-94C2-4A90-B84C-506411254F9D}.Release|Any CPU.Build.0 = Release|Any CPU
46+
{027820BF-156B-476F-A7AF-2E6A747D292E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47+
{027820BF-156B-476F-A7AF-2E6A747D292E}.Debug|Any CPU.Build.0 = Debug|Any CPU
48+
{027820BF-156B-476F-A7AF-2E6A747D292E}.Release|Any CPU.ActiveCfg = Release|Any CPU
49+
{027820BF-156B-476F-A7AF-2E6A747D292E}.Release|Any CPU.Build.0 = Release|Any CPU
5150
{E99F9B42-9A45-4008-8BD7-002444460335}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5251
{E99F9B42-9A45-4008-8BD7-002444460335}.Debug|Any CPU.Build.0 = Debug|Any CPU
5352
{E99F9B42-9A45-4008-8BD7-002444460335}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -56,6 +55,10 @@ Global
5655
GlobalSection(SolutionProperties) = preSolution
5756
HideSolutionNode = FALSE
5857
EndGlobalSection
58+
GlobalSection(NestedProjects) = preSolution
59+
{7C6C2FFA-25A4-4CC4-9AA1-49B2DFB68DFC} = {318FCC8D-7A91-4CAB-BA56-DBDC730BD532}
60+
{D9B26368-94C2-4A90-B84C-506411254F9D} = {318FCC8D-7A91-4CAB-BA56-DBDC730BD532}
61+
EndGlobalSection
5962
GlobalSection(ExtensibilityGlobals) = postSolution
6063
SolutionGuid = {FE8099F5-7725-409F-A884-D50A8747C561}
6164
EndGlobalSection

examples/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Getting started with the examples
2+
3+
To get started, open the `UI Examples.sln` file in the root and run one of the websites within the `Examples` folder.
4+
5+
The project will boot into an empty Umbraco site. Navigate to the backoffice and user the credentials in the `appsettings.json` to login.
6+
7+
You will see a new section for `UI Examples` which contains the work from the `Our.Umbraco.UiExamples.v13` and `Our.Umbraco.UiExamples.v15` in their respective sites.
8+
9+
## Making changes
10+
11+
Both projects will automatically compile and bring the assets into the example sites when building.
12+
13+
**Quicker dev in v15** can be acheived by opening the `Our.Umbraco.UiExamples.v15` in the command line/terminal and running the `npm run dev` command (make sure to either build or run `npm ci` first to install node dependencies).
14+
15+
## Troubleshooting
16+
17+
If you receive errors about node commands during build, make sure that you have the correct version of node installed (22.12.0 at the time of writing). You can also try running the command that outputs directly in the command line/terminal to get a more verbose reason.

examples/Umbraco13.Website/Program.cs

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Microsoft.AspNetCore.Builder;
2+
using Umbraco.Cms.Core.DependencyInjection;
3+
using Umbraco.Extensions;
4+
5+
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
6+
7+
builder.CreateUmbracoBuilder()
8+
.AddBackOffice()
9+
.AddWebsite()
10+
.AddDeliveryApi()
11+
.AddComposers()
12+
.Build();
13+
14+
WebApplication app = builder.Build();
15+
16+
await app.BootUmbracoAsync();
17+
18+
19+
app.UseUmbraco()
20+
.WithMiddleware(u =>
21+
{
22+
u.UseBackOffice();
23+
u.UseWebsite();
24+
})
25+
.WithEndpoints(u =>
26+
{
27+
u.UseInstallerEndpoints();
28+
u.UseBackOfficeEndpoints();
29+
u.UseWebsiteEndpoints();
30+
});
31+
32+
await app.RunAsync();

0 commit comments

Comments
 (0)