Skip to content

Commit 901c320

Browse files
authored
Miscellaneous Magical Modifications (#11)
- (Attempt at) Improving CI build and packaging - Updated GitHub actions / `NetDuid.csproj` to use parameterize version number - Now embedding tracked sources for Source Link - Cleaned up README.MD to add missing info, and removed duplicate info
1 parent 366e339 commit 901c320

File tree

6 files changed

+41
-29
lines changed

6 files changed

+41
-29
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
run: dotnet restore ./src
3838

3939
- name: Build
40-
run: dotnet build ./src --no-restore
40+
run: dotnet build ./src --no-restore -p:VersionFromCI="0.0.0-cibuild"
4141

4242
- name: Test
4343
run: dotnet test ./src --no-build --verbosity normal

.github/workflows/publish.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,34 @@ jobs:
2020
steps:
2121
- name: Checkout code
2222
uses: actions/checkout@v4
23+
2324
- name: Setup .NET
2425
uses: actions/setup-dotnet@v4
2526
with:
2627
dotnet-version: 9.0.x
28+
29+
- name: Extract version
30+
id: extract_version
31+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
32+
2733
- name: Restore dotnet tools
2834
run: dotnet tool restore
35+
2936
- name: Restore dependencies
3037
run: dotnet restore ./src
38+
3139
- name: Build
32-
run: dotnet build ./src --no-restore
33-
- name: Extract version
34-
id: extract_version
35-
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
40+
run: dotnet build ./src --no-restore --configuration Release /p:VersionFromCI=${{ env.VERSION }}
41+
3642
- name: Pack
37-
run: dotnet pack ./src/NetDuid/NetDuid.csproj --configuration Release --no-build --output ./packages /p:PackageVersion=${{ env.VERSION }}
43+
run: dotnet pack ./src/NetDuid/NetDuid.csproj --configuration Release --no-build --output ./packages /p:VersionFromCI=${{ env.VERSION }}
44+
3845
- name: Publish to GitHub Packages
3946
env:
4047
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4148
run: dotnet nuget push ./packages/*.nupkg --source "https://nuget.pkg.github.com/sandialabs/index.json" --api-key $GITHUB_TOKEN --skip-duplicate
42-
- name: Publish to nuget.org Packages
43-
run: dotnet nuget push ./packages/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_ORG_APIKEY }} --skip-duplicate
49+
50+
- name: Publish to nuget.org
51+
env:
52+
NUGET_ORG_APIKEY: ${{ secrets.NUGET_ORG_APIKEY }}
53+
run: dotnet nuget push ./packages/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key $NUGET_ORG_APIKEY --skip-duplicate

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ This project uses [Semantic Versioning](https://semver.org/)
144144

145145
### Targeting
146146

147-
The project targets [.NET Standard 2.0](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0), [.NET 6](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-6), [.NET 7](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-7), and [.NET 8](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8). The test project similarly targets .NET 6, .NET 7, and .NET 8, but targets [.NET Framework 4.8](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net48) for the .NET Standard 2.0 tests.
147+
The project targets [.NET Standard 2.0](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0), [.NET 6](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-6), [.NET 7](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-7), [.NET 8](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8), and [.NET 9](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9/overview). The test project similarly targets .NET 6, .NET 7, .NET 8, .NET 9, but targets [.NET Framework 4.8](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net48) for the .NET Standard 2.0 tests.
148148

149149
### Commit Hook
150150

@@ -176,10 +176,11 @@ This project was built by the Production Tools Team at Sandia National Laborator
176176

177177
Including, but not limited to:
178178

179-
- Robert H. Engelhardt
179+
- [Robert H. Engelhardt](https://rheone.com/)
180180
- Drew Antonich
181181
- Stephen Jackson
182182
- Sterling Violette
183+
- Madison Brewer
183184

184185
## Copyright
185186

@@ -189,6 +190,4 @@ Including, but not limited to:
189190

190191
> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
191192
> http://www.apache.org/licenses/LICENSE-2.0
192-
> Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
193-
194-
This project is licensed under the terms of Contract DE-NA0003525 with NTESS. The U.S. Government retains certain rights in this software.
193+
> Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

dictionary.dic

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
duid
22
duids
33
NetDuid
4-
undelimited
4+
NTESS
5+
Sandia
6+
undelimited

src/NetDuid.Tests/packages.lock.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@
1717
"Microsoft.CodeCoverage": "17.12.0"
1818
}
1919
},
20-
"Microsoft.NETFramework.ReferenceAssemblies": {
21-
"type": "Direct",
22-
"requested": "[1.0.3, )",
23-
"resolved": "1.0.3",
24-
"contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==",
25-
"dependencies": {
26-
"Microsoft.NETFramework.ReferenceAssemblies.net48": "1.0.3"
27-
}
28-
},
2920
"Roslynator.Analyzers": {
3021
"type": "Direct",
3122
"requested": "[4.12.10, )",
@@ -89,11 +80,6 @@
8980
"resolved": "17.12.0",
9081
"contentHash": "4svMznBd5JM21JIG2xZKGNanAHNXplxf/kQDFfLHXQ3OnpJkayRK/TjacFjA+EYmoyuNXHo/sOETEfcYtAzIrA=="
9182
},
92-
"Microsoft.NETFramework.ReferenceAssemblies.net48": {
93-
"type": "Transitive",
94-
"resolved": "1.0.3",
95-
"contentHash": "zMk4D+9zyiEWByyQ7oPImPN/Jhpj166Ky0Nlla4eXlNL8hI/BtSJsgR8Inldd4NNpIAH3oh8yym0W2DrhXdSLQ=="
96-
},
9783
"Microsoft.TestPlatform.ObjectModel": {
9884
"type": "Transitive",
9985
"resolved": "17.12.0",

src/NetDuid/NetDuid.csproj

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,23 @@
66
<OutputPath>bin\</OutputPath>
77
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
88
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
9+
</PropertyGroup>
10+
11+
<PropertyGroup Condition="'$(VersionFromCI)'!=''">
12+
<Version>$(VersionFromCI)</Version>
913
<IsPackable>true</IsPackable>
1014
</PropertyGroup>
15+
<PropertyGroup Condition="'$(VersionFromCI)'==''">
16+
<Version>0.0.0-build</Version>
17+
<IsPackable>false</IsPackable>
18+
</PropertyGroup>
19+
20+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
21+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
22+
</PropertyGroup>
23+
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
24+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
25+
</PropertyGroup>
1126

1227
<PropertyGroup>
1328
<Title>NetDuid</Title>
@@ -17,7 +32,6 @@
1732
<NeutralLanguage>en</NeutralLanguage>
1833
<PackageLanguage>en-US</PackageLanguage>
1934
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
20-
<Version>1.0.0</Version>
2135
<Company>Sandia National Laboratories</Company>
2236
<Authors>The Production Tools Team</Authors>
2337
<Copyright>Copyright 2024 National Technology &amp; Engineering Solutions of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software</Copyright>
@@ -28,6 +42,7 @@
2842
<PackageProjectUrl>https://github.com/sandialabs/NetDuid</PackageProjectUrl>
2943
<RepositoryType>git</RepositoryType>
3044
<PublishRepositoryUrl>true</PublishRepositoryUrl>
45+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3146
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
3247
</PropertyGroup>
3348

0 commit comments

Comments
 (0)