Skip to content

Commit 256cd3e

Browse files
committed
- Checkpoit: Initial project readme
1 parent 9775b0c commit 256cd3e

File tree

10 files changed

+207
-95
lines changed

10 files changed

+207
-95
lines changed

.github/workflows/codeql.yml renamed to .github/workflows/Master-CodeQL.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: "Master-CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "master" ]
1716
pull_request:
1817
types: [opened, reopened, edited, synchronize]
1918
paths-ignore:
@@ -74,4 +73,4 @@ jobs:
7473
- name: Perform CodeQL Analysis
7574
uses: github/codeql-action/analyze@v2
7675
with:
77-
category: "/language:${{matrix.language}}"
76+
category: "/language:${{matrix.language}}"
Lines changed: 70 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: CI
2-
'on':
1+
name: PullRequest-CI
2+
on:
33
pull_request:
44
types: [opened, reopened, edited, synchronize]
55
paths-ignore:
@@ -10,7 +10,7 @@ jobs:
1010
Run-Lint:
1111
runs-on: ubuntu-latest
1212
env:
13-
github-token: '${{ secrets.GH_PACKAGES }}'
13+
github-token: '${{ secrets.GITHUB_TOKEN }}'
1414
steps:
1515
- name: Step-01 Checkout code
1616
uses: actions/checkout@v3
@@ -22,12 +22,12 @@ jobs:
2222
VALIDATE_ALL_CODEBASE: false
2323
FILTER_REGEX_INCLUDE: .*src/.*
2424
DEFAULT_BRANCH: master
25-
GITHUB_TOKEN: '${{ secrets.GH_PACKAGES }}'
26-
Build-Beta:
27-
if: ${{ !startsWith(github.head_ref, 'release/')}}
25+
GITHUB_TOKEN: '${{ env.github-token }}'
26+
Build-Test:
2827
runs-on: ubuntu-latest
2928
outputs:
30-
semVersion: ${{ steps.gitversion.outputs.MajorMinorPatch }}
29+
release_Version: ${{ steps.gitversion.outputs.MajorMinorPatch }}
30+
beta_Version: ${{ steps.gitversion.outputs.nuGetVersion }}
3131
branchName: ${{ steps.gitversion.outputs.branchName }}
3232
env:
3333
working-directory: /home/runner/work/ApiAggregator/ApiAggregator
@@ -58,62 +58,18 @@ jobs:
5858
run: dotnet restore
5959
working-directory: '${{ env.working-directory }}'
6060

61-
- name: Step-06 Build Beta Version
61+
- name: Step-06 Build Version (Beta)
62+
if: ${{ !startsWith(github.head_ref, 'release/')}}
6263
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.nuGetVersion }}
6364
working-directory: '${{ env.working-directory }}'
6465

65-
- name: Step-07 Test Solution
66-
run: dotnet test --configuration Release --no-build --no-restore --verbosity normal
67-
working-directory: '${{ env.working-directory }}'
68-
69-
- name: Step-08 Upload Build Artifacts
70-
uses: actions/upload-artifact@v3
71-
with:
72-
name: build-artifact
73-
path: ${{env.working-directory}}
74-
retention-days: 1
75-
Build-Release:
76-
if: ${{ startsWith(github.head_ref, 'release/') }}
77-
runs-on: ubuntu-latest
78-
outputs:
79-
semVersion: ${{ steps.gitversion.outputs.MajorMinorPatch }}
80-
branchName: ${{ steps.gitversion.outputs.branchName }}
81-
env:
82-
working-directory: /home/runner/work/ApiAggregator/ApiAggregator
83-
84-
steps:
85-
- name: Step-01 Install GitVersion
86-
uses: gittools/actions/gitversion/[email protected]
87-
with:
88-
versionSpec: 5.x
89-
90-
- name: Step-02 Check out Code
91-
uses: actions/checkout@v2
92-
with:
93-
fetch-depth: 0
94-
95-
- name: Step-03 Calculate Version
96-
id: gitversion
97-
uses: gittools/actions/gitversion/[email protected]
98-
with:
99-
useConfigFile: true
100-
101-
- name: Step-04 Install .NET
102-
uses: actions/setup-dotnet@v3
103-
with:
104-
dotnet-version: 6.0.x
105-
106-
- name: Step-05 Restore dependencies
107-
run: dotnet restore
108-
working-directory: '${{ env.working-directory }}'
109-
110-
- name: Step-06 Build Release Version
111-
if: ('startsWith(github.ref, ''refs/heads/release'')')
66+
- name: Step-06 Build Version (Release)
67+
if: ${{ startsWith(github.head_ref, 'release/')}}
11268
run: dotnet build --configuration Release --no-restore -p:PackageVersion=${{ steps.gitversion.outputs.MajorMinorPatch }}
11369
working-directory: '${{ env.working-directory }}'
11470

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

