Skip to content

Commit

Permalink
Merge branch 'main' into topic/consolidateCLI
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHinsh authored Oct 9, 2024
2 parents 40d33eb + 9728790 commit f0a6c52
Show file tree
Hide file tree
Showing 135 changed files with 1,759 additions and 953 deletions.
2 changes: 0 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# These are supported funding model platforms

github: nkdAgility
patreon: nakedagility
custom: ['https://monzo.me/martinhinshelwood']
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ updates:
directory: "/src" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
4 changes: 2 additions & 2 deletions .github/workflows/MigrationToolsTelemetery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@latest
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
- name: Setup .NET Core (for inproc extensions)
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@latest
with:
dotnet-version: ${{ env.DOTNET_CORE_VERSION_INPROC }}
- name: Restore
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/close-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Azure Static Web App PR Cleanup

on:
pull_request:
types: [closed]

jobs:
pr_cleanup:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}
- name: Clean up pull request environment
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
action: 'close'
app_location: ''
skip_app_build: true
skip_api_build: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
42 changes: 21 additions & 21 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: "Pull Request Labeler"
on:
- pull_request_target
# name: "Pull Request Labeler"
# on:
# - pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}
- uses: actions/labeler@v5
with:
sync-labels: true
repo-token: ${{ steps.app-token.outputs.token }}
# jobs:
# labeler:
# permissions:
# contents: read
# pull-requests: write
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - uses: actions/create-github-app-token@v1
# id: app-token
# with:
# app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
# private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}
# - uses: actions/labeler@v5
# with:
# sync-labels: true
# repo-token: ${{ steps.app-token.outputs.token }}
106 changes: 90 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
push:
branches: ["main"]
tags-ignore: ["v*-*"]
pull_request:
pull_request_target:
types: [opened, synchronize, labeled]
branches: ["main"]
workflow_dispatch:
inputs:
Expand All @@ -31,6 +32,11 @@ jobs:
# Setup & Configuration
Setup:
name: "Setup & Configuration "
if: ${{ (github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'pull_request_target' &&
(github.event.pull_request.head.repo.full_name == github.repository || contains(github.event.pull_request.labels.*.name, 'safe-to-build')))
}}
runs-on: ubuntu-latest
outputs:
GitVersion_BranchName: ${{ steps.gitversion.outputs.GitVersion_BranchName }}
Expand All @@ -52,11 +58,24 @@ jobs:
nkdAgility_DocsBaseURL: ${{ steps.nkdagility.outputs.docs_baseURL }}
nkdAgility_DocsVersionFolder: ${{ steps.nkdagility.outputs.docs_version_folder }}
nkdAgility_RunRelease: ${{ steps.nkdagility.outputs.RunRelease }}

