Skip to content

Commit 7e4093c

Browse files
Simplify build and versioning
1 parent 5b74f6d commit 7e4093c

14 files changed

+1913
-423
lines changed

.editorconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ indent_size = 2
2727
dotnet_style_predefined_type_for_locals_parameters_members = true:error
2828

2929
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
30-
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
30+
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
3131
dotnet_naming_rule.private_members_with_underscore.severity = suggestion
3232

33-
dotnet_naming_symbols.private_fields.applicable_kinds = field
33+
dotnet_naming_symbols.private_fields.applicable_kinds = field
3434
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
3535

3636
dotnet_naming_style.prefix_underscore.capitalization = camel_case
3737
dotnet_naming_style.prefix_underscore.required_prefix = _
38+
39+
dotnet_diagnostic.CA1054.severity = suggestion

.github/workflows/prepare-release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Prepare release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'The prerelease tag to apply on the release branch (if any). If not specified, any existing prerelease tag will be removed.'
8+
required: false
9+
default: ''
10+
type: choice
11+
options:
12+
- ''
13+
- 'beta'
14+
- 'rc'
15+
versionIncrement:
16+
description: 'Specifies which part of the version on the current branch is incremented.'
17+
required: true
18+
default: 'minor'
19+
type: choice
20+
options:
21+
- 'major'
22+
- 'minor'
23+
- 'build'
24+
25+
env:
26+
DOTNET_NOLOGO: true
27+
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
28+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
29+
30+
jobs:
31+
prepare-release:
32+
name: Prepare release
33+
runs-on: windows-latest
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
with:
39+
fetch-depth: 0
40+
41+
- name: Configure git
42+
run: |
43+
git config user.name 'github-actions[bot]'
44+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
45+
46+
- name: Setup Nerdbank.GitVersioning
47+
run: dotnet tool install --tool-path . nbgv
48+
49+
- name: Prepare release
50+
run: ./nbgv prepare-release ${{ github.event.inputs.tag }} -p src --versionIncrement ${{ github.event.inputs.versionIncrement }}
51+
52+
- name: Push commit (and new branch)
53+
run: git push --all

.github/workflows/publish-release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
DOTNET_NOLOGO: true
8+
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
9+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
10+
11+
jobs:
12+
publish-release:
13+
name: Publish release
14+
runs-on: windows-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Configure git
23+
run: |
24+
git config user.name 'github-actions[bot]'
25+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
26+
27+
- name: Setup Nerdbank.GitVersioning
28+
run: dotnet tool install --tool-path . nbgv
29+
30+
- name: Tag release
31+
run: ./nbgv tag -p src
32+
33+
- name: Push git tags
34+
run: git push --tags

.gitignore

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
*.dll
2-
*.exe
3-
*.log
4-
*.nupkg
51
*.suo
62
*.user
73

@@ -10,8 +6,3 @@
106
.vscode/
117
[Bb]in/
128
[Oo]bj/
13-
14-
15-
Build/temp
16-
build.out/
17-
build.tmp/

Umbraco.Cloud.StorageProviders.AzureBlob.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1010
.editorconfig = .editorconfig
1111
.gitattributes = .gitattributes
1212
.gitignore = .gitignore
13+
azure-pipelines.yml = azure-pipelines.yml
1314
src\Directory.Build.props = src\Directory.Build.props
1415
LICENSE = LICENSE
1516
NuGet.config = NuGet.config
1617
README.md = README.md
18+
src\version.json = src\version.json
1719
EndProjectSection
1820
EndProject
1921
Global

azure-pipelines.yml