11975
- name: Step-08 Upload Build Artifacts
@@ -122,16 +78,14 @@ jobs:
12278
name: build-artifact
12379
path: ${{env.working-directory}}
12480
retention-days: 1
125-
Package-Release:
126-
needs: [Build-Beta, Build-Release]
127-
if: |
128-
always() &&
129-
(needs.Build-Beta.result == 'success' || needs.Build-Release.result == 'success')
81+
82+
Package:
83+
needs: [Build-Test]
13084
runs-on: ubuntu-latest
13185
outputs:
13286
semVersion: ${{ needs.Build-Release.outputs.semVersion }}
13387
env:
134-
github-token: '${{ secrets.GH_PACKAGES }}'
88+
github-token: '${{ secrets.GITHUB_TOKEN }}'
13589
nuget-token: '${{ secrets.NUGET_API_KEY }}'
13690
working-directory: /home/runner/work/ApiAggregator/ApiAggregator
13791
steps:
@@ -147,16 +101,60 @@ jobs:
147101
- name: Step-03 Publish to Github Packages
148102
run: find -name "*.nupkg" -print -exec gpr push -k ${{env.github-token}} {} \;
149103

150-
- name: Step-02 Create Github Release
151-
if: ${{ startsWith(github.head_ref, 'release/')}}
152-
run: |
153-
curl \
154-
-X POST \
155-
-H "Accept:application/vnd.github+json" \
156-
-H "Authorization:token ${{ env.github-token }}" \
157-
https://api.github.com/codeshayk/ApiAggregator/releases \
158-
-d '{"tag_name":v1.0.0,"target_commitish":"master","name":"ApiAggregator","body":"","draft":false,"prerelease":false,"generate_release_notes":false}'
159-
160104
- name: Step-03 Release to Nuget Org
161105
if: ${{ startsWith(github.head_ref, 'release/')}}
162106
run: dotnet nuget push ${{env.working-directory}}/src/ApiAggregator/bin/Release/*.nupkg --skip-duplicate --api-key ${{ env.nuget-token }} --source https://api.nuget.org/v3/index.json
107+
108+
Release:
109+
name: Release to Nuget
110+
needs: [Package]
111+
if: ${{ startsWith(github.head_ref, 'release/')}}
112+
runs-on: ubuntu-latest
113+
steps:
114+
- uses: actions/checkout@v2
115+
116+
# - name: Setup dotnet
117+
# uses: actions/setup-dotnet@v1
118+
# with:
119+
# dotnet-version: '6.0.x'
120+
121+
# Publish
122+
- name: publish ApiAggregator package
123+
id: publish_nuget
124+
uses: Rebel028/[email protected]
125+
with:
126+
# Filepath of the project to be packaged, relative to root of repository
127+
PROJECT_FILE_PATH: ApiAggregator/ApiAggregator.csproj
128+
129+
# NuGet package id, used for version detection & defaults to project name
130+
PACKAGE_NAME: ApiAggregator
131+
132+
# Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH
133+
# VERSION_FILE_PATH: Directory.Build.props
134+
135+
# Regex pattern to extract version info in a capturing group
136+
# VERSION_REGEX: ^\s*<Version>(.*)<\/Version>\s*$
137+
138+
# Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX
139+
# VERSION_STATIC: 1.0.0
140+
141+
# Flag to toggle git tagging, enabled by default
142+
# TAG_COMMIT: true
143+
144+
# Format of the git tag, [*] gets replaced with actual version
145+
# TAG_FORMAT: v*
146+
147+
# API key to authenticate with NuGet server, or a token, issued for GITHUB_USER if you use GPR
148+
# NUGET_KEY: ${{secrets.NUGET_API_KEY}}
149+
150+
# NuGet server uri hosting the packages, defaults to https://api.nuget.org
151+
# NUGET_SOURCE: https://api.nuget.org
152+
153+
# Flag to toggle pushing symbols along with nuget package to the server, disabled by default
154+
# INCLUDE_SYMBOLS: false
155+
156+
# Flag to throw an error when trying to publish an existing version of a package
157+
# THOW_ERROR_IF_VERSION_EXISTS: false
158+
159+
# Flag to add the `--no-build` option to the `dotnet pack` command. Enabled by default.
160+
# PACK_NO_BUILD: true
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}}"

ApiAggregator.sln

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ VisualStudioVersion = 17.9.34723.18
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4338FF70-3C81-4370-ACFB-00E14545BA99}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiAggregator", "src\ApiAggregator\ApiAggregator.csproj", "{8250784C-5415-47C2-9FE4-9E54FA4672B6}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApiAggregator.Net", "src\ApiAggregator\ApiAggregator.Net.csproj", "{8250784C-5415-47C2-9FE4-9E54FA4672B6}"
99
EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{31E7A02C-167D-46FB-A90A-F3995FD5682D}"
1111
EndProject
@@ -19,9 +19,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "misc", "misc", "{D6340772-5
1919
EndProject
2020
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{BCE2D3FE-6CF1-4932-9DEE-5B761A132C5E}"
2121
ProjectSection(SolutionItems) = preProject
22-
.github\workflows\Build-Master.yml = .github\workflows\Build-Master.yml
23-
.github\workflows\CI-Build.yml = .github\workflows\CI-Build.yml
24-
.github\workflows\codeql.yml = .github\workflows\codeql.yml
22+
.github\workflows\Master-Build.yml = .github\workflows\Master-Build.yml
23+
.github\workflows\Master-CodeQL.yml = .github\workflows\Master-CodeQL.yml
24+
.github\workflows\PullRequest-CI.yml = .github\workflows\PullRequest-CI.yml
25+
.github\workflows\PullRequest-CodeQL.yml = .github\workflows\PullRequest-CodeQL.yml
2526
EndProjectSection
2627
EndProject
2728
Global

Images/ninja-icon-16.png

15.3 KB
Loading

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
# ApiAggregator
2-
Framework for extending or aggregating apis together.
1+
# <img src="https://github.com/CodeShayk/ApiAggregator/blob# <img src="https://github.com/CodeShayk/ApiAggregator/blob/master/Images/ninja-icon-16.png" alt="ninja" style="width:30px;"/> ApiAggregator.Net v1.0
2+
[![NuGet version](https://badge.fury.io/nu/ApiAggregator.svg)](https://badge.fury.io/nu/ApiAggregator) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CodeShayk/ApiAggregator/blob/master/LICENSE.md)
3+
[![Master-Build](https://github.com/CodeShayk/ApiAggregator/actions/workflows/Build-Master.yml/badge.svg)](https://github.com/CodeShayk/ApiAggregator/actions/workflows/Build-Master.yml)
4+
[![GitHub Release](https://img.shields.io/github/v/release/CodeShayk/ApiAggregator?logo=github&sort=semver)](https://github.com/CodeShayk/ApiAggregator/releases/latest)
5+
[![Master-CodeQL](https://github.com/CodeShayk/ApiAggregator/actions/workflows/Master-CodeQL.yml/badge.svg)](https://github.com/CodeShayk/ApiAggregator/actions/workflows/Master-CodeQL.yml)
6+
[![.Net 8.0](https://img.shields.io/badge/.Net-8.0-blue)](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
7+
--
8+
## Introduction
9+
### What is ApiAggregator?
10+
`ApiAggregator` is a .net utility to aggregate multiple api requests to return a single composed response. The utility allows cherry picking the list of apis on demand if needed.
11+
12+
#### Extends `Schemio` for APIs
13+
ApiAggregator consumes `Schemio` to extend support for apis to configure hierarchical graphs of `query`/`transformer` pairs to return a single aggregated response.
14+
You can read on [Schemio](https://github.com/CodeShayk/Schemio) for more details.
15+
16+
## Using ApiAggregator
17+
Coming soon
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<Title>ApiAggregator.Net</Title>
8+
<Authors>CodeShayk</Authors>
9+
<Company>CodeShayk</Company>
10+
<Description>.Net utility to aggregate multiple api requests to return a single composite response. </Description>
11+
<PackageIcon>ninja-icon-16.png</PackageIcon>
12+
<PackageReadmeFile>README.md</PackageReadmeFile>
13+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
14+
<Copyright>Copyright (c) 2024 Code Shayk</Copyright>
15+
<RepositoryType>https://github.com/CodeShayk/ApiAggregator</RepositoryType>
16+
<PackageTags>api, aggregator, api-aggregator, utility, api-utility, data-aggregator, api-response, api-response-aggregator</PackageTags>
17+
<IncludeSymbols>True</IncludeSymbols>
18+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
19+
</PropertyGroup>
20+
21+
<ItemGroup>
22+
<None Include="..\..\Images\ninja-icon-16.png">
23+
<Pack>True</Pack>
24+
<PackagePath>\</PackagePath>
25+
</None>
26+
<None Include="..\..\README.md">
27+
<Pack>True</Pack>
28+
<PackagePath>\</PackagePath>
29+
</None>
30+
</ItemGroup>
31+
32+
<ItemGroup>
33+
<PackageReference Include="Schemio.Core" Version="1.0.0" />
34+
</ItemGroup>
35+
36+
</Project>

src/ApiAggregator/ApiAggregator.csproj

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/ApiAggregator.Tests/ApiAggregator.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</ItemGroup>
1919

2020
<ItemGroup>
21-
<ProjectReference Include="..\..\src\ApiAggregator\ApiAggregator.csproj" />
21+
<ProjectReference Include="..\..\src\ApiAggregator\ApiAggregator.Net.csproj" />
2222
</ItemGroup>
2323

2424
</Project>

0 commit comments

Comments
 (0)