Skip to content

Commit

Permalink
Updating various versions and build infrastructure for .NET 6
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding committed Oct 29, 2021
1 parent de031cb commit 2300668
Show file tree
Hide file tree
Showing 16 changed files with 256 additions and 162 deletions.
312 changes: 182 additions & 130 deletions .editorconfig

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@
# Set explicit file behavior to:
# treat as binary
###############################################################################
*.png binary
*.wav binary
*.snk binary
31 changes: 25 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,36 @@ jobs:
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
build-nuget:
build-nuget-preview:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- run: ./scripts/cibuild.cmd -configuration release -architecture x64
shell: cmd
env:
EXCLUDE_RUN_ID_FROM_PACKAGE: true
EXCLUDE_SUFFIX_FROM_VERSION: false
- uses: actions/upload-artifact@v2
with:
name: nuget
name: nuget_preview
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
./artifacts/pkg/**/*
./artifacts/tst/**/*
if-no-files-found: error
build-nuget-release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- run: ./scripts/cibuild.cmd -configuration release -architecture x64
shell: cmd
env:
EXCLUDE_RUN_ID_FROM_PACKAGE: true
EXCLUDE_SUFFIX_FROM_VERSION: true
- uses: actions/upload-artifact@v2
with:
name: nuget_release
path: |
./artifacts/bin/**/*
./artifacts/log/**/*
Expand All @@ -107,7 +126,7 @@ jobs:
publish-nightlies-azure:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: [ windows-x64, windows-x86, linux-x64, macos-x64, build-nuget ]
needs: [ windows-x64, windows-x86, linux-x64, macos-x64, build-nuget-preview, build-nuget-release ]
steps:
- uses: actions/download-artifact@v2
with:
Expand All @@ -119,11 +138,11 @@ jobs:
source-url: https://pkgs.terrafx.dev/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_PAT }}
- run: dotnet nuget push "./artifacts/pkg/Release/*.nupkg" --api-key AzureDevOps
- run: dotnet nuget push "./artifacts/pkg/Release/*.nupkg" --api-key AzureDevOps --skip-duplicate
publish-nightlies-github:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
needs: [ windows-x64, windows-x86, linux-x64, macos-x64, build-nuget ]
needs: [ windows-x64, windows-x86, linux-x64, macos-x64, build-nuget-preview, build-nuget-release ]
steps:
- uses: actions/download-artifact@v2
with:
Expand All @@ -132,4 +151,4 @@ jobs:
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- run: dotnet nuget push "./artifacts/pkg/Release/*.nupkg" --source https://nuget.pkg.github.com/terrafx/index.json --api-key ${{ secrets.GITHUB_TOKEN }}
- run: dotnet nuget push "./artifacts/pkg/Release/*.nupkg" --source https://nuget.pkg.github.com/terrafx/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,17 @@ TestResult.xml
###############################################################################
.vs/
.vscode/

###############################################################################
# User Specific Settings
###############################################################################
*.user

###############################################################################
# Asset Files
###############################################################################
*.bmp
*.gif
*.jpg
*.png
*.wav
5 changes: 3 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@
<ContinuousIntegrationBuild Condition="'$(GITHUB_RUN_ID)' != ''">true</ContinuousIntegrationBuild>
<PackageOutputPath>$(BaseArtifactsPath)pkg/$(Configuration)/</PackageOutputPath>
<Product>TerraFX.Interop.Libc</Product>
<VersionPrefix>1.2017.0</VersionPrefix>
<VersionSuffix>beta2</VersionSuffix>
<RootNamespace>TerraFX.Interop</RootNamespace>
<VersionPrefix>1.2017.0.0</VersionPrefix>
<VersionSuffix Condition="'$(EXCLUDE_SUFFIX_FROM_VERSION)' != 'true'">beta3</VersionSuffix>
<VersionSuffix Condition="'$(GITHUB_EVENT_NAME)' == 'pull_request'">pr</VersionSuffix>
</PropertyGroup>

Expand Down
7 changes: 3 additions & 4 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@

<!-- Settings that append the existing setting value -->
<PropertyGroup>
<DefineConstants>$(DefineConstants);$(OS)</DefineConstants>
<NoWarn>$(NoWarn);NU5105</NoWarn>
</PropertyGroup>

<!-- Settings that are only set for CI builds -->
<PropertyGroup Condition="'$(GITHUB_RUN_ID)' != ''">
<PackageVersion Condition="'$(EXCLUDE_RUN_ID_FROM_PACKAGE)' == ''">$(Version)-$(GITHUB_RUN_ID)</PackageVersion>
<PackageVersion Condition="'$(EXCLUDE_RUN_ID_FROM_PACKAGE)' != 'true'">$(Version).$(GITHUB_RUN_ID)</PackageVersion>
</PropertyGroup>