Lines changed: 35 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,37 @@
11
variables:
2-
buildConfiguration: Release
3-
slnFilename: Umbraco.Cloud.StorageProviders.AzureBlob.sln
4-
stages:
5-
- stage: Artifacts
6-
dependsOn: []
7-
jobs:
8-
- job: Build_Artifacts
9-
displayName: Build Artifacts
10-
pool:
11-
vmImage: windows-latest
12-
steps:
13-
- task: UseDotNet@2
14-
displayName: Use .Net Core sdk 5.x
15-
inputs:
16-
version: 5.x
17-
- task: NuGetToolInstaller@1
18-
displayName: Use NuGet Latest
19-
- task: NuGetCommand@2
20-
displayName: Restore NuGet Packages
21-
inputs:
22-
restoreSolution: $(slnFilename)
23-
feedsToUse: config
24-
- task: PowerShell@1
25-
displayName: Update Version and Artifact Name
26-
inputs:
27-
scriptType: inlineScript
28-
inlineScript: >
29-
Write-Host "Working folder: $pwd"
30-
31-
$ubuild = build/build.ps1 -get -continue
32-
33-
34-
$version = $ubuild.GetUmbracoVersion()
35-
36-
$isRelease = [regex]::matches($env:BUILD_SOURCEBRANCH,"v\d+\/\d+.\d+.*")
37-
38-
39-
if ($isRelease.Count -gt 0){
40-
$continuous = $version.Semver
41-
Write-Host "##vso[build.addbuildtag]Release build"
42-
}
43-
else
44-
{
45-
$date = (Get-Date).ToString("yyyyMMdd")
46-
$continuous = "$($version.release)-preview$date.$(Build.BuildId)"
47-
$ubuild.SetUmbracoVersion($continuous)
2+
solution: Umbraco.Cloud.StorageProviders.AzureBlob.sln
3+
buildConfiguration: Release
4+
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
5+
DOTNET_NOLOGO: true
6+
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
7+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
488

49-
Write-Host "##vso[build.addbuildtag]Continuous build"
50-
}
51-
52-
Write-Host "##vso[build.updatebuildnumber]$continuous.$(Build.BuildId)"
53-
54-
Write-Host "Building: $continuous"
55-
- task: PowerShell@1
56-
displayName: Prepare Build
57-
inputs:
58-
scriptType: inlineScript
59-
inlineScript: |
60-
Write-Host "Working folder: $pwd"
61-
$ubuild = build\build.ps1 -get
62-
63-
$ubuild.PrepareBuild("vso")
64-
- task: PowerShell@1
65-
displayName: Prepare Packages & Zip
66-
inputs:
67-
scriptType: inlineScript
68-
inlineScript: |
69-
Write-Host "Working folder: $pwd"
70-
$ubuild = build\build.ps1 -get -continue
71-
72-
$ubuild.CompileUmbracoCloudStorageProvidersAzureBlob()
73-
$ubuild.PreparePackages()
74-
- task: PowerShell@1
75-
displayName: Verify & Package NuGet
76-
inputs:
77-
scriptType: inlineScript
78-
inlineScript: |
79-
Write-Host "Working folder: $pwd"
80-
$ubuild = build\build.ps1 -get -continue
81-
82-
$ubuild.PackageNuGet()
83-
- task: CopyFiles@2
84-
displayName: Copy NuPkg Files to Staging
85-
inputs:
86-
SourceFolder: build.out
87-
Contents: '*.nupkg'
88-
TargetFolder: $(build.artifactstagingdirectory)
89-
CleanTargetFolder: true
90-
- task: PublishBuildArtifacts@1
91-
displayName: Publish NuPkg Files
92-
inputs:
93-
PathtoPublish: $(build.artifactstagingdirectory)
94-
ArtifactName: nupkg
95-
- task: CopyFiles@2
96-
displayName: Copy Log Files to Staging
97-
inputs:
98-
SourceFolder: build.tmp
99-
Contents: '*.log'
100-
TargetFolder: $(build.artifactstagingdirectory)
101-
CleanTargetFolder: true
102-
condition: succeededOrFailed()
103-
- task: PublishBuildArtifacts@1
104-
displayName: Publish Log Files
105-
inputs:
106-
PathtoPublish: $(build.artifactstagingdirectory)
107-
ArtifactName: logs
108-
condition: succeededOrFailed()
9+
stages:
10+
- stage: Artifacts
11+
jobs:
12+
- job: Build
13+
pool:
14+
vmImage: windows-latest
15+
steps:
16+
- task: Cache@2
17+
inputs:
18+
key: 'nuget | "$(Agent.OS)" | **/packages.lock.json'
19+
restoreKeys: |
20+
nuget | "$(Agent.OS)"
21+
nuget
22+
path: $(NUGET_PACKAGES)
23+
displayName: Cache NuGet packages
24+
25+
- script: dotnet restore $(solution) --locked-mode
26+
displayName: Restore NuGet packages
27+
28+
- script: dotnet build $(solution) -c $(buildConfiguration) -p:ContinuousIntegrationBuild=true --no-restore
29+
displayName: Build
30+
31+
- script: dotnet pack $(solution) -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory) --no-restore --no-build
32+
displayName: Pack
33+
34+
- task: PublishBuildArtifacts@1
35+
inputs:
36+
ArtifactName: nupkg
37+
displayName: Publish NuGet packages

build/build-bootstrap.ps1

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)