Skip to content

Commit

Permalink
Add ci workflow file (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
dosymep authored May 14, 2024
1 parent 9088af5 commit 64830aa
Show file tree
Hide file tree
Showing 18 changed files with 136 additions and 70 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: main

permissions:
packages: write
contents: write
actions: read
checks: write

on:
# on pull_request to master
pull_request:
types: [ opened, synchronize ]
branches: [ main, master ]

# manual
workflow_dispatch:

env:
output: bin
project: Serilog.Enrichers.Autodesk.Revit
configuration: Release
default_branch: ${{ github.event.repository.default_branch }}

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

# Install the .NET Core workload
- name: Install .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

# Build project: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build
- name: Build
run: dotnet build -c ${{ env.configuration }}

# Test project: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test
- name: Test
run: dotnet test -c ${{ env.configuration }} --logger trx --results-directory "TestResults"

# Upload tests results: https://github.com/dorny/test-reporter
- name: Upload tests results
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: dotnet tests
path: ./TestResults/*.trx
reporter: dotnet-trx

- name: Pack
run: dotnet pack -c ${{ env.configuration }} -o ${{ env.output }}

# Fetch version: https://github.com/kzrnm/get-net-sdk-project-versions-action
- name: Fetch version
uses: kzrnm/get-net-sdk-project-versions-action@v2
id: get-version
with:
proj-path: src/${{ env.project }}/${{ env.project }}.csproj

# Upload the nuget package: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload
uses: actions/upload-artifact@v4
with:
name: nuget
path: |
${{ env.output }}/*.nupkg
${{ env.output }}/*.snupkg
# Publish the nuget package: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push
- name: Publish nuget
if: github.ref_name == env.default_branch
run: dotnet nuget push ${{ env.output }}/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate

# Publish the nuget package: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push
- name: Publish github
if: github.ref_name == env.default_branch
run: dotnet nuget push ${{ env.output }}/**/*.nupkg -s https://nuget.pkg.github.com/${{ github.REPOSITORY_OWNER }}/index.json -k ${{ github.TOKEN }} --skip-duplicate

# Publish release: https://github.com/softprops/action-gh-release
- name: Publish Release
if: github.ref_name == env.default_branch
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
with:
tag_name: v${{ steps.get-version.outputs.package-version }}
name: v${{ steps.get-version.outputs.package-version }}
body: v${{ steps.get-version.outputs.package-version }}
draft: true
prerelease: false
files: |
${{ env.output }}/*.nupkg
${{ env.output }}/*.snupkg
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -395,4 +395,6 @@ FodyWeavers.xsd
# Rider auto-generates .iml files, and contentModel.xml
**/.idea/**/*.iml
**/.idea/**/contentModel.xml
**/.idea/**/modules.xml
**/.idea/**/modules.xml

/.idea
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v2.0.0] - 2024-05-14
### Add

- net8.0 target framework
- ci workflow
- CHANGELOG.md
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Biseuv Olzhas (dosymep)
Copyright (c) 2024 Biseuv Olzhas (dosymep)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Serilog.Enrichers.Autodesk.Revit

[![JetBrains Rider](https://img.shields.io/badge/JetBrains-Rider-blue.svg)](https://www.jetbrains.com/rider)
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE.md)
[![Revit 2017-2025](https://img.shields.io/badge/Revit-2017--2025-blue.svg)](https://www.autodesk.com/products/revit/overview)
[![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)


The Autodesk Revit enrichers for [Serilog](https://serilog.net).

### Getting started
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Enrichers.Autodesk.Revit", "Serilog.Enrichers.Autodesk.Revit\Serilog.Enrichers.Autodesk.Revit.csproj", "{61752A6F-6BA7-4536-9B2A-482771608632}"
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}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CF804FA7-56A6-4FA0-B201-118E593BD4CD}"
ProjectSection(SolutionItems) = preProject
..\.editorconfig = ..\.editorconfig
..\CONTRIBUTING.md = ..\CONTRIBUTING.md
..\CREDITS.md = ..\CREDITS.md
..\LICENSE.md = ..\LICENSE.md
..\README.md = ..\README.md
.editorconfig = .editorconfig
CONTRIBUTING.md = CONTRIBUTING.md
CREDITS.md = CREDITS.md
LICENSE.md = LICENSE.md
README.md = README.md
CHANGELOG.md = CHANGELOG.md
EndProjectSection
EndProject
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}"
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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
11 changes: 0 additions & 11 deletions src/.idea/.idea.Serilog.Enrichers.Autodeks.Revit/.idea/.gitignore

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions src/.idea/.idea.Serilog.Enrichers.Autodesk.Revit/.idea/.gitignore

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void CustomPropertyEnricherIsApplied() {

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

Assert.NotNull(testSink.LogEvent);
Assert.That(testSink.LogEvent, Is.Not.Null);
Assert.That(propertyValue, Is.EqualTo(GetScalarValue(testSink?.LogEvent, propertyName)));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net452;net8.0</TargetFrameworks>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand All @@ -15,14 +15,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1">
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Platforms>x64</Platforms>
<PackageIcon>autodesk-revit.png</PackageIcon>
<Authors>dosymep</Authors>
<Copyright>Copyright (c) 2023 Biseuv Olzhas (dosymep)</Copyright>
<Copyright>Copyright (c) 2024 Biseuv Olzhas (dosymep)</Copyright>
<PackageProjectUrl>https://github.com/dosymep/Serilog.Enrichers.Autodesk.Revit</PackageProjectUrl>
<RepositoryUrl>https://github.com/dosymep/Serilog.Enrichers.Autodesk.Revit.git</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
Expand Down Expand Up @@ -71,5 +71,7 @@
<PackagePath>\</PackagePath>
<Link>assets\README.md</Link>
</None>

<Content Include="../../.github/workflows/*.yml" Link="ci/%(FileName)$(FileExt)" />
</ItemGroup>
</Project>

0 comments on commit 64830aa

Please sign in to comment.