From 6d7d0aa07c39ec2059ace1f4cc6175d4ba5fb79b Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 4 Jan 2024 16:42:59 -0700 Subject: [PATCH] Removed old workflow files and added new ones. --- .github/workflows/build.yml | 26 +++++++++++++ .../ci-cd-project-card-validation.yml | 21 ---------- .../ci-cd-release-deploy-nuget-package.yml | 15 ------- .github/workflows/ci.yml | 14 +++++++ .github/workflows/project-ci.yml | 39 ------------------- .github/workflows/release-deploy.yml | 37 ++++++++++++++++++ 6 files changed, 77 insertions(+), 75 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/ci-cd-project-card-validation.yml delete mode 100644 .github/workflows/ci-cd-release-deploy-nuget-package.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/project-ci.yml create mode 100644 .github/workflows/release-deploy.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..073aee3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: Build +# TeqBench - CI Workflow - Manually initiate a CI workflow. + +on: + workflow_dispatch: + +jobs: + # This not the most optimal solution, however, as of 1/4/24, cannot limit the workflow_dispatch to a specific branch via the UI. + # Also, this is extra code to copy/paste into other repo workflow files. Revisit at a later time to improve. + validate-dispatch-inputs: + name: Validate Dispatch Inputs + runs-on: ubuntu-latest + steps: + - name: Validate Main Branch Selection + if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main' + run: | + echo "This workflow can only be initiated using the 'main' branch." + exit 1 + + build: + name: Build + needs: validate-dispatch-inputs + uses: teqbench/teqbench.devops.githhub.workflows/.github/workflows/build-with-concurrency.yml@main + secrets: inherit + with: + ci_type: 'build-manual' diff --git a/.github/workflows/ci-cd-project-card-validation.yml b/.github/workflows/ci-cd-project-card-validation.yml deleted file mode 100644 index 555b247..0000000 --- a/.github/workflows/ci-cd-project-card-validation.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Project Card Validation Workflow -# TeqBench - CI/CD - Project card validation for required (custom) settings/variables. -# Run the project's CI/CD to build/deploy NuGet package only when have merged PR to main branch. - -on: - pull_request: - # Handle the pull_request event triggers here, except 'closed' in order to always have the 'Mergable' and 'Release Type' evaluations up to date. - # See https://frontside.com/blog/2020-05-26-github-actions-pull_request/ for more details on the specific event triggers for a pull request. - # The 'closed' trigger is handled by the ci-cd.yml workflow. - types: [opened,edited,reopened,synchronize,converted_to_draft,ready_for_review] - branches: - - main - issues: - branches: - - main - -jobs: - common_project_card_validation: - name: Invoke Shared Project Card Validation - uses: teqbench/ci-cd-workflows/.github/workflows/shared-project-ci-cd-project-card-validation.yml@main - secrets: inherit diff --git a/.github/workflows/ci-cd-release-deploy-nuget-package.yml b/.github/workflows/ci-cd-release-deploy-nuget-package.yml deleted file mode 100644 index 259fdc2..0000000 --- a/.github/workflows/ci-cd-release-deploy-nuget-package.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Project Create/Deploy NuGet Package Workflow -# TeqBench - CI/CD - Create a NuGet package and (optionally) deploy to the organization's package registry on GitHub. -# Run the project's CI/CD to build/deploy NuGet package only when have merged PR to main branch. - -on: - pull_request: - types: [closed] - branches: - - main - -jobs: - common_project_card_validation: - name: Invoke Shared Project Create Release and Deploy NuGet Package Workflow - uses: teqbench/ci-cd-workflows/.github/workflows/shared-project-ci-cd-release-deploy-nuget-package.yml@main - secrets: inherit diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b24c860 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,14 @@ +name: CI +# TeqBench - CI Workflow - PR merge initiates a CI workflow. + +on: + pull_request: + types: [closed] + branches: + - main + +jobs: + ci: + name: CI + uses: teqbench/teqbench.devops.githhub.workflows/.github/workflows/build-with-concurrency.yml@main + secrets: inherit diff --git a/.github/workflows/project-ci.yml b/.github/workflows/project-ci.yml deleted file mode 100644 index f814a11..0000000 --- a/.github/workflows/project-ci.yml +++ /dev/null @@ -1,39 +0,0 @@ -# name: Project Create Release And Deploy NuGet Package -# # TeqBench - CI/CD - Create a release, aNuGet package and (optionally) deploy to the organization's package registry on GitHub. - -# on: -# pull_request: -# types: [closed] -# branches: [main] - -# jobs: -# common_project_card_validation: -# name: Invoke Shared Project Create Release and Deploy NuGet Package Workflow -# uses: teqbench/ci-cd-workflows/.github/workflows/shared-project-ci-cd-release-deploy-nuget-package.yml@main -# secrets: inherit -# with: -# project_number: 2 - -name: Project CI -# TeqBench - CI/CD - Create a NuGet package and (optionally) deploy to the organization's package registry on GitHub. -# Run the project's CI/CD to build/deploy NuGet package only when have merged PR to main branch. - -on: - workflow_dispatch: - # pull_request: - # types: [closed] - # branches: - # - main - -# jobs: -# common_project_card_validation: -# name: Invoke Shared Project Create Release and Deploy NuGet Package Workflow -# uses: teqbench/ci-cd-workflows/.github/workflows/shared-project-ci-cd-release-deploy-nuget-package.yml@main -# secrets: inherit -# with: -# project_source_folder: './' -jobs: - ci: - name: CI - uses: teqbench/ci-cd-workflows/.github/workflows/ci.yml@main - secrets: inherit diff --git a/.github/workflows/release-deploy.yml b/.github/workflows/release-deploy.yml new file mode 100644 index 0000000..a3a6cea --- /dev/null +++ b/.github/workflows/release-deploy.yml @@ -0,0 +1,37 @@ +name: Release & Deploy +# TeqBench - Release & Deploy Workflow - Manually initiate a release and deployment workflow. + +on: + workflow_dispatch: + inputs: + # This not the most optimal solution, however, as of 1/4/24, no (apparent) way to share common workflow display input. + # So, this is extra code to copy/paste into other repo workflow files. Revisit at a later time to improve; maybe use GitHub project + # boards/tickets to initiate a release/deployment, no clear option yet. + release_type: + type: choice + description: Release Type + options: + - MAJOR + - MINOR + - PATCH + +jobs: + # This not the most optimal solution, however, as of 1/4/24, cannot limit the workflow_dispatch to a specific branch via the UI. + # Also, this is extra code to copy/paste into other repo workflow files. Revisit at a later time to improve. + validate-dispatch-inputs: + name: Validate Dispatch Inputs + runs-on: ubuntu-latest + steps: + - name: Validate Main Branch Selection + if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main' + run: | + echo "This workflow can only be initiated using the 'main' branch." + exit 1 + + release_deploy: + name: Release & Deploy + needs: validate-dispatch-inputs + uses: teqbench/teqbench.devops.githhub.workflows/.github/workflows/release-deploy.yml@main + secrets: inherit + with: + release_type: ${{ github.event.inputs.release_type }}