Skip to content

Commit

Permalink
Merge pull request #2 from NinjaRocks/dev-01
Browse files Browse the repository at this point in the history
Upgrade to .net standard 2.1
  • Loading branch information
NinjaRocks committed May 18, 2023
2 parents 9fe0c45 + fdeedfa commit 38720ef
Show file tree
Hide file tree
Showing 9 changed files with 318 additions and 24 deletions.
162 changes: 162 additions & 0 deletions .github/workflows/CI-Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: CI
'on':
pull_request:
types: [opened, reopened, edited, synchronize]
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"
jobs:
Run-Lint:
runs-on: ubuntu-latest
env:
github-token: '${{ secrets.GITHUB_TOKEN }}'
steps:
- name: Step-01 Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Step-02 Lint Code Base
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: false
FILTER_REGEX_INCLUDE: .*src/.*
DEFAULT_BRANCH: master
GITHUB_TOKEN: '${{ env.github-token }}'
Build-Beta:
if: ${{ !startsWith(github.head_ref, 'release/')}}
runs-on: ubuntu-latest
outputs:
semVersion: ${{ steps.gitversion.outputs.MajorMinorPatch }}
branchName: ${{ steps.gitversion.outputs.branchName }}
env:
working-directory: /home/runner/work/FileUtil.Core/FileUtil.Core

steps:
- name: Step-01 Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: 5.x

- name: Step-02 Check out Code
uses: actions/checkout@v2
with:
fetch-depth: 0

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

- name: Step-04 Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Step-05 Restore dependencies
run: dotnet restore
working-directory: '${{ env.working-directory }}'

- name: Step-06 Build Beta Version
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }}
working-directory: '${{ env.working-directory }}'

- name: Step-07 Test Solution
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal
working-directory: '${{ env.working-directory }}'

- name: Step-08 Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifact
path: ${{env.working-directory}}
retention-days: 1
Build-Release:
if: ${{ startsWith(github.head_ref, 'release/') }}
runs-on: ubuntu-latest
outputs:
semVersion: ${{ steps.gitversion.outputs.MajorMinorPatch }}
branchName: ${{ steps.gitversion.outputs.branchName }}
env:
working-directory: /home/runner/work/FileUtil.Core/FileUtil.Core

steps:
- name: Step-01 Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: 5.x

- name: Step-02 Check out Code
uses: actions/checkout@v2
with:
fetch-depth: 0

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

- name: Step-04 Install .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Step-05 Restore dependencies
run: dotnet restore
working-directory: '${{ env.working-directory }}'

- name: Step-06 Build Release Version
if: ('startsWith(github.ref, ''refs/heads/release'')')
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}
working-directory: '${{ env.working-directory }}'

- name: Step-07 Test Solution
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal
working-directory: '${{ env.working-directory }}'

- name: Step-08 Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifact
path: ${{env.working-directory}}
retention-days: 1
Package-Release:
needs: [Build-Beta, Build-Release]
if: |
always() &&
(needs.Build-Beta.result == 'success' || needs.Build-Release.result == 'success')
runs-on: ubuntu-latest
outputs:
semVersion: ${{ needs.Build-Release.outputs.semVersion }}
env:
github-token: '${{ secrets.GITHUB_TOKEN }}'
nuget-token: '${{ secrets.NUGET_API_KEY }}'
working-directory: /home/runner/work/FileUtil.Core/FileUtil.Core
steps:
- name: Step-01 Retrieve Build Artifacts
uses: actions/download-artifact@v3
with:
name: build-artifact
path: ${{env.working-directory}}

- name: Step-02 Install Github Packages
run: dotnet tool install gpr --global

- name: Step-03 Publish to Github Packages
run: find -name "*.nupkg" -print -exec gpr push -k ${{env.github-token}} {} \;

