diff --git a/.github/workflows/CI-Build.yml b/.github/workflows/CI-Build.yml new file mode 100644 index 0000000..0b4f431 --- /dev/null +++ b/.github/workflows/CI-Build.yml @@ -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 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..078a395 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -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}}" diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..74170bf --- /dev/null +++ b/GitVersion.yml @@ -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: [] \ No newline at end of file diff --git a/License.md b/License.md index a72acc3..9c4a095 100644 --- a/License.md +++ b/License.md @@ -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 diff --git a/Ninja.FileUtil.Core.sln b/Ninja.FileUtil.Core.sln index cb27d77..fd34bbb 100644 --- a/Ninja.FileUtil.Core.sln +++ b/Ninja.FileUtil.Core.sln @@ -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 @@ -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 diff --git a/README.md b/README.md index c366789..e7caf19 100644 --- a/README.md +++ b/README.md @@ -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** diff --git a/ninja-icon-16.png b/ninja-icon-16.png new file mode 100644 index 0000000..f8903fb Binary files /dev/null and b/ninja-icon-16.png differ diff --git a/src/Ninja.FileUtil/Ninja.FileUtil.csproj b/src/Ninja.FileUtil/Ninja.FileUtil.csproj index 4932366..f9442e1 100644 --- a/src/Ninja.FileUtil/Ninja.FileUtil.csproj +++ b/src/Ninja.FileUtil/Ninja.FileUtil.csproj @@ -1,21 +1,39 @@ - + - netstandard2.0 + netstandard2.1 Public https://github.com/NinjaRocks/FileUtil.Core - csv fixed width file delimiter parser + csv fixed-width delimiter-file delimiter file-parser file parser true true .Net Library to read from fixed width or delimiter separated file using strongly typed objects. Example: pipe delimited, csv, etc. - https://github.com/NinjaRocks/FileUtil.Core/blob/master/License.md - en-GB + en-GB Ninja Corp - Najaf Shayk + Ninja Shayk FixedWidth.FileParser Fixed Width File Parser https://github.com/NinjaRocks/FileUtil.Core https://1drv.ms/u/s!Aq_ncig7TU4551b5fzxOad-pDMfL - 1.1.0 + 1.1.1 + FixedWidth.FileParser + © Copyright 2016 Ninja Sha!4h. + ninja-icon-16.png + README.md + License.md + + + True + \ + + + True + \ + + + True + \ + + \ No newline at end of file diff --git a/test/Ninja.FileUtil.Tests/Ninja.FileUtil.Tests.csproj b/test/Ninja.FileUtil.Tests/Ninja.FileUtil.Tests.csproj index 3d209e0..524e929 100644 --- a/test/Ninja.FileUtil.Tests/Ninja.FileUtil.Tests.csproj +++ b/test/Ninja.FileUtil.Tests/Ninja.FileUtil.Tests.csproj @@ -1,15 +1,20 @@ - + - netcoreapp2.0 + net6.0 + enable + enable + false - - - - + + + + + +