Skip to content

Update to .NET 6 and Umbraco.StorageProviders.AzureBlob v2 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 106 additions & 16 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,21 +1,55 @@
# editorconfig.org

# top-most EditorConfig file
root = true

# Default settings:
# A newline ending every file
# Use 4 spaces as indentation
[*]
insert_final_newline = true
end_of_line = lf
indent_style = space
indent_size = 4

# Trim trailing whitespace, limited support.
# https://github.com/editorconfig/editorconfig/wiki/Property-research:-Trim-trailing-spaces
trim_trailing_whitespace = true

csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_labels = one_less_than_current
csharp_prefer_braces = true:warning
csharp_prefer_simple_default_expression = true:suggestion
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_static_local_function = true:suggestion
csharp_space_around_binary_operators = before_and_after
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true:silent
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true:silent
csharp_style_allow_embedded_statements_on_same_line_experimental = true:silent
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_expression_bodied_methods = true:silent
csharp_style_expression_bodied_operators = true:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
csharp_style_prefer_range_operator = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_style_var_elsewhere = false:silent
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = false:silent
csharp_using_directive_placement = outside_namespace:silent

[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
Expand All @@ -24,14 +58,70 @@ trim_trailing_whitespace = false
indent_size = 2

[*.{cs,vb}]
dotnet_style_predefined_type_for_locals_parameters_members = true:error
tab_width = 4

dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
dotnet_code_quality_unused_parameters = all:suggestion
dotnet_naming_rule.private_members_with_underscore.severity = suggestion

dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private

dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
dotnet_naming_style.prefix_underscore.capitalization = camel_case
dotnet_naming_style.prefix_underscore.required_prefix = _
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:silent
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_qualification_for_event = false:silent
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_property = false:silent
dotnet_style_readonly_field = true:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent

# CA1054: URI parameters should not be strings
dotnet_diagnostic.CA1054.severity = suggestion

# CA1055: URI-like return values should not be strings
dotnet_diagnostic.CA1055.severity = none

# RS0048: Missing shipped or unshipped public API file
dotnet_public_api_analyzer.require_api_files = true

# SA1101: Prefix local calls with this
dotnet_diagnostic.SA1101.severity = none

# SA1309: Field names should not begin with underscore
dotnet_diagnostic.SA1309.severity = none

# SA1413: Use trailing comma in multi-line initializers
dotnet_diagnostic.SA1413.severity = none

# SA1502: Element should not be on a single line
dotnet_diagnostic.SA1502.severity = none

# SA1625: Element documentation should not be copied and pasted
dotnet_diagnostic.SA1625.severity = none

# SA1633: File should have header
dotnet_diagnostic.SA1633.severity = none
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
*.dll
*.exe
*.log
*.nupkg
*.suo
*.user

Expand All @@ -10,8 +6,3 @@
.vscode/
[Bb]in/
[Oo]bj/


Build/temp
build.out/
build.tmp/
2 changes: 1 addition & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="Umbraco Prereleases" value="https://www.myget.org/F/umbracoprereleases/api/v3/index.json" />
<add key="Umbraco Nightly" value="https://www.myget.org/F/umbraconightly/api/v3/index.json" />
</packageSources>
Expand Down
1 change: 1 addition & 0 deletions Umbraco.Cloud.StorageProviders.AzureBlob.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
azure-pipelines.yml = azure-pipelines.yml
src\Directory.Build.props = src\Directory.Build.props
LICENSE = LICENSE
NuGet.config = NuGet.config
Expand Down
141 changes: 35 additions & 106 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,108 +1,37 @@
variables:
buildConfiguration: Release
slnFilename: Umbraco.Cloud.StorageProviders.AzureBlob.sln
stages:
- stage: Artifacts
dependsOn: []
jobs:
- job: Build_Artifacts
displayName: Build Artifacts
pool:
vmImage: windows-latest
steps:
- task: UseDotNet@2
displayName: Use .Net Core sdk 5.x
inputs:
version: 5.x
- task: NuGetToolInstaller@1
displayName: Use NuGet Latest
- task: NuGetCommand@2
displayName: Restore NuGet Packages
inputs:
restoreSolution: $(slnFilename)
feedsToUse: config
- task: PowerShell@1
displayName: Update Version and Artifact Name
inputs:
scriptType: inlineScript
inlineScript: >
Write-Host "Working folder: $pwd"

$ubuild = build/build.ps1 -get -continue


$version = $ubuild.GetUmbracoVersion()

$isRelease = [regex]::matches($env:BUILD_SOURCEBRANCH,"v\d+\/\d+.\d+.*")


if ($isRelease.Count -gt 0){
$continuous = $version.Semver
Write-Host "##vso[build.addbuildtag]Release build"
}
else
{
$date = (Get-Date).ToString("yyyyMMdd")
$continuous = "$($version.release)-preview$date.$(Build.BuildId)"
$ubuild.SetUmbracoVersion($continuous)
solution: Umbraco.Cloud.StorageProviders.AzureBlob.sln
buildConfiguration: Release
NUGET_PACKAGES: $(Pipeline.Workspace)/.nuget/packages
DOTNET_NOLOGO: true
DOTNET_GENERATE_ASPNET_CERTIFICATE: false
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

Write-Host "##vso[build.addbuildtag]Continuous build"
}

Write-Host "##vso[build.updatebuildnumber]$continuous.$(Build.BuildId)"

Write-Host "Building: $continuous"
- task: PowerShell@1
displayName: Prepare Build
inputs:
scriptType: inlineScript
inlineScript: |
Write-Host "Working folder: $pwd"
$ubuild = build\build.ps1 -get

$ubuild.PrepareBuild("vso")
- task: PowerShell@1
displayName: Prepare Packages & Zip
inputs:
scriptType: inlineScript
inlineScript: |
Write-Host "Working folder: $pwd"
$ubuild = build\build.ps1 -get -continue

$ubuild.CompileUmbracoCloudStorageProvidersAzureBlob()
$ubuild.PreparePackages()
- task: PowerShell@1
displayName: Verify & Package NuGet
inputs:
scriptType: inlineScript
inlineScript: |
Write-Host "Working folder: $pwd"
$ubuild = build\build.ps1 -get -continue

$ubuild.PackageNuGet()
- task: CopyFiles@2
displayName: Copy NuPkg Files to Staging
inputs:
SourceFolder: build.out
Contents: '*.nupkg'
TargetFolder: $(build.artifactstagingdirectory)
CleanTargetFolder: true
- task: PublishBuildArtifacts@1
displayName: Publish NuPkg Files
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: nupkg
- task: CopyFiles@2
displayName: Copy Log Files to Staging
inputs:
SourceFolder: build.tmp
Contents: '*.log'
TargetFolder: $(build.artifactstagingdirectory)
CleanTargetFolder: true
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: Publish Log Files
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: logs
condition: succeededOrFailed()
stages:
- stage: Artifacts
jobs:
- job: Build
pool:
vmImage: windows-latest
steps:
- task: Cache@2
inputs:
key: 'nuget | "$(Agent.OS)" | **/packages.lock.json'
restoreKeys: |
nuget | "$(Agent.OS)"
nuget
path: $(NUGET_PACKAGES)
displayName: Cache NuGet packages

- script: dotnet restore $(solution) --locked-mode
displayName: Restore NuGet packages

- script: dotnet build $(solution) -c $(buildConfiguration) -p:ContinuousIntegrationBuild=true --no-restore
displayName: Build

- script: dotnet pack $(solution) -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory) --no-restore --no-build
displayName: Pack

- task: PublishBuildArtifacts@1
inputs:
ArtifactName: nupkg
displayName: Publish NuGet packages
Loading