Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧Add dotnet SDK checks to release workflows #202

Merged
merged 20 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5a554e1
ide: comment and improve launch config file
CalvinWilkinson Dec 17, 2023
aad0939
deps: import walk module and refactor
CalvinWilkinson Dec 17, 2023
3670203
chore: add util funcs for dotnet sdk versions
CalvinWilkinson Dec 18, 2023
0172178
refactor: improve csharp version service by using new util funcs
CalvinWilkinson Dec 18, 2023
ea5f516
ci: update all deno versions to use repo variable
CalvinWilkinson Dec 18, 2023
fc7ab43
ci,refactor: rearrange workflow inputs and input usage
CalvinWilkinson Dec 18, 2023
bb783ab
ci,refactor: change emoji of reusuable workflows
CalvinWilkinson Dec 18, 2023
c585b23
chore: create func to check if a csproj contains the target framework…
CalvinWilkinson Dec 18, 2023
f991561
feat: create ability to validate a dotnet projects sdk version setup
CalvinWilkinson Dec 18, 2023
dde0680
ide: add launch config for manual testing
CalvinWilkinson Dec 18, 2023
aad43d4
deps: update deno lock
CalvinWilkinson Dec 18, 2023
7e5142d
ci: add dotnet sdk setup validation to dotnet release workflows
CalvinWilkinson Dec 18, 2023
3405b42
refactor: clean and reformat code to project coding standards
CalvinWilkinson Dec 18, 2023
533bbb4
ci: update workflows to use preview branch
CalvinWilkinson Dec 18, 2023
d7578ba
chore: improve version regex
CalvinWilkinson Dec 18, 2023
796b1bd
ci: remove testing workflow
CalvinWilkinson Dec 18, 2023
6bd15e0
ci: improve version regex in workflow validation job
CalvinWilkinson Dec 18, 2023
6e3911f
ci: setup workflow version status check to only run for release branches
CalvinWilkinson Dec 18, 2023
1e96268
config: add task to deno config file
CalvinWilkinson Dec 18, 2023
1889f3d
force status checks
CalvinWilkinson Dec 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/add-item-to-project.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Add Issue To Project
name: ⚙️Add Issue To Project


defaults:
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Set Up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: ${{ vars.DENO_VERSION }}

- name: Add To Project
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/add-new-item-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
types: opened
pull_request:
types: opened
branches: main
branches: [main, preview]


jobs:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build-csharp-project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build C# Project
run-name: Build Project (${{ inputs.project-name }})
name: ⚙️Build C# Project
run-name: ⚙️Build Project (${{ inputs.project-name }})


defaults:
Expand Down Expand Up @@ -31,16 +31,16 @@ on:
description: The type of machine to run the job on.
type: string
default: ubuntu-latest
checkout-ref:
required: false
description: The git reference to checkout the code at.
type: string
default: ${{ github.ref }}
checkout-repository:
required: false
description: The git repository to checkout the code from.
type: string
default: ${{ github.repository }}
checkout-ref:
required: false
description: The git reference to checkout the code at.
type: string
default: ${{ github.ref }}
secrets:
cicd-pat:
description: "The GitHub Personal Access Token (PAT) used to authenticate to the GitHub API."
Expand Down Expand Up @@ -105,8 +105,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout-ref }}
repository: ${{ inputs.checkout-repository }}
ref: ${{ inputs.checkout-ref }}

- name: Setup .NET SDK ${{ inputs.net-sdk-version }}
uses: actions/setup-dotnet@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-status-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defaults:

on:
pull_request_target:
branches: main
branches: [main, preview]


jobs:
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/dotnet-action-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 🚀Perform DotNet Action Release
run-name: Perform ${{ inputs.release-type }} Release (${{ inputs.build-config }} Build)
name: ⚙️Perform DotNet Action Release
run-name: ⚙️Perform ${{ inputs.release-type }} Release (${{ inputs.build-config }} Build)


defaults:
Expand Down Expand Up @@ -177,6 +177,14 @@ jobs:
cicd-pat: "${{ secrets.cicd-pat }}"


validate_sdk_setup:
name: Validate SDK Setup
needs: print_validate_workflow
uses: KinsonDigital/Infrastructure/.github/workflows/[email protected]
with:
repo-name: "${{ inputs.project-name }}"


validate_release_notes_exist:
name: Validate Release Notes Exist
needs: validate_version
Expand Down Expand Up @@ -248,6 +256,7 @@ jobs:
validate_branch,
validate_version,
validate_tag,
validate_sdk_setup,
validate_release_notes_exist,
validate_github_release,
build_project,
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/dotnet-lib-release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 🚀Perform DotNet Lib Release
run-name: Perform ${{ inputs.release-type }} Release (${{ inputs.build-config }} Build)
name: ⚙️Perform DotNet Lib Release
run-name: ⚙️Perform ${{ inputs.release-type }} Release (${{ inputs.build-config }} Build)


defaults:
Expand Down Expand Up @@ -202,6 +202,14 @@ jobs:
cicd-pat: "${{ secrets.cicd-pat }}"


