Skip to content

Commit 235d450

Browse files
committed
Update ci to use dotnet-releaser
1 parent 8f2d685 commit 235d450

File tree

4 files changed

+41
-22
lines changed

4 files changed

+41
-22
lines changed

.github/workflows/ci.yml

+6-18
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: ci
22

3-
env:
4-
PROJECT_NAME: CppAst
5-
63
on:
74
push:
85
paths-ignore:
@@ -19,24 +16,15 @@ jobs:
1916
steps:
2017
- name: Checkout
2118
uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
2221

23-
- name: Install .NET 6
22+
- name: Install .NET 6.0
2423
uses: actions/setup-dotnet@v1
2524
with:
2625
dotnet-version: '6.0.x'
2726

28-
- name: Build & test (Release)
27+
- name: Build, Test, Pack, Publish
2928
run: |
30-
dotnet test src -c Release
31-
32-
- name: Pack
33-
run: dotnet pack src -c Release
34-
35-
- name: Publish
36-
if: github.event_name == 'push'
37-
run: |
38-
if ( "${{github.ref}}" -match "^refs/tags/[0-9]+\.[0-9]+\.[0-9]+" ) {
39-
dotnet nuget push src\${{env.PROJECT_NAME}}\bin\Release\*.nupkg -s nuget.org -k ${{secrets.NUGET_TOKEN}}
40-
} else {
41-
echo "publish is only enabled by tagging with a release tag"
42-
}
29+
dotnet tool install -g dotnet-releaser
30+
dotnet-releaser run --nuget-token ${{secrets.NUGET_TOKEN}} --github-token ${{secrets.GITHUB_TOKEN}} src/dotnet-releaser.toml

.gitignore

+25-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
*.userosscache
1111
*.sln.docstates
1212

13+
# Rider
14+
.idea/
15+
1316
# User-specific files (MonoDevelop/Xamarin Studio)
1417
*.userprefs
1518

@@ -23,12 +26,15 @@ mono_crash.*
2326
[Rr]eleases/
2427
x64/
2528
x86/
29+
[Ww][Ii][Nn]32/
2630
[Aa][Rr][Mm]/
2731
[Aa][Rr][Mm]64/
32+
build/
2833
bld/
2934
[Bb]in/
3035
[Oo]bj/
3136
[Ll]og/
37+
[Ll]ogs/
3238

3339
# Visual Studio 2015/2017 cache/options directory
3440
.vs/
@@ -60,6 +66,9 @@ project.lock.json
6066
project.fragment.lock.json
6167
artifacts/
6268

69+
# ASP.NET Scaffolding
70+
ScaffoldingReadMe.txt
71+
6372
# StyleCop
6473
StyleCopReport.xml
6574

@@ -126,9 +135,6 @@ _ReSharper*/
126135
*.[Rr]e[Ss]harper
127136
*.DotSettings.user
128137

129-
# JustCode is a .NET coding add-in
130-
.JustCode
131-
132138
# TeamCity is a build add-in
133139
_TeamCity*
134140

@@ -139,6 +145,9 @@ _TeamCity*
139145
.axoCover/*
140146
!.axoCover/settings.json
141147

148+
# Coverlet is a free, cross platform Code Coverage Tool
149+
coverage.*[.json, .xml, .info]
150+
142151
# Visual Studio code coverage results
143152
*.coverage
144153
*.coveragexml
@@ -347,3 +356,16 @@ healthchecksdb
347356

348357
# Backup folder for Package Reference Convert tool in Visual Studio 2017
349358
MigrationBackup/
359+
360+
# Ionide (cross platform F# VS Code tools) working folder
361+
.ionide/
362+
363+
# Rust
364+
Cargo.lock
365+
366+
# Tmp folders
367+
tmp/
368+
[Tt]emp/
369+
370+
# Remove artifacts produced by dotnet-releaser
371+
artifacts-dotnet-releaser/

src/CppAst/CppAst.csproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>netstandard2.0</TargetFrameworks>
4-
<VersionPrefix>0.8.0</VersionPrefix>
54
<PackageId>CppAst</PackageId>
65
<Description>CppAst is a .NET library providing a C/C++ parser for header files with access to the full AST, comments and macros</Description>
76
<Copyright>Alexandre Mutel</Copyright>
@@ -30,6 +29,10 @@
3029
</ItemGroup>
3130

3231
<ItemGroup>
32+
<PackageReference Include="MinVer" Version="2.5.0">
33+
<PrivateAssets>all</PrivateAssets>
34+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
35+
</PackageReference>
3336
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
3437
</ItemGroup>
3538
</Project>

src/dotnet-releaser.toml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# configuration file for dotnet-releaser
2+
[msbuild]
3+
project = "./CppAst.sln"
4+
[github]
5+
user = "xoofx"
6+
repo = "CppAst"

0 commit comments

Comments
 (0)