- name: Step-02 Create Github Release
if: ${{ startsWith(github.head_ref, 'release/')}}
run: |
curl \
-X POST \
-H "Accept:application/vnd.github+json" \
-H "Authorization:token ${{ env.github-token }}" \
https://api.github.com/ninjarocks/FileUtil.Core/releases \
-d '{"tag_name":v1.0.0,"target_commitish":"master","name":"FileUtil.Core","body":"","draft":false,"prerelease":false,"generate_release_notes":false}'
- name: Step-03 Release to Nuget Org
if: ${{ startsWith(github.head_ref, 'release/')}}
run: dotnet nuget push ${{env.working-directory}}/src/FileUtil.Core/bin/Release/*.nupkg --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json
75 changes: 75 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
pull_request:
types: [opened, reopened, edited, synchronize]
paths-ignore:
- "**/*.md"
- "**/*.gitignore"
- "**/*.gitattributes"
schedule:
- cron: '35 15 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
15 changes: 15 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
next-version: 1.0.5
tag-prefix: '[vV]'
mode: ContinuousDeployment
branches:
master:
regex: ^master$
release:
regex: ^release$
develop:
regex: ^develop$|^dev$
tag: beta
pull-request:
tag: beta
ignore:
sha: []
2 changes: 1 addition & 1 deletion License.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Ninja
Copyright (c) 2016 Ninja Sha!4H

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
31 changes: 25 additions & 6 deletions Ninja.FileUtil.Core.sln
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2050
# Visual Studio Version 17
VisualStudioVersion = 17.6.33712.159
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{4181FF50-7335-4293-8EE4-66E0C47C736E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ninja.FileUtil", "src\Ninja.FileUtil\Ninja.FileUtil.csproj", "{FD920B11-BA4F-4781-BD56-56CF362982CF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ninja.FileUtil.Tests", "test\Ninja.FileUtil.Tests\Ninja.FileUtil.Tests.csproj", "{95A1410C-6FB4-446D-A692-9BC018882298}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{D549CC35-5318-45B0-ACCD-F28C543E482C}"
ProjectSection(SolutionItems) = preProject
.github\workflows\CI-Build.yml = .github\workflows\CI-Build.yml
.github\workflows\codeql.yml = .github\workflows\codeql.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8A1A1535-2928-4313-9AFC-9CA1892426E3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{F7C842B8-9D5C-4AF6-9F8B-779E1DEEEDC2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".misc", ".misc", "{8EDBC8F3-0169-4422-B44F-92AD9B9C8D5B}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
.travis.yml = .travis.yml
GitVersion.yml = GitVersion.yml
License.md = License.md
ms-icon-310x310.png = ms-icon-310x310.png
nuget.config = nuget.config
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ninja.FileUtil", "src\Ninja.FileUtil\Ninja.FileUtil.csproj", "{FD920B11-BA4F-4781-BD56-56CF362982CF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ninja.FileUtil.Tests", "test\Ninja.FileUtil.Tests\Ninja.FileUtil.Tests.csproj", "{95A1410C-6FB4-446D-A692-9BC018882298}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -36,6 +49,12 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{FD920B11-BA4F-4781-BD56-56CF362982CF} = {8A1A1535-2928-4313-9AFC-9CA1892426E3}
{95A1410C-6FB4-446D-A692-9BC018882298} = {F7C842B8-9D5C-4AF6-9F8B-779E1DEEEDC2}
{D549CC35-5318-45B0-ACCD-F28C543E482C} = {4181FF50-7335-4293-8EE4-66E0C47C736E}
{8EDBC8F3-0169-4422-B44F-92AD9B9C8D5B} = {4181FF50-7335-4293-8EE4-66E0C47C736E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {96B5A6F7-D0A4-4A34-890A-59E971AC4E94}
EndGlobalSection
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# FileUtil [![Build Status](https://travis-ci.org/NinjaRocks/FileUtil.Core.svg?branch=master)](https://travis-ci.org/NinjaRocks/FileUtil.Core) [![NuGet version](https://badge.fury.io/nu/FixedWidth.FileParser.svg)](https://badge.fury.io/nu/FixedWidth.FileParser) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/NinjaRocks/FileUtil.Core/blob/master/LICENSE)
.Net Library to read from fixed width or delimiter separated file using strongly typed objects.


# FileUtil
[![NuGet version](https://badge.fury.io/nu/FileUtil.Core.svg)](https://badge.fury.io/nu/FileUtil.Core) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/NinjaRocks/FileUtil.Core/blob/master/License.md) [![CI](https://github.com/NinjaRocks/FileUtil.Core/actions/workflows/CI-Build.yml/badge.svg)](https://github.com/NinjaRocks/FileUtil.Core/actions/workflows/CI-Build.yml) [![GitHub Release](https://img.shields.io/github/v/release/ninjarocks/FileUtil.Core?logo=github&sort=semver)](https://github.com/ninjarocks/FileUtil.Core/releases/latest)
[![CodeQL](https://github.com/NinjaRocks/FileUtil.Core/actions/workflows/codeql.yml/badge.svg)](https://github.com/NinjaRocks/FileUtil.Core/actions/workflows/codeql.yml) [![.Net Stardard](https://img.shields.io/badge/.Net%20Standard-2.1-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/2.1)
-------------
.Net Library to read from fixed width or delimiter separated file using strongly typed objects.


**Fixed Width or Delimiter Separated File**
Expand Down
Binary file added ninja-icon-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 25 additions & 7 deletions src/Ninja.FileUtil/Ninja.FileUtil.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<RepositoryType>Public</RepositoryType>
<RepositoryUrl>https://github.com/NinjaRocks/FileUtil.Core</RepositoryUrl>
<PackageTags>csv fixed width file delimiter parser</PackageTags>
<PackageTags>csv fixed-width delimiter-file delimiter file-parser file parser</PackageTags>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>.Net Library to read from fixed width or delimiter separated file using strongly typed objects.
Example: pipe delimited, csv, etc.</Description>
<PackageLicenseUrl>https://github.com/NinjaRocks/FileUtil.Core/blob/master/License.md</PackageLicenseUrl>
<NeutralLanguage>en-GB</NeutralLanguage>
<NeutralLanguage>en-GB</NeutralLanguage>
<Company>Ninja Corp</Company>
<Authors>Najaf Shayk</Authors>
<Authors>Ninja Shayk</Authors>
<PackageId>FixedWidth.FileParser</PackageId>
<Product>Fixed Width File Parser</Product>
<PackageProjectUrl>https://github.com/NinjaRocks/FileUtil.Core</PackageProjectUrl>
<PackageIconUrl>https://1drv.ms/u/s!Aq_ncig7TU4551b5fzxOad-pDMfL</PackageIconUrl>
<Version>1.1.0</Version>
<Version>1.1.1</Version>
<Title>FixedWidth.FileParser</Title>
<Copyright>© Copyright 2016 Ninja Sha!4h.</Copyright>
<PackageIcon>ninja-icon-16.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>License.md</PackageLicenseFile>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\License.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\ninja-icon-16.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
</Project>
Loading

0 comments on commit 38720ef

Please sign in to comment.