Skip to content

Commit 3061ba1

Browse files
committed
- Initial Checkpoint commit
1 parent 54ccd75 commit 3061ba1

9 files changed

Lines changed: 622 additions & 2 deletions

File tree

.github/workflows/Master-Build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: master-build
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Setup .NET
15+
uses: actions/setup-dotnet@v3
16+
with:
17+
dotnet-version: 9.0.x
18+
- name: Restore dependencies
19+
run: dotnet restore
20+
- name: Build
21+
run: dotnet build --no-restore
22+
- name: Test
23+
run: dotnet test --no-build --verbosity normal
24+
25+
run-Lint:
26+
runs-on: ubuntu-latest
27+
env:
28+
github-token: '${{ secrets.GITHUB_TOKEN }}'
29+
steps:
30+
- name: Step-01 Checkout code
31+
uses: actions/checkout@v3
32+
with:
33+
fetch-depth: 0
34+
- name: Step-02 Lint Code Base
35+
uses: github/super-linter@v4
36+
env:
37+
VALIDATE_ALL_CODEBASE: false
38+
FILTER_REGEX_INCLUDE: .*src/.*
39+
DEFAULT_BRANCH: master
40+
GITHUB_TOKEN: '${{ env.github-token }}'
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "master-codeql"
13+
14+
on:
15+
push:
16+
pull_request:
17+
types: [opened, reopened, edited, synchronize]
18+
paths-ignore:
19+
- "**/*.md"
20+
- "**/*.gitignore"
21+
- "**/*.gitattributes"
22+
schedule:
23+
- cron: '35 15 * * 2'
24+
25+
jobs:
26+
analyze:
27+
name: Analyze
28+
runs-on: ubuntu-latest
29+
permissions:
30+
actions: read
31+
contents: read
32+
security-events: write
33+
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
language: [ 'csharp' ]
38+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
39+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v3
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v2
48+
with:
49+
languages: ${{ matrix.language }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
53+
54+
# 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
55+
# queries: security-extended,security-and-quality
56+
57+
58+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59+
# If this step fails, then you should remove it and run the build manually (see below)
60+
- name: Autobuild
61+
uses: github/codeql-action/autobuild@v2
62+
63+
# ℹ️ Command-line programs to run using the OS shell.
64+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
65+
66+
# If the Autobuild fails above, remove it and uncomment the following three lines.
67+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
68+
69+
# - run: |
70+
# echo "Run, Build Application using script"
71+
# ./location_of_script_within_repo/buildscript.sh
72+
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v2
75+
with:
76+
category: "/language:${{matrix.language}}"
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: pullrequest-ci
2+
on:
3+
pull_request:
4+
types: [opened, reopened, edited, synchronize]
5+
paths-ignore:
6+
- "**/*.md"
7+
- "**/*.gitignore"
8+
- "**/*.gitattributes"
9+
jobs:
10+
Run-Lint:
11+
runs-on: ubuntu-latest
12+
env:
13+
github-token: '${{ secrets.GH_Packages }}'
14+
steps:
15+
- name: Step-01 Checkout code
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Step-02 Lint Code Base
20+
uses: github/super-linter@v4
21+
env:
22+
VALIDATE_ALL_CODEBASE: false
23+
FILTER_REGEX_INCLUDE: .*src/.*
24+
DEFAULT_BRANCH: master
25+
GITHUB_TOKEN: '${{ env.github-token }}'
26+
Build-Test:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
release_Version: ${{ steps.gitversion.outputs.MajorMinorPatch }}
30+
beta_Version: ${{ steps.gitversion.outputs.nuGetVersion }}
31+
branchName: ${{ steps.gitversion.outputs.branchName }}
32+
env:
33+
working-directory: /home/runner/work/parsley.net/parsley.net
34+
35+
steps:
36+
- name: Step-01 Install GitVersion
37+
uses: gittools/actions/gitversion/setup@v0.9.7
38+
with:
39+
versionSpec: 5.x
40+
41+
- name: Step-02 Check out Code
42+
uses: actions/checkout@v2
43+
with:
44+
fetch-depth: 0
45+
46+
- name: Step-03 Calculate Version
47+
id: gitversion
48+
uses: gittools/actions/gitversion/execute@v0.9.7
49+
with:
50+
useConfigFile: true
51+
52+
- name: Step-04 Install .NET
53+
uses: actions/setup-dotnet@v3
54+
with:
55+
dotnet-version: 9.0.x
56+
57+
- name: Step-05 Restore dependencies
58+
run: dotnet restore
59+
working-directory: '${{ env.working-directory }}'
60+
61+
- name: Step-06 Build Version (Beta)
62+
if: ${{ !startsWith(github.head_ref, 'release/')}}
63+
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }}
64+
working-directory: '${{ env.working-directory }}'
65+
66+
- name: Step-06 Build Version (Release)
67+
if: ${{ startsWith(github.head_ref, 'release/')}}
68+
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}
69+
working-directory: '${{ env.working-directory }}'
70+
71+
- name: Step-07 Test Solution
72+
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal
73+
working-directory: '${{ env.working-directory }}'
74+
75+
- name: Step-08 Upload Build Artifacts
76+
uses: actions/upload-artifact@v3
77+
with:
78+
name: build-artifact
79+
path: ${{env.working-directory}}
80+
retention-days: 1
81+
82+
Package:
83+
needs: [Build-Test]
84+
runs-on: ubuntu-latest
85+
outputs:
86+
semVersion: ${{ needs.Build-Release.outputs.semVersion }}
87+
env:
88+
github-token: '${{ secrets.GH_Packages }}'
89+
nuget-token: '${{ secrets.NUGET_API_KEY }}'
90+
working-directory: /home/runner/work/parsley.net/parsley.net
91+
steps:
92+
- name: Step-01 Retrieve Build Artifacts
93+
uses: actions/download-artifact@v3
94+
with:
95+
name: build-artifact
96+
path: ${{env.working-directory}}
97+
98+
- name: Step-02 Install Github Packages
99+
run: dotnet tool install gpr --global
100+
101+
- name: Step-03 Publish to Github Packages
102+
run: find -name "*.nupkg" -print -exec gpr push -k ${{env.github-token}} {} \;
103+
104+
Release:
105+
name: Release to Nuget
106+
needs: [Package]
107+
if: ${{ startsWith(github.head_ref, 'release/')}}
108+
runs-on: ubuntu-latest
109+
env:
110+
nuget-token: '${{ secrets.NUGET_API_KEY }}'
111+
working-directory: /home/runner/work/parsley.net/parsley.net
112+
steps:
113+
- name: Step-01 Retrieve Build Artifacts
114+
uses: actions/download-artifact@v3
115+
with:
116+
name: build-artifact
117+
path: ${{env.working-directory}}
118+
- name: Step-03 Release to Nuget Org
119+
if: ${{ startsWith(github.head_ref, 'release/')}}
120+
run: dotnet nuget push ${{env.working-directory}}/src/parsley.net/bin/Release/*.nupkg --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json
121+
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "pullrequest-codeql"
13+
14+
on:
15+
push:
16+
pull_request:
17+
types: [opened, reopened, edited, synchronize]
18+
paths-ignore:
19+
- "**/*.md"
20+
- "**/*.gitignore"
21+
- "**/*.gitattributes"
22+
schedule:
23+
- cron: '35 15 * * 2'
24+
25+
jobs:
26+
analyze:
27+
name: Analyze
28+
runs-on: ubuntu-latest
29+
permissions:
30+
actions: read
31+
contents: read
32+
security-events: write
33+
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
language: [ 'csharp' ]
38+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
39+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v3
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v2
48+
with:
49+
languages: ${{ matrix.language }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
53+
54+
# 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
55+
# queries: security-extended,security-and-quality
56+
57+
58+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
59+
# If this step fails, then you should remove it and run the build manually (see below)
60+
- name: Autobuild
61+
uses: github/codeql-action/autobuild@v2
62+
63+
# ℹ️ Command-line programs to run using the OS shell.
64+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
65+
66+
# If the Autobuild fails above, remove it and uncomment the following three lines.
67+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
68+
69+
# - run: |
70+
# echo "Run, Build Application using script"
71+
# ./location_of_script_within_repo/buildscript.sh
72+
73+
- name: Perform CodeQL Analysis
74+
uses: github/codeql-action/analyze@v2
75+
with:
76+
category: "/language:${{matrix.language}}"

GitVersion.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
next-version: 1.0.0
2+
tag-prefix: '[vV]'
3+
mode: ContinuousDeployment
4+
branches:
5+
master:
6+
regex: ^master$
7+
release:
8+
regex: ^release$
9+
develop:
10+
regex: ^develop$|^dev$
11+
tag: beta
12+
pull-request:
13+
tag: beta
14+
ignore:
15+
sha: []

Images/ninja-icon-16.png

15.3 KB
Loading

0 commit comments

Comments
 (0)