Skip to content

Commit

Permalink
Merge pull request #20 from IowaComputerGurus/feature/net6.0
Browse files Browse the repository at this point in the history
Updated to .NET 6.0
  • Loading branch information
mitchelsellers authored Dec 7, 2021
2 parents c589e51 + 1a9475d commit d242da5
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 26 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI Build

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
name: Validate Build
env:
solution-path: './src/NetCore.Utilities.Spreadsheet.sln'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Ensure .NET Installed
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Install GitVersion
run: dotnet tool install --global GitVersion.Tool

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
with:
useConfigFile: true

- name: Restore Packages
run: dotnet restore "${{ env.solution-path }}"
- name: Build
run: dotnet build "${{ env.solution-path }}" --no-restore --configuration Release -p:version=${{ steps.gitversion.outputs.majorMinorPatch }}
- name: Test
run: dotnet test "${{ env.solution-path }}" --no-build --configuration Release
42 changes: 42 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release Build

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
name: Build & Publish to NuGet
environment: nuget
env:
solution-path: './src/NetCore.Utilities.Spreadsheet.sln'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Ensure .NET Installed
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

- name: Install GitVersion
run: dotnet tool install --global GitVersion.Tool

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
with:
useConfigFile: true

- name: Restore Packages
run: dotnet restore "${{ env.solution-path }}"
- name: Build
run: dotnet build "${{ env.solution-path }}" --no-restore --configuration Release -p:version=${{ steps.gitversion.outputs.majorMinorPatch }}
- name: Test
run: dotnet test "${{ env.solution-path }}" --no-build --configuration Release

- name: Publish
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.ICG_NUGET_API_KEY}}
19 changes: 19 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
mode: ContinuousDeployment
next-version: 5.1.4
branches:
develop:
regex: develop
tag: 'alpha'
increment: Patch
source-branches: []
pull-request:
regex: (pull|pull\-requests|pr)[/-]
tag: 'pr'
tag-number-pattern: '[/-](?<number>\d+)[-/]'
increment: Patch
prevent-increment-of-merged-branch-version: false
is-release-branch: false
source-branches: []
ignore:
sha: []
merge-message-formats: {}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 IowaComputerGurus, Inc.
Copyright (c) 2021 IowaComputerGurus, Inc.

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
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# NetCore.Utilities.Spreadsheet ![](https://img.shields.io/github/license/iowacomputergurus/netcore.utilities.spreadsheet.svg)
A utility to assist in creating Excel spreadsheets in .NET Core and ASP.NET Core applications using the OpenXML library. This utility allows you to export collections of
.NET Objects to Excel by simply adding metadata information regarding the desired column formats, title etc. Allowing quick & consistent excel exports, without the hassle of trying
to understand the OpenXML format

![Build Status](https://github.com/IowaComputerGurus/netcore.utilities.spreadsheet/actions/workflows/ci-build.yml/badge.svg)

A utility to assist in creating Excel spreadsheets in .NET Core and ASP.NET Core applications using the OpenXML library. This utility allows you to export collections of .NET Objects to Excel by simply adding metadata information regarding the desired column formats, title etc. Allowing quick & consistent excel exports, without the hassle of trying to understand the OpenXML format

## NuGet Package Information
ICG.NetCore.Utilities.Spreadsheet ![](https://img.shields.io/nuget/v/icg.netcore.utilities.spreadsheet.svg) ![](https://img.shields.io/nuget/dt/icg.netcore.utilities.spreadsheet.svg)
Expand All @@ -13,21 +14,21 @@ This project depends on the DocumentFormat.OpenXml NuGet package provided by the

## Installation
Standard installation via NuGet Package Manager
```
``` powershell
Install-Package ICG.NetCore.Utilities.Spreadsheet
```

## Setup
To setup the needed dependency injection items for this library, add the following line in your DI setup.
```
``` csharp
services.UseIcgNetCoreUtilitiesSpreadsheet();
```

## Sample Single Document Export

Exporting a single collection to a single excel file can be done very simply.

```
```csharp
var exportGenerator = provider.GetService<ISpreadsheetGenerator>();
var exportDefinition = new SpreadsheetConfiguration<SimpleExportData>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DocumentFOrmat.OpenXml" Version="2.12.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
<PackageReference Include="DocumentFOrmat.OpenXml" Version="2.14.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<Reference Include="NetCore.Utilities.Spreadsheet">
<HintPath>..\..\src\NetCore.Utilities.Spreadsheet\bin\Debug\netcoreapp3.1\NetCore.Utilities.Spreadsheet.dll</HintPath>
<HintPath>..\..\src\NetCore.Utilities.Spreadsheet\bin\Debug\net6.0\NetCore.Utilities.Spreadsheet.dll</HintPath>
</Reference>
</ItemGroup>

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

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>

<RootNamespace>ICG.NetCore.Utilities.Spreadsheet.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

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

<PropertyGroup>
<Version>0.0.0</Version>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>ICG.NetCore.Utilities.Spreadsheet</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -20,18 +17,26 @@
<RepositoryUrl>https://github.com/IowaComputerGurus/netcore.utilities.spreadsheet</RepositoryUrl>
<Authors>MitchelSellers;IowaComputerGurus</Authors>
<Owners>IowaComputerGurus</Owners>
<PackageIconUrl>https://raw.githubusercontent.com/IowaComputerGurus/netcore.utilities.spreadsheet/master/icgAppIcon.png</PackageIconUrl>
<PackageIcon>icgAppIcon.png</PackageIcon>
<IsPackable>True</IsPackable>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup Condition="'$GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<None Include="icgAppIcon.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="2.12.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PackageReference Include="DocumentFormat.OpenXml" Version="2.14.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
File renamed without changes

0 comments on commit d242da5

Please sign in to comment.