<!-- Settings that are only set for executables -->
<PropertyGroup Condition="'$(OutputType)' != 'Library'">
<PropertyGroup Condition="'$(OutputType)' != 'Library' AND '$(UseWindowsForms)' != 'true'">
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>

Expand All @@ -34,7 +33,7 @@

<!-- Package versions for package references across all projects -->
<ItemGroup>
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.10.0" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.0.0" />
<PackageReference Update="NUnit" Version="3.13.2" />
<PackageReference Update="NUnit3TestAdapter" Version="4.0.0" />
Expand Down
7 changes: 5 additions & 2 deletions TerraFX.Interop.Libc.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28721.148
# Visual Studio Version 17
VisualStudioVersion = 17.0.31825.309
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".root", ".root", "{2F337CB6-0B9E-4765-A277-487E429DE9F1}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -38,6 +38,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sources", "sources", "{0B82
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Interop", "Interop", "{70FBCFD9-B96E-4E72-B35C-681D9B2DA3D6}"
ProjectSection(SolutionItems) = preProject
sources\Interop\.editorconfig = sources\Interop\.editorconfig
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libc", "Libc", "{63D2AF3C-3ACA-4FEA-94F9-58A30B5D175A}"
EndProject
Expand Down
1 change: 0 additions & 1 deletion scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ try {
$DotNetInstallDirectory = Join-Path -Path $ArtifactsDir -ChildPath "dotnet"
Create-Directory -Path $DotNetInstallDirectory

& $DotNetInstallScript -Channel 5.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture
& $DotNetInstallScript -Channel 6.0 -Version latest -InstallDir $DotNetInstallDirectory -Architecture $architecture

$env:PATH="$DotNetInstallDirectory;$env:PATH"
Expand Down
1 change: 0 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ if [[ ! -z "$architecture" ]]; then
DotNetInstallDirectory="$ArtifactsDir/dotnet"
CreateDirectory "$DotNetInstallDirectory"

. "$DotNetInstallScript" --channel 5.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"
. "$DotNetInstallScript" --channel 6.0 --version latest --install-dir "$DotNetInstallDirectory" --architecture "$architecture"

PATH="$DotNetInstallDirectory:$PATH:"
Expand Down
1 change: 0 additions & 1 deletion sources/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

<PropertyGroup>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props</MSBuildAllProjects>
<TerraFXProjectCategory>sources</TerraFXProjectCategory>
</PropertyGroup>

Expand Down
4 changes: 0 additions & 4 deletions sources/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
MSBuildAllProjects, as that is done by the file that imports us.
-->

<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.targets</MSBuildAllProjects>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.targets" />

<PropertyGroup>
Expand Down
20 changes: 20 additions & 0 deletions sources/Interop/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.

###############################################################################
# EditorConfig is awesome: http://EditorConfig.org
###############################################################################

###############################################################################
# Not top-most EditorConfig file
###############################################################################
root = false

###############################################################################
# Set dotnet naming rules to:
# disable any parent naming rules since they are not applicable to interop
###############################################################################
[*.cs]
dotnet_naming_rule.async_members_should_be_pascal_case_suffixed_with_async.severity = none
dotnet_naming_rule.interfaces_should_be_pascal_case_prefixed_with_i.severity = none
dotnet_naming_rule.private_and_internal_fields_should_be_camel_case_prefixed_with_underscore.severity = none
dotnet_naming_rule.public_and_protected_declarations_should_be_pascal_case.severity = none
6 changes: 1 addition & 5 deletions sources/Interop/Libc/TerraFX.Interop.Libc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
<PropertyGroup>
<NoWarn>1591;$(NoWarn)</NoWarn>
<RootNamespace>TerraFX.Interop</RootNamespace>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<Folder Include="sys\time\" />
</ItemGroup>

</Project>
1 change: 0 additions & 1 deletion tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
-->

<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props</MSBuildAllProjects>
<TerraFXProjectCategory>tests</TerraFXProjectCategory>
</PropertyGroup>

Expand Down
4 changes: 0 additions & 4 deletions tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
MSBuildAllProjects, as that is done by the file that imports us.
-->

<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.targets</MSBuildAllProjects>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.targets" />

</Project>
2 changes: 1 addition & 1 deletion tests/Interop/Libc/TerraFX.Interop.Libc.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<RootNamespace>TerraFX.Interop.UnitTests</RootNamespace>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 2300668

Please sign in to comment.