Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1e44674

Browse filesBrowse files
Migrated CICD to github actions (#77)
* Migrated CICD to github actions * dropped support for azure dev ops * updated badge on primary readme * added special read me for the nuget packages
1 parent 0f0a3d2 commit 1e44674
Copy full SHA for 1e44674
Expand file treeCollapse file tree

16 files changed

+441
-466
lines changed

‎.github/pull_request_template.md

Copy file name to clipboardExpand all lines: .github/pull_request_template.md
-26Lines changed: 0 additions & 26 deletions
This file was deleted.

‎.github/workflows/ci-build.yml

Copy file name to clipboard
+65Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This action executes on every push to master (usually as a result of a PR)
2+
# and commit to a branch that is a PR against master
3+
# to ensure the code base is up to standards
4+
#
5+
# Expected Standards
6+
# -----------------------------
7+
# 0 failed units
8+
# 0 Build Errors, 0 Build Warnings
9+
10+
11+
name: CI-CD
12+
on:
13+
push:
14+
branches:
15+
- master
16+
17+
pull_request:
18+
branches:
19+
- master
20+
21+
env:
22+
SLN_PATH: ./src/graphql-aspnet.sln
23+
DOTNET_CURRENT: 6.x
24+
DOTNET_LTS: 3.1.x
25+
26+
jobs:
27+
build:
28+
name: Sanity Build
29+
runs-on: ubuntu-20.04
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
name: Checkout Code
34+
35+
# ---------------------------------------
36+
# Install .NET Versions
37+
# ---------------------------------------
38+
- uses: actions/setup-dotnet@v2
39+
name: Install .NET (${{ env.DOTNET_LTS }})
40+
with:
41+
dotnet-version: ${{ env.DOTNET_LTS }}
42+
43+
- uses: actions/setup-dotnet@v2
44+
name: Install .NET (${{ env.DOTNET_CURRENT }})
45+
with:
46+
dotnet-version: ${{ env.DOTNET_CURRENT }}
47+
48+
# ---------------------------------------
49+
# Configure the build environment
50+
# ---------------------------------------
51+
- name: Configure Build
52+
run: ./build/configure-ci-build.ps1
53+
shell: pwsh
54+
55+
# ---------------------------------------
56+
# Restore, Build and Test
57+
# ---------------------------------------
58+
- name: Nuget Restore
59+
run: dotnet restore ${{ env.SLN_PATH }}
60+
61+
- name: Build Solution
62+
run: dotnet build ${{ env.SLN_PATH }} --configuration Release --no-restore
63+
64+
- name: Test Solution
65+
run: dotnet test ${{ env.SLN_PATH }} --no-restore
+105Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# This action executes on every push to master (usually as a result of a PR)
2+
# to ensure the code base that is actually in master passes all expectations
3+
4+
name: Nuget Deployment
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
version-number:
9+
description: "Version Number (e.g. 1.2.3)"
10+
required: true
11+
type: string
12+
version-suffix:
13+
description: "Version Suffix (e.g. 'beta')"
14+
required: false
15+
type: string
16+
17+
env:
18+
DOTNET_CURRENT: 6.x
19+
DOTNET_LTS: 3.1.x
20+
SLN_PATH: ./src/graphql-aspnet.sln
21+
PRIMARY_LIB_PATH: ./src/graphql-aspnet/graphql-aspnet.csproj
22+
SUBSCRIPTIONS_LIB_PATH: ./src/graphql-aspnet-subscriptions/graphql-aspnet-subscriptions.csproj
23+
BUILD_CONFIG: Release
24+
OUTPUT_DIR: ./output
25+
NUGET_KEY: ${{secrets.NUGET_KEY}}
26+
27+
jobs:
28+
deployment:
29+
name: Pack & Deploy
30+
runs-on: ubuntu-20.04
31+
32+
steps:
33+
- uses: actions/checkout@v3
34+
name: Checkout Code
35+
36+
# ---------------------------------------
37+
# Install .NET Versions
38+
# ---------------------------------------
39+
- uses: actions/setup-dotnet@v2
40+
name: Install .NET (${{env.DOTNET_LTS}})
41+
with:
42+
dotnet-version: ${{env.DOTNET_LTS}}
43+
44+
- uses: actions/setup-dotnet@v2
45+
name: Install .NET (${{env.DOTNET_CURRENT}})
46+
with:
47+
dotnet-version: ${{env.DOTNET_CURRENT}}
48+
49+
# ---------------------------------------
50+
# Configure the build environment
51+
# ---------------------------------------
52+
- name: Configure Build
53+
run: ./build/configure-ci-build.ps1
54+
shell: pwsh
55+
56+
# ---------------------------------------
57+
# Restore, Build and Test
58+
# ---------------------------------------
59+
- name: Nuget Restore
60+
run: dotnet restore ${{env.SLN_PATH}}
61+
62+
- name: Build Solution
63+
run: dotnet build ${{env.SLN_PATH}} --configuration ${{env.BUILD_CONFIG}} --no-restore --verbosity normal
64+
65+
- name: Test Solution
66+
run: dotnet test ${{env.SLN_PATH}} --configuration ${{env.BUILD_CONFIG}} --no-restore --no-build
67+
68+
# ---------------------------------------
69+
# Preflight Checks and Packaging
70+
# ---------------------------------------
71+
- name: Pre-Package Inspection
72+
run: |
73+
./build/pre-package-checks.ps1 -csProjFile "${{env.PRIMARY_LIB_PATH}}" -versionNumber ${{inputs.version-number}} -versionSuffix "${{inputs.version-suffix}}"
74+
./build/pre-package-checks.ps1 -csProjFile "${{env.SUBSCRIPTIONS_LIB_PATH}}" -versionNumber ${{inputs.version-number}} -versionSuffix "${{inputs.version-suffix}}"
75+
shell: pwsh
76+
77+
- name: Package Contents
78+
run: |
79+
dotnet pack "${{env.PRIMARY_LIB_PATH}}" --configuration ${{env.BUILD_CONFIG}} --no-restore --include-symbols --output ${{env.OUTPUT_DIR}} /p:VersionPrefix=${{inputs.version-number}} /p:VersionSuffix="${{inputs.version-suffix}}"
80+
dotnet pack "${{env.SUBSCRIPTIONS_LIB_PATH}}" --configuration ${{env.BUILD_CONFIG}} --no-restore --include-symbols --output ${{env.OUTPUT_DIR}} /p:VersionPrefix=${{inputs.version-number}} /p:VersionSuffix="${{inputs.version-suffix}}"
81+
82+
# ---------------------------------------
83+
# Save Artifacts for later debugging
84+
# ---------------------------------------
85+
- uses: actions/upload-artifact@v3
86+
name: Save Artifacts
87+
with:
88+
name: generated-nuget-packages
89+
path: ${{env.OUTPUT_DIR}}/*
90+
91+
# ---------------------------------------
92+
# Post Processing Checks
93+
# ---------------------------------------
94+
- name: Post-Package Inspection
95+
run: |
96+
./build/post-package-checks.ps1 -csProjFile "${{env.PRIMARY_LIB_PATH}}" -versionNumber ${{inputs.version-number}} -versionSuffix "${{inputs.version-suffix}}" -outputDirectory ${{env.OUTPUT_DIR}}
97+
./build/post-package-checks.ps1 -csProjFile "${{env.SUBSCRIPTIONS_LIB_PATH}}" -versionNumber ${{inputs.version-number}} -versionSuffix "${{inputs.version-suffix}}" -outputDirectory ${{env.OUTPUT_DIR}}
98+
shell: pwsh
99+
100+
# ---------------------------------------
101+
# Deploy to Nuget
102+
# ---------------------------------------
103+
# - name: Publish To Nuget
104+
# run: dotnet nuget push "${{env.OUTPUT_DIR}}/*.nupkg" --source 'https://api.nuget.org/v3/index.json' --api-key "${{env.NUGET_KEY}}"
105+

‎README.md

Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GraphQL ASP.NET is a fully featured graphql library that utilizes a controller/a
88

99
| Recent Builds | |
1010
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
11-
| Master | [![Master Branch Build Status](https://dev.azure.com/graphqlaspnet/GraphQL%20ASP.NET/_apis/build/status/CI%20%26%20Deployment%20Build?branchName=master)](https://dev.azure.com/graphqlaspnet/GraphQL%20ASP.NET/_build/latest?definitionId=4&branchName=master) |
11+
| Master | [![CI-CD](https://github.com/graphql-aspnet/graphql-aspnet/actions/workflows/ci-build.yml/badge.svg)](https://github.com/graphql-aspnet/graphql-aspnet/actions/workflows/ci-build.yml) |
1212

1313
#### Example Usage:
1414

‎build/configure-ci-build.ps1

Copy file name to clipboard
+27Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
# Configures the folder to execute a CI build
3+
4+
5+
# copy in the strict linting rules to force any
6+
# build warnings to actual errors
7+
$strictLintPath = "./build/strict-linting.ruleset"
8+
$developerLintPath = "./src/styles.ruleset"
9+
10+
Write-Host "Configuring Environment for CI Build" -ForegroundColor Yellow
11+
12+
if(-Not (Test-path $developerLintPath)){
13+
Write-Host "Invalid Lint Rule Path. Unable to locate $developerLintPath" -ForegroundColor Red
14+
exit 1
15+
}
16+
17+
if(-Not (Test-path $strictLintPath)){
18+
Write-Host "Invalid Lint Rule Path. Unable to locate $strictLintPath" -ForegroundColor Red
19+
exit 1
20+
}
21+
22+
Write-Host "Enforcing Strict Linting (Stylecop)..."
23+
Remove-Item $developerLintPath
24+
Copy-Item $strictLintPath -Destination $developerLintPath
25+
26+
Write-Host "CI Build Configuration Complete" -ForegroundColor Green
27+
exit 0

‎build/deployment.yml

Copy file name to clipboardExpand all lines: build/deployment.yml
-132Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.