Skip to content

Commit

Permalink
Initial Checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
NinjaRocks committed Sep 7, 2024
1 parent 3eceafe commit ff357be
Show file tree
Hide file tree
Showing 11 changed files with 417 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/Build-Master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: build-master

on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal

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 }}'
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.GH_PACKAGES }}'
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: '${{ secrets.GH_PACKAGES }}'
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/Abacus.Net/Abacus.Net

steps:
- name: Step-01 Install GitVersion
uses: gittools/actions/gitversion/[email protected]
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/[email protected]
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/Abacus.Net/Abacus.Net

steps:
- name: Step-01 Install GitVersion
uses: gittools/actions/gitversion/[email protected]
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/[email protected]
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.GH_PACKAGES }}'
nuget-token: '${{ secrets.NUGET_API_KEY }}'
working-directory: /home/runner/work/Abacus.Net/Abacus.Net
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/Abacus.Net/releases \
-d '{"tag_name":v1.0.0,"target_commitish":"master","name":"Abacus.Net","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/Abacus.Net/bin/Release/*.nupkg --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json
77 changes: 77 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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:
push:
branches: [ "master" ]
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}}"
59 changes: 59 additions & 0 deletions Abacus.Net.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34723.18
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{1CE4C8AD-95A2-47C6-9BD4-B74489F19180}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Abacus", "src\Abacus\Abacus.csproj", "{27497BC2-CEEC-4E41-94C3-F34B766EF559}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{46374D3A-9676-43EE-AC28-8F526FC999A6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Abacus.Tests", "test\Abacus.Tests\Abacus.Tests.csproj", "{58A815EE-64AD-4DF0-BBC7-6129057B5857}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{0E4BFF47-6313-4986-9D5F-1B9371C70C61}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{D773D7AB-E024-4847-928A-0C5350E46E42}"
ProjectSection(SolutionItems) = preProject
.github\workflows\Build-Master.yml = .github\workflows\Build-Master.yml
.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}") = "solution", "solution", "{AB71176A-106F-48FB-A68C-4ECC4B352803}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
GitVersion.yml = GitVersion.yml
LICENSE = LICENSE
README.md = README.md
_config.yml = _config.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{27497BC2-CEEC-4E41-94C3-F34B766EF559}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27497BC2-CEEC-4E41-94C3-F34B766EF559}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27497BC2-CEEC-4E41-94C3-F34B766EF559}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27497BC2-CEEC-4E41-94C3-F34B766EF559}.Release|Any CPU.Build.0 = Release|Any CPU
{58A815EE-64AD-4DF0-BBC7-6129057B5857}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{58A815EE-64AD-4DF0-BBC7-6129057B5857}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58A815EE-64AD-4DF0-BBC7-6129057B5857}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58A815EE-64AD-4DF0-BBC7-6129057B5857}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{27497BC2-CEEC-4E41-94C3-F34B766EF559} = {1CE4C8AD-95A2-47C6-9BD4-B74489F19180}
{58A815EE-64AD-4DF0-BBC7-6129057B5857} = {46374D3A-9676-43EE-AC28-8F526FC999A6}
{D773D7AB-E024-4847-928A-0C5350E46E42} = {0E4BFF47-6313-4986-9D5F-1B9371C70C61}
{AB71176A-106F-48FB-A68C-4ECC4B352803} = {0E4BFF47-6313-4986-9D5F-1B9371C70C61}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EE293EA1-24BE-4270-B2B2-42846CA6D169}
EndGlobalSection
EndGlobal
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.0
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 README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# abacus
Workflow framework in .Net
## Workflow framework in .Net
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
markdown:GFM
9 changes: 9 additions & 0 deletions src/Abacus/Abacus.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
7 changes: 7 additions & 0 deletions src/Abacus/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Abacus
{
public class Class1
{

}
}
Loading

0 comments on commit ff357be

Please sign in to comment.