validate_sdk_setup:
name: Validate SDK Setup
needs: print_validate_workflow
uses: KinsonDigital/Infrastructure/.github/workflows/[email protected]
with:
repo-name: "${{ inputs.project-name }}"


nuget_pkg_does_not_exist:
name: Validate NuGet Package Does Not Exist
needs: validate_version
Expand Down Expand Up @@ -263,9 +271,15 @@ jobs:
name: Perform ${{ inputs.release-type }} Release
runs-on: ubuntu-latest
needs: [
validate_version, build_project, run_tests,
validate_branch, validate_tag, nuget_pkg_does_not_exist,
validate_milestone_status, validate_github_release]
validate_version,
build_project,
run_tests,
validate_branch,
validate_tag,
validate_sdk_setup,
nuget_pkg_does_not_exist,
validate_milestone_status,
validate_github_release]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand All @@ -281,7 +295,7 @@ jobs:
- name: Set Up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: ${{ vars.DENO_VERSION }}

- name: Create Script URL
id: script-url
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/initial-manual-sync.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 🔄️Sync PR To Issue
run-name: 🔄️Sync PR To Issue (${{ inputs.sync-type }})
name: ️Sync PR To Issue
run-name: ️Sync PR To Issue (${{ inputs.sync-type }})


defaults:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
if: ${{ steps.skip-checking.outputs.skip == 'false' }}
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: ${{ vars.DENO_VERSION }}

- name: Run Sync
if: ${{ steps.skip-checking.outputs.skip == 'false' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-status-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaults:

on:
pull_request:
branches: main
branches: [main, preview]


jobs:
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Set Up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: ${{ vars.DENO_VERSION }}

- name: Run Linting
run: deno lint
6 changes: 3 additions & 3 deletions .github/workflows/nuget-package-does-not-exist.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Check NuGet Package
run-name: Check NuGet Package (${{ inputs.version }})
name: ⚙️Check NuGet Package
run-name: ⚙️Check NuGet Package (${{ inputs.version }})


defaults:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Set Up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: ${{ vars.DENO_VERSION }}

- name: Package Does Not Exist
run: |
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/prepare-release-test.yml

This file was deleted.

24 changes: 10 additions & 14 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🚁Prepare Release
name: ⚙️Prepare Release


defaults:
Expand Down Expand Up @@ -57,19 +57,15 @@ jobs:
}


$releaseVersion = "${{ inputs.release-version }}".Trim().ToLower();
$releaseVersion = $releaseVersion.StartsWith("v") ? $releaseVersion : "v$releaseVersion";

if ($releaseType -eq "production") {
if ($releaseVersion -notmatch "v[0-9]+\.[0-9]+\.[0-9]+") {
Write-Host "::error::The production release version input is invalid. Expected version format: 'v#.#.#'";
exit 1;
}
$versionRegex = "^v([1-9]\d*|0)\.([1-9]\d*|0)\.([1-9]\d*|0)(-preview\.([1-9]\d*|0))?$";

# Verify that the version has valid syntax
if (($releaseVersion -match $versionRegex)) {
Write-Host "::notice::The 'release-version' workflow input is valid.";
} else {
if ($releaseVersion -notmatch "v[0-9]+\.[0-9]+\.[0-9]+-preview\.[0-9]+") {
Write-Host "::error::The preview release version input is invalid. Expected version format: 'v#.#.#-preview.#'";
exit 1;
}
$versionSyntax = $releaseType == "production" ? "v#.#.#" : "v#.#.#-preview.#";
Write-Host "::error::The 'release-version' workflow input is not valid. Expected format: '$versionSyntax";
exit 1;
}


Expand All @@ -84,7 +80,7 @@ jobs:
- name: Set Up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: ${{ vars.DENO_VERSION }}

- name: Generate Release Notes
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/resolve-csharp-proj-file.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Resolve CSharp Project File Path
name: ⚙️Resolve CSharp Project File Path


defaults:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/run-csharp-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Unit C# Tests
name: ⚙️Unit C# Tests


defaults:
Expand Down Expand Up @@ -30,16 +30,16 @@ on:
description: The type of machine to run the job on.
type: string
default: ubuntu-latest
checkout-ref:
required: false
description: The git reference to checkout the code at.
type: string
default: ${{ github.ref }}
checkout-repository:
required: false
description: The git repository to checkout the code from.
type: string
default: ${{ github.repository }}
checkout-ref:
required: false
description: The git reference to checkout the code at.
type: string
default: ${{ github.ref }}
secrets:
cicd-pat:
description: "The GitHub Personal Access Token (PAT) used to authenticate to the GitHub API."
Expand Down Expand Up @@ -107,8 +107,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.checkout-ref }}
repository: ${{ inputs.checkout-repository }}
ref: ${{ inputs.checkout-ref }}

- uses: actions/setup-dotnet@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set Up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
deno-version: ${{ vars.DENO_VERSION }}

- name: Run Sync Bot (Issue Change)
run: |
Expand Down
Loading
Loading