nkdAgility_AzureSitesEnvironment: ${{ steps.nkdagility.outputs.AzureSitesEnvironment }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}
- name: Remove "safe" label from PR
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
uses: actions-ecosystem/action-remove-labels@v1
with:
token: ${{ steps.app-token.outputs.token }}
labels: safe-to-build
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: ${{ github.event_name == 'push' && github.repository || github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event_name == 'push' && github.ref || github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
Expand All @@ -68,11 +87,7 @@ jobs:
uses: gittools/actions/gitversion/execute@v1.1.1
with:
useConfigFile: true
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}

- uses: dorny/paths-filter@v3
id: filter
with:
Expand All @@ -84,6 +99,7 @@ jobs:
automation:
- 'build/**'
- '.github/workflows/**'
- name: "Build NKDAgility Outputs"
shell: pwsh
id: nkdagility
Expand Down Expand Up @@ -116,20 +132,23 @@ jobs:
$WingetApplicationId = "nkdagility.azure-devops-migration-tools";
$docs_deploy_folder = "./azure-devops-migration-tools/"
$docs_baseURL = "/learn/azure-devops-migration-tools"
$AzureSitesEnvironment = ""
$RunRelease = 'true'
}
"Preview" {
$Ring = "Preview";
$WingetApplicationId = "nkdagility.azure-devops-migration-tools.Preview";
$docs_deploy_folder = "./azure-devops-migration-tools/preview/";
$docs_baseURL = "/learn/azure-devops-migration-tools/preview"
$AzureSitesEnvironment = "preview";
$RunRelease = ( ('${{ inputs.ForceRelease }}' -eq 'true' ) -or ('${{ steps.filter.outputs.src }}' -eq 'true') -or ('${{ steps.filter.outputs.docs }}' -eq 'true') )
}
default {
$Ring = "Canary";
$WingetApplicationId = "nkdagility.azure-devops-migration-tools.Canary";
$docs_deploy_folder = "./azure-devops-migration-tools/canary/$branchSafeName"
$docs_baseURL = "/learn/azure-devops-migration-tools/canary/$branchSafeName"
$AzureSitesEnvironment = "$branchSafeName"
$RunRelease = 'false'
}
}
Expand All @@ -141,6 +160,8 @@ jobs:
echo "docs_deploy_folder=$docs_deploy_folder" >> $env:GITHUB_OUTPUT
Write-Output "docs_baseURL=$docs_baseURL"
echo "docs_baseURL=$docs_baseURL" >> $env:GITHUB_OUTPUT
Write-Output "We are running for the $AzureSitesEnvironment AzureSitesEnvironment!"
echo "AzureSitesEnvironment=$AzureSitesEnvironment" >> $env:GITHUB_OUTPUT
Write-Output "RunRelease=$RunRelease"
echo "RunRelease=$RunRelease" >> $env:GITHUB_OUTPUT
Write-Output "-------------------------------------------"
Expand Down Expand Up @@ -201,6 +222,7 @@ jobs:
- nkdAgility_DocsVersionFolder: ${{needs.Setup.outputs.nkdAgility_DocsVersionFolder}}
- nkdAgility_DocsDeployFolder: ${{needs.Setup.outputs.nkdAgility_DocsDeployFolder}}
- nkdAgility_DocsBaseURL: ${{needs.Setup.outputs.nkdAgility_DocsBaseURL}}
- nkdAgility_AzureSitesEnvironment: ${{needs.Setup.outputs.nkdAgility_AzureSitesEnvironment}}
- nkdAgility_ReleaseDescriptionState: ${{needs.Setup.outputs.nkdAgility_ReleaseDescriptionState}}
- nkdAgility_RunRelease: ${{needs.Setup.outputs.nkdAgility_RunRelease}}
### GitVersion
Expand Down Expand Up @@ -249,19 +271,22 @@ jobs:
GitVersion_MajorMinorPatch: ${{ needs.Setup.outputs.GitVersion_MajorMinorPatch }}
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'zulu'
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: ${{ github.event_name == 'push' && github.repository || github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event_name == 'push' && github.ref || github.event.pull_request.head.ref }}
- uses: cschleiden/replace-tokens@v1
with:
files: '["**/StaticVariables.cs"]'
tokenPrefix: "${"
tokenSuffix: "}"
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.x
Expand Down Expand Up @@ -334,7 +359,10 @@ jobs:
GitVersion_AssemblySemVer: ${{ needs.Setup.outputs.GitVersion_AssemblySemVer }}
GitVersion_InformationalVersion: ${{ needs.Setup.outputs.GitVersion_InformationalVersion }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: ${{ github.event_name == 'push' && github.repository || github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event_name == 'push' && github.ref || github.event.pull_request.head.ref }}
- name: Setup Ruby
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
with:
Expand Down Expand Up @@ -365,6 +393,17 @@ jobs:
with:
name: AzureDevOpsMigrationTools-Site
path: ./_site/**/*
- name: Build with Jekyll 2
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --destination ./_site2/ --baseurl ""
env:
JEKYLL_ENV: production
# - name: Build Jekyll
# uses: jerryjvl/jekyll-build-action@v1
- uses: actions/upload-artifact@v4
with:
name: AzureDevOpsMigrationTools-Site2
path: ./_site2/**/*


# GitHubRelease
Expand Down Expand Up @@ -458,7 +497,7 @@ jobs:
if: ${{ success() && ( needs.Setup.outputs.nkdAgility_Ring == 'Release' ) }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: "Find files"
shell: pwsh
Expand Down Expand Up @@ -511,7 +550,7 @@ jobs:
if: ${{ success() && ( needs.Setup.outputs.nkdAgility_RunRelease == 'true' ) }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: "Find files"
shell: pwsh
Expand Down Expand Up @@ -541,7 +580,7 @@ jobs:
run: |
Get-Item -Path .\
- name: SFTP Upload ${{ (needs.Setup.outputs.nkdAgility_Ring) }}
uses: Dylan700/sftp-upload-action@v1.1.4
uses: Dylan700/sftp-upload-action@latest
with:
server: nakedalmweb.sftp.wpengine.com
username: nakedalmweb-learn
Expand All @@ -553,4 +592,39 @@ jobs:
uploads: |
./_site/ => ${{needs.Setup.outputs.nkdAgility_DocsDeployFolder}}
# If true, any existing files in the remote upload directories are deleted.
delete: false
delete: false

- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.NKDAGILITY_BOT_APP_ID }}
private-key: ${{ secrets.NKDAGILITY_BOT_CLIENTSECRET }}

- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: AzureDevOpsMigrationTools-Site2
path: ./_site2
- name: Build and Deploy
uses: Azure/static-web-apps-deploy@v1
id: azureDeploy
with:
repo_token: ${{ steps.app-token.outputs.token }}
action: 'upload'
app_location: ./_site2
skip_app_build: true
skip_api_build: true
output_location: ''
deployment_environment: ${{ (needs.Setup.outputs.nkdAgility_AzureSitesEnvironment) }}
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}

- name: 'Show Summery'
if: always()
shell: pwsh
id: nkdagility-summery
run: |
$markdown = @"
## ${{needs.Setup.outputs.GitVersion_SemVer}} (${{needs.Setup.outputs.nkdAgility_Ring}})
Docs deployed to [${{steps.azureDeploy.outputs.static_web_app_url}}](${{steps.azureDeploy.outputs.static_web_app_url}})
"@
echo $markdown >> $Env:GITHUB_STEP_SUMMARY
2 changes: 1 addition & 1 deletion .github/workflows/open-pr-describer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: Ant0wan/openai-pr@v1
with:
api-key: ${{ secrets.OPENAI_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/opencommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: '16'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: di-sukharev/opencommit@github-action-v1.0.4
Expand Down
Loading

0 comments on commit f0a6c52

Please sign in to comment.