Skip to content

Commit 64830aa

Browse files
authored
Add ci workflow file (#2)
1 parent 9088af5 commit 64830aa

File tree

18 files changed

+136
-70
lines changed

18 files changed

+136
-70
lines changed

.github/workflows/main.yml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: main
2+
3+
permissions:
4+
packages: write
5+
contents: write
6+
actions: read
7+
checks: write
8+
9+
on:
10+
# on pull_request to master
11+
pull_request:
12+
types: [ opened, synchronize ]
13+
branches: [ main, master ]
14+
15+
# manual
16+
workflow_dispatch:
17+
18+
env:
19+
output: bin
20+
project: Serilog.Enrichers.Autodesk.Revit
21+
configuration: Release
22+
default_branch: ${{ github.event.repository.default_branch }}
23+
24+
jobs:
25+
build:
26+
runs-on: windows-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
# Install the .NET Core workload
31+
- name: Install .NET 8.0
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: 8.0.x
35+
36+
# Build project: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build
37+
- name: Build
38+
run: dotnet build -c ${{ env.configuration }}
39+
40+
# Test project: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test
41+
- name: Test
42+
run: dotnet test -c ${{ env.configuration }} --logger trx --results-directory "TestResults"
43+
44+
# Upload tests results: https://github.com/dorny/test-reporter
45+
- name: Upload tests results
46+
uses: dorny/test-reporter@v1
47+
if: success() || failure()
48+
with:
49+
name: dotnet tests
50+
path: ./TestResults/*.trx
51+
reporter: dotnet-trx
52+
53+
- name: Pack
54+
run: dotnet pack -c ${{ env.configuration }} -o ${{ env.output }}
55+
56+
# Fetch version: https://github.com/kzrnm/get-net-sdk-project-versions-action
57+
- name: Fetch version
58+
uses: kzrnm/get-net-sdk-project-versions-action@v2
59+
id: get-version
60+
with:
61+
proj-path: src/${{ env.project }}/${{ env.project }}.csproj
62+
63+
# Upload the nuget package: https://github.com/marketplace/actions/upload-a-build-artifact
64+
- name: Upload
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: nuget
68+
path: |
69+
${{ env.output }}/*.nupkg
70+
${{ env.output }}/*.snupkg
71+
72+
# Publish the nuget package: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push
73+
- name: Publish nuget
74+
if: github.ref_name == env.default_branch
75+
run: dotnet nuget push ${{ env.output }}/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
76+
77+
# Publish the nuget package: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push
78+
- name: Publish github
79+
if: github.ref_name == env.default_branch
80+
run: dotnet nuget push ${{ env.output }}/**/*.nupkg -s https://nuget.pkg.github.com/${{ github.REPOSITORY_OWNER }}/index.json -k ${{ github.TOKEN }} --skip-duplicate
81+
82+
# Publish release: https://github.com/softprops/action-gh-release
83+
- name: Publish Release
84+
if: github.ref_name == env.default_branch
85+
uses: softprops/action-gh-release@v1
86+
env:
87+
GITHUB_TOKEN: ${{ github.TOKEN }}
88+
with:
89+
tag_name: v${{ steps.get-version.outputs.package-version }}
90+
name: v${{ steps.get-version.outputs.package-version }}
91+
body: v${{ steps.get-version.outputs.package-version }}
92+
draft: true
93+
prerelease: false
94+
files: |
95+
${{ env.output }}/*.nupkg
96+
${{ env.output }}/*.snupkg

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -395,4 +395,6 @@ FodyWeavers.xsd
395395
# Rider auto-generates .iml files, and contentModel.xml
396396
**/.idea/**/*.iml
397397
**/.idea/**/contentModel.xml
398-
**/.idea/**/modules.xml
398+
**/.idea/**/modules.xml
399+
400+
/.idea

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [v2.0.0] - 2024-05-14
9+
### Add
10+
11+
- net8.0 target framework
12+
- ci workflow
13+
- CHANGELOG.md

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Biseuv Olzhas (dosymep)
3+
Copyright (c) 2024 Biseuv Olzhas (dosymep)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Serilog.Enrichers.Autodesk.Revit
22

3+
[![JetBrains Rider](https://img.shields.io/badge/JetBrains-Rider-blue.svg)](https://www.jetbrains.com/rider)
4+
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE.md)
5+
[![Revit 2017-2025](https://img.shields.io/badge/Revit-2017--2025-blue.svg)](https://www.autodesk.com/products/revit/overview)
6+
[![main](https://github.com/dosymep/Serilog.Enrichers.Autodesk.Revit/actions/workflows/main.yml/badge.svg)](https://github.com/dosymep/Serilog.Enrichers.Autodesk.Revit/actions/workflows/main.yml)
7+
8+
39
The Autodesk Revit enrichers for [Serilog](https://serilog.net).
410

511
### Getting started

src/Serilog.Enrichers.Autodesk.Revit.sln Serilog.Enrichers.Autodesk.Revit.sln

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Enrichers.Autodesk.Revit", "Serilog.Enrichers.Autodesk.Revit\Serilog.Enrichers.Autodesk.Revit.csproj", "{61752A6F-6BA7-4536-9B2A-482771608632}"
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Enrichers.Autodesk.Revit", "src/Serilog.Enrichers.Autodesk.Revit\Serilog.Enrichers.Autodesk.Revit.csproj", "{61752A6F-6BA7-4536-9B2A-482771608632}"
44
EndProject
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CF804FA7-56A6-4FA0-B201-118E593BD4CD}"
66
ProjectSection(SolutionItems) = preProject
7-
..\.editorconfig = ..\.editorconfig
8-
..\CONTRIBUTING.md = ..\CONTRIBUTING.md
9-
..\CREDITS.md = ..\CREDITS.md
10-
..\LICENSE.md = ..\LICENSE.md
11-
..\README.md = ..\README.md
7+
.editorconfig = .editorconfig
8+
CONTRIBUTING.md = CONTRIBUTING.md
9+
CREDITS.md = CREDITS.md
10+
LICENSE.md = LICENSE.md
11+
README.md = README.md
12+
CHANGELOG.md = CHANGELOG.md
1213
EndProjectSection
1314
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Enrichers.Autodesk.Revit.Tests", "Serilog.Enrichers.Autodesk.Revit.Tests\Serilog.Enrichers.Autodesk.Revit.Tests.csproj", "{B96FBB4D-121D-421B-897E-DC9E0484ED0C}"
15+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Enrichers.Autodesk.Revit.Tests", "src/Serilog.Enrichers.Autodesk.Revit.Tests\Serilog.Enrichers.Autodesk.Revit.Tests.csproj", "{B96FBB4D-121D-421B-897E-DC9E0484ED0C}"
1516
EndProject
1617
Global
1718
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/.idea/.idea.Serilog.Enrichers.Autodeks.Revit/.idea/.gitignore

-11
This file was deleted.

src/.idea/.idea.Serilog.Enrichers.Autodeks.Revit/.idea/.name

-1
This file was deleted.

src/.idea/.idea.Serilog.Enrichers.Autodeks.Revit/.idea/encodings.xml

-4
This file was deleted.

src/.idea/.idea.Serilog.Enrichers.Autodeks.Revit/.idea/indexLayout.xml

-8
This file was deleted.

src/.idea/.idea.Serilog.Enrichers.Autodesk.Revit/.idea/.gitignore

-11
This file was deleted.

src/.idea/.idea.Serilog.Enrichers.Autodesk.Revit/.idea/.name

-1
This file was deleted.

src/.idea/.idea.Serilog.Enrichers.Autodesk.Revit/.idea/encodings.xml

-4
This file was deleted.

src/.idea/.idea.Serilog.Enrichers.Autodesk.Revit/.idea/indexLayout.xml

-8
This file was deleted.

src/.idea/.idea.Serilog.Enrichers.Autodesk.Revit/.idea/vcs.xml

-6
This file was deleted.

src/Serilog.Enrichers.Autodesk.Revit.Tests/RevitCachedPropertyTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public void CustomPropertyEnricherIsApplied() {
1616

1717
log.Information(@"Hello, world!");
1818

19-
Assert.NotNull(testSink.LogEvent);
19+
Assert.That(testSink.LogEvent, Is.Not.Null);
2020
Assert.That(propertyValue, Is.EqualTo(GetScalarValue(testSink?.LogEvent, propertyName)));
2121
}
2222

src/Serilog.Enrichers.Autodesk.Revit.Tests/Serilog.Enrichers.Autodesk.Revit.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net452;net8.0</TargetFrameworks>
4+
<TargetFrameworks>net462;net8.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>
@@ -15,14 +15,14 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
19-
<PackageReference Include="NUnit" Version="3.13.3" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
19+
<PackageReference Include="NUnit" Version="4.1.0" />
2020
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
21-
<PackageReference Include="NUnit.Analyzers" Version="3.6.1">
21+
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
2222
<PrivateAssets>all</PrivateAssets>
2323
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2424
</PackageReference>
25-
<PackageReference Include="coverlet.collector" Version="6.0.0">
25+
<PackageReference Include="coverlet.collector" Version="6.0.2">
2626
<PrivateAssets>all</PrivateAssets>
2727
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2828
</PackageReference>

src/Serilog.Enrichers.Autodesk.Revit/Serilog.Enrichers.Autodesk.Revit.csproj

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Platforms>x64</Platforms>
1212
<PackageIcon>autodesk-revit.png</PackageIcon>
1313
<Authors>dosymep</Authors>
14-
<Copyright>Copyright (c) 2023 Biseuv Olzhas (dosymep)</Copyright>
14+
<Copyright>Copyright (c) 2024 Biseuv Olzhas (dosymep)</Copyright>
1515
<PackageProjectUrl>https://github.com/dosymep/Serilog.Enrichers.Autodesk.Revit</PackageProjectUrl>
1616
<RepositoryUrl>https://github.com/dosymep/Serilog.Enrichers.Autodesk.Revit.git</RepositoryUrl>
1717
<RepositoryType>Git</RepositoryType>
@@ -71,5 +71,7 @@
7171
<PackagePath>\</PackagePath>
7272
<Link>assets\README.md</Link>
7373
</None>
74+
75+
<Content Include="../../.github/workflows/*.yml" Link="ci/%(FileName)$(FileExt)" />
7476
</ItemGroup>
7577
</Project>

0 commit comments

Comments
 (0)