Skip to content

Commit f192089

Browse files
committed
Use dotnet-releaser, use net6.0 and update packages
1 parent a84d854 commit f192089

File tree

14 files changed

+61
-2066
lines changed

14 files changed

+61
-2066
lines changed

.github/workflows/CI.yml

+11-21
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,18 @@ jobs:
1414

1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v1
17+
uses: actions/checkout@v2
18+
with:
19+
submodules: true
20+
fetch-depth: 0
1821

19-
- name: Install .NET Core
22+
- name: Install .NET 6.0
2023
uses: actions/setup-dotnet@v1
2124
with:
22-
dotnet-version: 3.0.100
23-
24-
- name: Build & test (Debug)
25-
run: dotnet test src --configuration Debug
26-
27-
- name: Build & test (Release)
28-
run: dotnet test src --configuration Release
29-
30-
- name: Pack
31-
run: dotnet pack src --configuration Release
32-
33-
- name: Publish
34-
if: github.event_name == 'push'
35-
run: |
36-
if [[ ${{ github.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
37-
dotnet nuget push src/LibObjectFile/bin/Release/*.nupkg -s nuget.org -k ${{secrets.NUGET_TOKEN}}
38-
else
39-
echo publish is only enabled by tagging with a release tag
40-
fi
25+
dotnet-version: '6.0.x'
4126

27+
- name: Build, Test, Pack, Publish
28+
shell: bash
29+
run: |
30+
dotnet tool install -g dotnet-releaser
31+
dotnet-releaser run --nuget-token "${{secrets.NUGET_TOKEN}}" --github-token "${{secrets.GITHUB_TOKEN}}" src/dotnet-releaser.toml

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -223,4 +223,7 @@ _Pvt_Extensions
223223
.DS_Store
224224

225225
# JetBrains Rider
226-
.idea/
226+
.idea/
227+
228+
# Remove artifacts produced by dotnet-releaser
229+
artifacts-dotnet-releaser/

readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# LibObjectFile [![Build Status](https://github.com/xoofx/LibObjectFile/workflows/ci/badge.svg?branch=master)](https://github.com/xoofx/LibObjectFile/actions) [![NuGet](https://img.shields.io/nuget/v/LibObjectFile.svg)](https://www.nuget.org/packages/LibObjectFile/)
22

3-
<img align="right" width="200px" height="200px" src="img/libobjectfile.png">
3+
<img align="right" width="200px" height="200px" src="https://raw.githubusercontent.com/xoofx/LibObjectFile/master/img/libobjectfile.png">
44

55
LibObjectFile is a .NET library to read, manipulate and write linker and executable object files (e.g ELF, ar, DWARF, COFF...)
66

@@ -97,7 +97,7 @@ If you're using macOS or another Linux, there's a Dockerfile and a helper script
9797

9898
## License
9999

100-
This software is released under the [BSD-Clause 2 license](https://github.com/lunet-io/markdig/blob/master/license.txt).
100+
This software is released under the [BSD-Clause 2 license](https://github.com/xoofx/LibObjectFile/blob/master/license.txt).
101101

102102
## Author
103103

src/LibObjectFile.CodeGen/LibObjectFile.CodeGen.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
5-
<OutputType>Exe</OutputType>
3+
<TargetFramework>net6.0</TargetFramework>
4+
<OutputType>Exe</OutputType>
5+
<IsPackable>false</IsPackable>
66
</PropertyGroup>
77

88
<ItemGroup>
@@ -11,7 +11,7 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="CppAst.CodeGen" Version="0.4.0" />
14+
<PackageReference Include="CppAst.CodeGen" Version="0.7.0" />
1515
<Content Include="dwarf.h">
1616
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1717
</Content>

src/LibObjectFile.CodeGen/Program.Dwarf.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ private static void GenerateDwarfDIE(CSharpNamespace ns)
469469
};
470470
dieHelperClass.Members.Add(dieHelperMethod);
471471

472-
dieHelperMethod.Parameters.Add(new CSharpParameter("tag") { ParameterType = CSharpPrimitiveType.UShort });
472+
dieHelperMethod.Parameters.Add(new CSharpParameter("tag") { ParameterType = CSharpPrimitiveType.UShort() });
473473
dieHelperMethod.ReturnType = new CSharpFreeType("DwarfDIE");
474474

475475
dieHelperMethod.Body = (writer, element) => {

src/LibObjectFile.CodeGen/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ private static void ProcessEnum(CSharpConverterOptions cppOptions, CSharpCompila
259259
{
260260
Name = "ToStringInternal",
261261
Visibility = CSharpVisibility.Private,
262-
ReturnType = CSharpPrimitiveType.String
262+
ReturnType = CSharpPrimitiveType.String()
263263
};
264264
enumClass.Members.Add(toStringInternal);
265265

src/LibObjectFile.Tests/LibObjectFile.Tests.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>net6.0</TargetFramework>
55
<LangVersion>8.0</LangVersion>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
77
<IsPackable>false</IsPackable>
@@ -38,9 +38,9 @@
3838
</ItemGroup>
3939

4040
<ItemGroup>
41-
<PackageReference Include="nunit" Version="3.12.0" />
42-
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
43-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
41+
<PackageReference Include="nunit" Version="3.13.2" />
42+
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
43+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
4444
</ItemGroup>
4545

4646
<ItemGroup>

src/LibObjectFile.sln

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.29411.108
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.1.32210.238
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibObjectFile", "LibObjectFile\LibObjectFile.csproj", "{4395EB77-43C4-4292-8449-D7B03D479313}"
77
EndProject
@@ -14,6 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1414
..\.gitignore = ..\.gitignore
1515
..\changelog.md = ..\changelog.md
1616
..\.github\workflows\CI.yml = ..\.github\workflows\CI.yml
17+
Directory.Build.props = Directory.Build.props
18+
dotnet-releaser.toml = dotnet-releaser.toml
1719
..\license.txt = ..\license.txt
1820
..\readme.md = ..\readme.md
1921
EndProjectSection
@@ -23,7 +25,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{BD580DD4-4E2
2325
..\doc\readme.md = ..\doc\readme.md
2426
EndProjectSection
2527
EndProject
26-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "objdasm", "objdasm\objdasm.csproj", "{056AA737-6B5F-47A6-8426-E7918D930C5C}"
28+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "objdasm", "objdasm\objdasm.csproj", "{056AA737-6B5F-47A6-8426-E7918D930C5C}"
2729
EndProject
2830
Global
2931
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/LibObjectFile/LibObjectFile.csproj

+12-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
<Description>LibObjectFile is a .NET library to read, manipulate and write linker and executable object files (e.g ELF, ar, DWARF, COFF...)</Description>
1111
<Copyright>Alexandre Mutel</Copyright>
1212
<NeutralLanguage>en-US</NeutralLanguage>
13-
<VersionPrefix>0.3.5</VersionPrefix>
1413
<Authors>Alexandre Mutel</Authors>
1514
<PackageTags>ELF DWARF ar archive objectfile</PackageTags>
16-
<PackageReleaseNotes>https://github.com/xoofx/LibObjectFile/blob/master/changelog.md</PackageReleaseNotes>
1715
<PackageLicenseExpression>BSD-2-Clause</PackageLicenseExpression>
18-
<PackageIconUrl>https://raw.githubusercontent.com/xoofx/LibObjectFile/master/img/libobjectfile.png</PackageIconUrl>
16+
<PackageReadmeFile>readme.md</PackageReadmeFile>
17+
<PackageIcon>logo.png</PackageIcon>
1918
<PackageProjectUrl>https://github.com/xoofx/LibObjectFile</PackageProjectUrl>
2019
<!--Add support for sourcelink-->
2120
<PublishRepositoryUrl>true</PublishRepositoryUrl>
@@ -27,7 +26,16 @@
2726
</PropertyGroup>
2827

2928
<ItemGroup>
29+
<None Include="../../img/libobjectfile.png" Pack="true" PackagePath="/logo.png" />
30+
<None Include="../../readme.md" Pack="true" PackagePath="/"/>
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<PackageReference Include="MinVer" Version="2.5.0">
35+
<PrivateAssets>all</PrivateAssets>
36+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
37+
</PackageReference>
3038
<!--Add support for sourcelink-->
31-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-*" PrivateAssets="All" />
39+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.*" PrivateAssets="All" />
3240
</ItemGroup>
3341
</Project>

0 commit comments

Comments
 (0)