-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start work for issue #239 * feat: create add proj workflow * ci: update workflow to reusable workflow * pr-changes: change workflow version from v8.2.0 to v9.1.0 * pr-changes: update token ref * pr-changes: update `echo` to `Write-Host` * pr-changes: update token ref and `echo` to `Write-Host` * ci: improve status checks * ci: improve sync system workflows * ci: improve release workflow * ci: create prepare release workflow * ci: update renovate config branch * ci: update token references --------- Co-authored-by: Calvin Wilkinson <[email protected]> Co-authored-by: Calvin Wilkinson <[email protected]>
- Loading branch information
1 parent
f49a1de
commit 3f69915
Showing
11 changed files
with
189 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: 🤖Add New Issue To Project | ||
|
||
|
||
on: | ||
issues: | ||
types: opened | ||
|
||
|
||
jobs: | ||
add_new_issue_to_project: | ||
name: Add New Issue | ||
uses: KinsonDigital/Infrastructure/.github/workflows/[email protected] | ||
with: | ||
org-name: "${{ vars.ORGANIZATION_NAME }}" | ||
org-project-name: "${{ vars.ORG_PROJECT_NAME }}" | ||
project-name: "${{ vars.PROJECT_NAME }}" | ||
secrets: | ||
cicd-pat: ${{ secrets.CICD_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: ✅Build Status Check | ||
run-name: ✅Build Status Check ${{ github.base_ref == 'main' && '(Release Build)' || '(Debug Build)' }} | ||
|
||
|
||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [main, preview] | ||
|
||
|
||
jobs: | ||
build_status_check: | ||
name: ${{ vars.PROJECT_NAME }} Build Status Check | ||
uses: KinsonDigital/Infrastructure/.github/workflows/[email protected] | ||
with: | ||
project-name: "${{ vars.PROJECT_NAME }}" | ||
build-config: Debug | ||
net-sdk-version: "${{ vars.NET_SDK_VERSION }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: 🚁Prepare Release | ||
|
||
|
||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-type: | ||
description: The type of release. Choose 'Preview' or 'Production'. | ||
required: true | ||
type: choice | ||
options: [Preview, Production] | ||
release-version: | ||
required: true | ||
description: The version of the release to prepare. | ||
type: string | ||
|
||
|
||
jobs: | ||
validate_inputs: | ||
name: Validate Inputs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Validating Inputs | ||
run: | | ||
$projectName = "${{ vars.PROJECT_NAME }}"; | ||
$releaseType = "${{ inputs.release-type }}".ToLower(); | ||
$releaseVersion = "${{ inputs.release-version }}"; | ||
if ($projectName -eq "") { | ||
Write-Host "::error::The project name input cannot be empty."; | ||
exit 1; | ||
} | ||
if ($releaseType -eq "") { | ||
Write-Host "::error::The release type input cannot be empty."; | ||
exit 1; | ||
} | ||
if ($releaseType -ne 'preview' -and $releaseType -ne 'roduction') { | ||
Write-Host "::error::The release type input must be either 'Preview' or 'Production'."; | ||
exit 1; | ||
} | ||
if ($releaseVersion -eq "") { | ||
Write-Host "::error::The release version input cannot be empty."; | ||
exit 1; | ||
} | ||
$prodVersionRegex = "v[0-9]+\.[0-9]+\.[0-9]+"; | ||
$prevVersionRegex = "v[0-9]+\.[0-9]+\.[0-9]+-preview\.[0-9]+"; | ||
# Verify that the version has valid syntax | ||
if (($version -match $prodVersionRegex) -or ($version -match $prevVersionRegex)) { | ||
Write-Host "::notice::The version is valid."; | ||
} else { | ||
$versionSyntax = $releaseType == "production" ? "v#.#.#" : "v#.#.#-preview.#"; | ||
Write-Host "::error::The version is not valid.\nThe version format is: '$versionSyntax"; | ||
exit 1; | ||
} | ||
prepare_release: | ||
name: Prepare ${{ inputs.release-type }} Release Of ${{ vars.PROJECT_NAME }} | ||
uses: KinsonDigital/Infrastructure/.github/workflows/[email protected] | ||
with: | ||
project-name: ${{ vars.PROJECT_NAME }} | ||
release-type: ${{ inputs.release-type }} | ||
release-version: ${{ inputs.release-version }} | ||
secrets: | ||
cicd-pat: ${{ secrets.CICD_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: 🚀Release | ||
run-name: ${{ vars.PROJECT_NAME }} ${{ inputs.release_type }} Release ${{ inputs.dry-run == true && '(Dry Run)' || '' }} | ||
run-name: ${{ vars.PROJECT_NAME }} ${{ inputs.release-type }} Release ${{ inputs.dry-run == true && '(Dry Run)' || '' }} | ||
|
||
|
||
defaults: | ||
|
@@ -10,13 +10,11 @@ defaults: | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_type: | ||
release-type: | ||
description: The type of release. Choose 'Preview' or 'Production'. | ||
required: true | ||
type: choice | ||
options: | ||
- Preview | ||
- Production | ||
options: [Preview, Production] | ||
dry-run: | ||
description: Check to run the workflow without creating a release. | ||
required: false | ||
|
@@ -25,44 +23,24 @@ on: | |
|
||
|
||
jobs: | ||
determine_build_config: | ||
name: Determine Build Configuration | ||
runs-on: ubuntu-latest | ||
outputs: | ||
build-config: "${{ steps.get-build-config.outputs.build-config }}" | ||
steps: | ||
- name: Get Build Config | ||
id: get-build-config | ||
run: | | ||
# If the branch that the workflow is running on is the required branch for the release, do a release build | ||
if ( "${{ github.base_ref }}" -eq "main") { | ||
"build-config=Release" >> $env:GITHUB_OUTPUT; | ||
echo "Release build created."; | ||
} else { # Any other branch than the release branch, do a debug build | ||
"build-config=Debug" >> $env:GITHUB_OUTPUT; | ||
echo "Debug build created."; | ||
} | ||
run_release: | ||
name: Performing ${{ inputs.release_type }} Release of ${{ vars.PROJECT_NAME }} ${{ inputs.dry-run == true && '(Dry Run)' || '' }} | ||
needs: determine_build_config | ||
uses: KinsonDigital/Infrastructure/.github/workflows/[email protected] | ||
name: Performing ${{ inputs.release-type }} Release of ${{ vars.PROJECT_NAME }} (${{ inputs.release-type == 'Production' && 'Release' || 'Debug' }}) | ||
uses: KinsonDigital/Infrastructure/.github/workflows/[email protected] | ||
with: | ||
project-name: "${{ vars.PROJECT_NAME}}" | ||
release-type: "${{ inputs.release_type }}" | ||
release-type: "${{ inputs.release-type }}" | ||
run-branch: "${{ github.ref_name }}" | ||
net-sdk-version: "${{ vars.NET_SDK_VERSION }}" | ||
relative-release-notes-dir-path: "${{ vars.RELATIVE_RELEASE_NOTES_DIR_PATH }}" | ||
release-notes-file-name-prefix: "${{ vars.RELEASE_NOTES_FILE_NAME_PREFIX }}" | ||
build-config: "${{ needs.determine_build_config.outputs.build-config }}" | ||
build-config: ${{ inputs.release-type == 'Production' && 'Release' || 'Debug' }} | ||
cicd-scripts-version: "${{ vars.CICD_SCRIPTS_VERSION }}" | ||
pr-include-notes-label: "${{ vars.PR_INCLUDE_NOTES_LABEL }}" | ||
send-release-tweet: ${{ vars.TWITTER_BROADCAST_ENABLED == 'true' }} | ||
dry-run: ${{ inputs.dry-run }} | ||
transpile-readme: true | ||
secrets: | ||
cicd-rest-api: "${{ secrets.CICD_REST_API }}" | ||
cicd-pat: "${{ secrets.CICD_TOKEN }}" | ||
nuget-org-api-key: "${{ secrets.NUGET_ORG_API_KEY }}" | ||
twitter-consumer-api-key: "${{ secrets.TWITTER_CONSUMER_API_KEY }}" | ||
twitter-consumer-api-secret: "${{ secrets.TWITTER_CONSUMER_API_SECRET }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.