From 5569ad506eb3ae91dd15650e082503783d886129 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 19 Jul 2024 11:12:22 +0200 Subject: [PATCH 01/50] Initial testing done --- .github/workflows/tag-deployment.yml | 109 +++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 .github/workflows/tag-deployment.yml diff --git a/.github/workflows/tag-deployment.yml b/.github/workflows/tag-deployment.yml new file mode 100644 index 000000000..66e1be200 --- /dev/null +++ b/.github/workflows/tag-deployment.yml @@ -0,0 +1,109 @@ +name: Tag Deployment +on: + workflow_call: + secrets: + TAG_VERSION_TOKEN: + required: false + description: > + An authentication token, like a personal access token (PAT) that gives access to the other repository. + This is necessary because the repository that triggered the workflow and the repository that the workflow is + running on can be different. (For example: in cases of a swap). + inputs: + repo_url: + default: ${{ github.repository }} + required: false + type: string + description: > + The URL of the repository to tag. This is necessary because the repository that triggered the workflow and the + repository that the workflow is running on can be different. (For example: in cases of a swap). + is_swap: + required: false + default: false + type: boolean + description: > + Whether this is a swap operation. This will add a tag with {prefix}/latest to the commit that is currently + tagged with the {swap_prefix}/latest tag. This is useful for deployment scenarios where you want to keep + track of the latest deployment and the history of deployments. + prefix: + required: true + type: string + description: > + Prefix for the tags (e.g., staging or production). This will be used to create tags like + `staging/latest` and `staging/2021-01-01-12.34UTC`. + swap_prefix: + required: false + type: string + description: > + Prefix for looking up the swap tags (e.g., staging). This will be used to look up tags like `staging/latest` + to determine the latest commit that was deployed to add a new tag to alongside, like 'production/latest'. + +jobs: + run: + name: Set GitHub Action/Workflow to Version Tag + runs-on: ubuntu-latest + defaults: + run: + shell: pwsh + steps: + - name: Checkout Repository + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + with: + repository: ${{ inputs.repo_url }} + token: ${{ secrets.TAG_VERSION_TOKEN }} + + - name: Setup Git Config + run: | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "github-actions[bot]" + + - name: Fetch tags + id: fetch-tags + run: | + git fetch --tags + + - name: Determine timestamp + id: determine-timestamp + run: | + # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags + "timestamp=$(Get-Date -Format 'yyyy-MM-dd-HH.mmUTC')" >> $Env:GITHUB_OUTPUT + + - name: Delete Old prefix/latest tag + run: | + $latestTag = (git tag -l "${{ inputs.prefix }}/latest") + if ($latestTag) + { + git tag -d "${{ inputs.prefix }}/latest" + git push origin ":refs/tags/${{ inputs.prefix }}/latest" + } + + - name: Move Latest Tag (Swap) and Add Timestamp Tag + if: inputs.is_swap == true + run: | + if([string]::IsNullOrEmpty("${{ inputs.swap_prefix }}")) + { + throw "Swap prefix not set, exiting" + } + + $tagExists = (git tag -l "${{ inputs.swap_prefix }}/latest") + if ([string]::IsNullOrEmpty($tagExists)){ + throw "No latest tag found for swap prefix" + } + + $latest = (git rev-list -n 1 "${{ inputs.swap_prefix }}/latest") + if ($latest) + { + git tag -a "${{ inputs.prefix }}/latest" $latest -m "Latest tag for ${{ inputs.prefix }}" + git push origin tag "${{ inputs.prefix }}/latest" + git tag -a "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" $latest -m "Swap tagged at ${{steps.determine-timestamp.outputs.timestamp}}" + git push origin tag "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" + } else { + throw "No latest tag found for swap prefix" + } + + - name: Tag Latest and add Timestamp Tag + if: inputs.is_swap == false + run: | + git tag "${{ inputs.prefix }}/latest" + git push origin tag "${{ inputs.prefix }}/latest" + git tag "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" + git push origin tag "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" \ No newline at end of file From 0af19fdac30e8486bf70efeeb1b785fefb599e2c Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 19 Jul 2024 11:37:53 +0200 Subject: [PATCH 02/50] YAML linting fixes --- .github/workflows/tag-deployment.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tag-deployment.yml b/.github/workflows/tag-deployment.yml index 66e1be200..bc36b6c61 100644 --- a/.github/workflows/tag-deployment.yml +++ b/.github/workflows/tag-deployment.yml @@ -21,8 +21,8 @@ on: default: false type: boolean description: > - Whether this is a swap operation. This will add a tag with {prefix}/latest to the commit that is currently - tagged with the {swap_prefix}/latest tag. This is useful for deployment scenarios where you want to keep + Whether this is a swap operation. This will add a tag with {prefix}/latest to the commit that is currently + tagged with the {swap_prefix}/latest tag. This is useful for deployment scenarios where you want to keep track of the latest deployment and the history of deployments. prefix: required: true @@ -70,7 +70,7 @@ jobs: - name: Delete Old prefix/latest tag run: | $latestTag = (git tag -l "${{ inputs.prefix }}/latest") - if ($latestTag) + if ($latestTag) { git tag -d "${{ inputs.prefix }}/latest" git push origin ":refs/tags/${{ inputs.prefix }}/latest" @@ -79,22 +79,23 @@ jobs: - name: Move Latest Tag (Swap) and Add Timestamp Tag if: inputs.is_swap == true run: | - if([string]::IsNullOrEmpty("${{ inputs.swap_prefix }}")) + if([string]::IsNullOrEmpty("${{ inputs.swap_prefix }}")) { throw "Swap prefix not set, exiting" } - + $tagExists = (git tag -l "${{ inputs.swap_prefix }}/latest") if ([string]::IsNullOrEmpty($tagExists)){ throw "No latest tag found for swap prefix" } - + $latest = (git rev-list -n 1 "${{ inputs.swap_prefix }}/latest") - if ($latest) + if ($latest) { git tag -a "${{ inputs.prefix }}/latest" $latest -m "Latest tag for ${{ inputs.prefix }}" git push origin tag "${{ inputs.prefix }}/latest" - git tag -a "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" $latest -m "Swap tagged at ${{steps.determine-timestamp.outputs.timestamp}}" + $gitMessage = "Swap tagged at ${{steps.determine-timestamp.outputs.timestamp}}" + git tag -a "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" $latest -m $gitMessage git push origin tag "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" } else { throw "No latest tag found for swap prefix" @@ -106,4 +107,4 @@ jobs: git tag "${{ inputs.prefix }}/latest" git push origin tag "${{ inputs.prefix }}/latest" git tag "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" - git push origin tag "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" \ No newline at end of file + git push origin tag "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" From b33546f488e7b218ba24b2a38d58153a052853e4 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 19 Jul 2024 16:45:43 +0200 Subject: [PATCH 03/50] Passthrough options in release action --- .github/actions/release-action/action.yml | 10 ++++++++++ .github/workflows/tag-deployment.yml | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/actions/release-action/action.yml b/.github/actions/release-action/action.yml index 8a15da682..168b0c164 100644 --- a/.github/actions/release-action/action.yml +++ b/.github/actions/release-action/action.yml @@ -25,6 +25,14 @@ inputs: description: An optional tag for the release. If this is omitted the git ref will be used (if it is a tag). required: false default: '' + repo: + description: "Optionally specify the repo where the release should be generated. Defaults to current repo" + required: false + default: '' + token: + description: 'The GitHub token.' + required: false + default: ${{ github.token }} outputs: id: @@ -49,3 +57,5 @@ runs: artifacts: ${{ inputs.artifacts }} generateReleaseNotes: ${{ inputs.generateReleaseNotes }} tag: ${{ inputs.tag }} + repo: ${{ inputs.repo }} + token: ${{ inputs.token }} diff --git a/.github/workflows/tag-deployment.yml b/.github/workflows/tag-deployment.yml index bc36b6c61..5f0564648 100644 --- a/.github/workflows/tag-deployment.yml +++ b/.github/workflows/tag-deployment.yml @@ -3,6 +3,7 @@ on: workflow_call: secrets: TAG_VERSION_TOKEN: + default: ${{ github.token }} required: false description: > An authentication token, like a personal access token (PAT) that gives access to the other repository. @@ -101,6 +102,17 @@ jobs: throw "No latest tag found for swap prefix" } + - name: Create Release + uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 + if: inputs.is_swap == true + with: + repo: ${{ inputs.repo_url }} + token: ${{ secrets.TAG_VERSION_TOKEN }} + tag: ${{ inputs.prefix }}/latest + allowUpdates: true + generateReleaseNotes: true + artifacts: artifacts/*.nupkg, artifacts/*.snupkg + - name: Tag Latest and add Timestamp Tag if: inputs.is_swap == false run: | From cfd8cec55bc54fb83cb8d350a3a648b49e435857 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 19 Jul 2024 16:54:13 +0200 Subject: [PATCH 04/50] Update tag-deployment.yml --- .github/workflows/tag-deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-deployment.yml b/.github/workflows/tag-deployment.yml index 5f0564648..e007a2508 100644 --- a/.github/workflows/tag-deployment.yml +++ b/.github/workflows/tag-deployment.yml @@ -103,7 +103,7 @@ jobs: } - name: Create Release - uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/release-action@dev if: inputs.is_swap == true with: repo: ${{ inputs.repo_url }} From c151bc103b7d22a2057f239ed533492464d43350 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 19 Jul 2024 17:02:04 +0200 Subject: [PATCH 05/50] expected ref --- .github/actions/publish-nuget/action.yml | 2 +- .github/workflows/tag-deployment.yml | 2 +- .github/workflows/tag-version.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index bcaa677b0..18be0fec6 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -221,7 +221,7 @@ runs: retention-days: ${{ inputs.nuget-artifact-retention-days }} - name: Create Release - uses: Lombiq/GitHub-Actions/.github/actions/release-action@dev + uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 # This is to prevent creating releases when pushing tags for issue-specific pre-releases like # v4.3.1-alpha.osoe-86. if: "!contains(steps.setup.outputs.publish-version, '-')" diff --git a/.github/workflows/tag-deployment.yml b/.github/workflows/tag-deployment.yml index e007a2508..5f0564648 100644 --- a/.github/workflows/tag-deployment.yml +++ b/.github/workflows/tag-deployment.yml @@ -103,7 +103,7 @@ jobs: } - name: Create Release - uses: Lombiq/GitHub-Actions/.github/actions/release-action@dev + uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 if: inputs.is_swap == true with: repo: ${{ inputs.repo_url }} diff --git a/.github/workflows/tag-version.yml b/.github/workflows/tag-version.yml index a90ab9852..a280576ab 100644 --- a/.github/workflows/tag-version.yml +++ b/.github/workflows/tag-version.yml @@ -106,7 +106,7 @@ jobs: run: git push --tags --force - name: Create Release - uses: Lombiq/GitHub-Actions/.github/actions/release-action@dev + uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 # This is to prevent creating releases when pushing tags for issue-specific pre-releases like # v4.3.1-alpha.osoe-86. if: "!contains(steps.determine-tag.outputs.tagname, '-')" From 2dddc76a33470afc862a5003c4de63c127aa32cb Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 19 Jul 2024 17:09:20 +0200 Subject: [PATCH 06/50] refs and linting fixes --- .github/actions/release-action/action.yml | 4 ++-- .github/workflows/publish-nuget.yml | 2 +- .github/workflows/tag-version-this-repo.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/release-action/action.yml b/.github/actions/release-action/action.yml index 168b0c164..92a1a0812 100644 --- a/.github/actions/release-action/action.yml +++ b/.github/actions/release-action/action.yml @@ -26,11 +26,11 @@ inputs: required: false default: '' repo: - description: "Optionally specify the repo where the release should be generated. Defaults to current repo" + description: Optionally specify the repo where the release should be generated. Defaults to current repo. required: false default: '' token: - description: 'The GitHub token.' + description: The GitHub token. required: false default: ${{ github.token }} diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index a4f59dfdc..2ff2514c3 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -75,7 +75,7 @@ jobs: dotnet-version: ${{ inputs.dotnet-version }} - name: Publish to NuGet - uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@dev + uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@issue/OSOE-861 with: source: ${{ inputs.source }} verbosity: ${{ inputs.verbosity }} diff --git a/.github/workflows/tag-version-this-repo.yml b/.github/workflows/tag-version-this-repo.yml index 2105aea5d..ca21b79ff 100644 --- a/.github/workflows/tag-version-this-repo.yml +++ b/.github/workflows/tag-version-this-repo.yml @@ -9,7 +9,7 @@ jobs: run: name: Tag Version Automation if: github.event.pusher.name != 'LombiqBot' - uses: Lombiq/GitHub-Actions/.github/workflows/tag-version.yml@dev + uses: Lombiq/GitHub-Actions/.github/workflows/tag-version.yml@issue/OSOE-861 with: additional-pattern-include-list: '@("https://raw.githubusercontent.com/Lombiq/GitHub-Actions/(?[\w\./-]*)/.github")' secrets: From 8f081ce2dbb275accc222cf97db7fa5ba50a25ce Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Mon, 22 Jul 2024 12:42:03 +0200 Subject: [PATCH 07/50] Add directly to existing workflows --- .../workflows/deploy-to-azure-app-service.yml | 34 +++++ .../workflows/swap-azure-web-app-slots.yml | 98 ++++++++++++++ .github/workflows/tag-deployment.yml | 122 ------------------ 3 files changed, 132 insertions(+), 122 deletions(-) delete mode 100644 .github/workflows/tag-deployment.yml diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 2c674fba3..52bc09ac9 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -132,6 +132,13 @@ on: description: > Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation. If ready to run is set to `true` the `runtime` input is needed. + tag-prefix: + type: string + required: false + default: ${{ inputs.slot-name }} + description: > + The prefix to use for the tag. If not set, the slot name will be used as the prefix. The tag will be in the + format of "/latest" and "/". jobs: deploy: @@ -247,6 +254,33 @@ jobs: -WebAppName ${{ inputs.app-name }} ` -SlotName ${{ inputs.slot-name }} + - name: Fetch tags + id: fetch-tags + run: | + git fetch --tags + + - name: Determine timestamp + id: determine-timestamp + run: | + # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags + "timestamp=$(Get-Date -Format 'yyyy-MM-dd-HH.mmUTC')" >> $Env:GITHUB_OUTPUT + + - name: Delete Old prefix/latest tag + run: | + $latestTag = (git tag -l '${{ inputs.tag-prefix }}/latest') + if ($latestTag) + { + git tag -d '${{ inputs.tag-prefix }}/latest' + git push origin ":refs/tags/${{ inputs.tag-prefix }}/latest" + } + + - name: Tag Latest and add Timestamp Tag + run: | + git tag '${{ inputs.tag-prefix }}/latest' + git push origin tag '${{ inputs.tag-prefix }}/latest' + git tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' + git push origin tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' + - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' uses: Lombiq/GitHub-Actions/.github/actions/cancel-workflow@dev diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index aa0901531..491a4922d 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -29,6 +29,13 @@ on: The ID of the Azure Subscription the resources are under, which will be mapped to the subscription-id parameter when calling azure/login. You can look this up e.g. in the Azure Portal under any resource or the subscription itself. + TAG_DEPLOYMENT_TOKEN: + default: ${{ github.token }} + required: false + description: > + An authentication token, like a personal access token (PAT) that gives access to the other repository. + This is necessary because the repository that triggered the workflow and the repository that the workflow + is running on are different in this case. inputs: cancel-workflow-on-failure: @@ -69,6 +76,26 @@ on: description: > ID of the Application Insights resource that the release annotation for the swap should be added to. This can e.g. be looked up on the Azure Portal under the given AI resource's Overview page -> JSON View. + swap-code-repo: + type: string + default: '' + required: false + description: > + The repository that hosts the code that will be swapped. This is necessary for adding tags. + tag-prefix: + type: string + default: ${{ inputs.destination-slot-name }} + required: false + description: > + The prefix for the tags that will be added to the swap-code-repo. If not set, the slot name will be used as + the prefix. The tag will be in the format of "/latest" and "/". + swap-prefix: + type: string + default: ${{ inputs.source-slot-name }} + required: false + description: > + The prefix of the deployment tag that we will be looking for in the swap-code-repo. If not set, the source + slot name will be used as the prefix. jobs: swap-azure-web-app-slots: @@ -118,6 +145,77 @@ jobs: -WebAppName ${{ inputs.app-name }} ` -SlotName ${{ inputs.destination-slot-name }} + - name: Checkout Repository + if: inputs.swap-code-repo != '' + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + with: + repository: ${{ inputs.swap-code-repo }} + token: ${{ secrets.TAG_DEPLOYMENT_TOKEN }} + + - name: Setup Git Config + if: inputs.swap-code-repo != '' + run: | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "github-actions[bot]" + + - name: Fetch tags + if: inputs.swap-code-repo != '' + run: | + git fetch --tags + + - name: Determine timestamp + if: inputs.swap-code-repo != '' + id: determine-timestamp + run: | + # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags + "timestamp=$(Get-Date -Format 'yyyy-MM-dd-HH.mmUTC')" >> $Env:GITHUB_OUTPUT + + - name: Delete Old prefix/latest tag + if: inputs.swap-code-repo != '' + run: | + $latestTag = (git tag -l '${{ inputs.tag-prefix }}/latest') + if ($latestTag) + { + git tag -d '${{ inputs.tag-prefix }}/latest' + git push origin ":refs/tags/${{ inputs.tag-prefix }}/latest" + } + + - name: Move Latest Tag (Swap) and Add Timestamp Tag + if: inputs.swap-code-repo != '' + run: | + if([string]::IsNullOrEmpty("${{ inputs.tag-prefix }}")) + { + throw "Tag prefix not set, exiting" + } + + $tagExists = (git tag -l "${{ inputs.swap-prefix }}/latest") + if ([string]::IsNullOrEmpty($tagExists)){ + throw "No latest tag found for swap prefix" + } + + $latest = (git rev-list -n 1 "${{ inputs.swap-prefix }}/latest") + if ($latest) + { + git tag -a "${{ inputs.tag-prefix }}/latest" $latest -m "Latest tag for ${{ inputs.tag-prefix }}" + git push origin tag "${{ inputs.tag-prefix }}/latest" + $gitMessage = "Swap tagged at ${{steps.determine-timestamp.outputs.timestamp}}" + git tag -a "${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" $latest -m $gitMessage + git push origin tag "${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" + } else { + throw "No latest tag found for swap prefix" + } + + - name: Create Release + uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 + if: inputs.swap-code-repo != '' + with: + repo: ${{ inputs.swap-code-repo }} + token: ${{ secrets.TAG_DEPLOYMENT_TOKEN }} + tag: ${{ inputs.tag-prefix }}/latest + allowUpdates: true + generateReleaseNotes: true + artifacts: artifacts/*.nupkg, artifacts/*.snupkg + - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' uses: Lombiq/GitHub-Actions/.github/actions/cancel-workflow@dev diff --git a/.github/workflows/tag-deployment.yml b/.github/workflows/tag-deployment.yml deleted file mode 100644 index 5f0564648..000000000 --- a/.github/workflows/tag-deployment.yml +++ /dev/null @@ -1,122 +0,0 @@ -name: Tag Deployment -on: - workflow_call: - secrets: - TAG_VERSION_TOKEN: - default: ${{ github.token }} - required: false - description: > - An authentication token, like a personal access token (PAT) that gives access to the other repository. - This is necessary because the repository that triggered the workflow and the repository that the workflow is - running on can be different. (For example: in cases of a swap). - inputs: - repo_url: - default: ${{ github.repository }} - required: false - type: string - description: > - The URL of the repository to tag. This is necessary because the repository that triggered the workflow and the - repository that the workflow is running on can be different. (For example: in cases of a swap). - is_swap: - required: false - default: false - type: boolean - description: > - Whether this is a swap operation. This will add a tag with {prefix}/latest to the commit that is currently - tagged with the {swap_prefix}/latest tag. This is useful for deployment scenarios where you want to keep - track of the latest deployment and the history of deployments. - prefix: - required: true - type: string - description: > - Prefix for the tags (e.g., staging or production). This will be used to create tags like - `staging/latest` and `staging/2021-01-01-12.34UTC`. - swap_prefix: - required: false - type: string - description: > - Prefix for looking up the swap tags (e.g., staging). This will be used to look up tags like `staging/latest` - to determine the latest commit that was deployed to add a new tag to alongside, like 'production/latest'. - -jobs: - run: - name: Set GitHub Action/Workflow to Version Tag - runs-on: ubuntu-latest - defaults: - run: - shell: pwsh - steps: - - name: Checkout Repository - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev - with: - repository: ${{ inputs.repo_url }} - token: ${{ secrets.TAG_VERSION_TOKEN }} - - - name: Setup Git Config - run: | - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config user.name "github-actions[bot]" - - - name: Fetch tags - id: fetch-tags - run: | - git fetch --tags - - - name: Determine timestamp - id: determine-timestamp - run: | - # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags - "timestamp=$(Get-Date -Format 'yyyy-MM-dd-HH.mmUTC')" >> $Env:GITHUB_OUTPUT - - - name: Delete Old prefix/latest tag - run: | - $latestTag = (git tag -l "${{ inputs.prefix }}/latest") - if ($latestTag) - { - git tag -d "${{ inputs.prefix }}/latest" - git push origin ":refs/tags/${{ inputs.prefix }}/latest" - } - - - name: Move Latest Tag (Swap) and Add Timestamp Tag - if: inputs.is_swap == true - run: | - if([string]::IsNullOrEmpty("${{ inputs.swap_prefix }}")) - { - throw "Swap prefix not set, exiting" - } - - $tagExists = (git tag -l "${{ inputs.swap_prefix }}/latest") - if ([string]::IsNullOrEmpty($tagExists)){ - throw "No latest tag found for swap prefix" - } - - $latest = (git rev-list -n 1 "${{ inputs.swap_prefix }}/latest") - if ($latest) - { - git tag -a "${{ inputs.prefix }}/latest" $latest -m "Latest tag for ${{ inputs.prefix }}" - git push origin tag "${{ inputs.prefix }}/latest" - $gitMessage = "Swap tagged at ${{steps.determine-timestamp.outputs.timestamp}}" - git tag -a "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" $latest -m $gitMessage - git push origin tag "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" - } else { - throw "No latest tag found for swap prefix" - } - - - name: Create Release - uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 - if: inputs.is_swap == true - with: - repo: ${{ inputs.repo_url }} - token: ${{ secrets.TAG_VERSION_TOKEN }} - tag: ${{ inputs.prefix }}/latest - allowUpdates: true - generateReleaseNotes: true - artifacts: artifacts/*.nupkg, artifacts/*.snupkg - - - name: Tag Latest and add Timestamp Tag - if: inputs.is_swap == false - run: | - git tag "${{ inputs.prefix }}/latest" - git push origin tag "${{ inputs.prefix }}/latest" - git tag "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" - git push origin tag "${{ inputs.prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" From b37b0c4844530ec3c5c560fe3c75531ce6d6cf8c Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Mon, 22 Jul 2024 12:45:46 +0200 Subject: [PATCH 08/50] YAML linting --- .../workflows/swap-azure-web-app-slots.yml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 491a4922d..e51845460 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -30,12 +30,12 @@ on: parameter when calling azure/login. You can look this up e.g. in the Azure Portal under any resource or the subscription itself. TAG_DEPLOYMENT_TOKEN: - default: ${{ github.token }} - required: false - description: > - An authentication token, like a personal access token (PAT) that gives access to the other repository. - This is necessary because the repository that triggered the workflow and the repository that the workflow - is running on are different in this case. + default: ${{ github.token }} + required: false + description: > + An authentication token, like a personal access token (PAT) that gives access to the other repository. + This is necessary because the repository that triggered the workflow and the repository that the workflow is + running on are different in this case. inputs: cancel-workflow-on-failure: @@ -149,8 +149,8 @@ jobs: if: inputs.swap-code-repo != '' uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: - repository: ${{ inputs.swap-code-repo }} - token: ${{ secrets.TAG_DEPLOYMENT_TOKEN }} + repository: ${{ inputs.swap-code-repo }} + token: ${{ secrets.TAG_DEPLOYMENT_TOKEN }} - name: Setup Git Config if: inputs.swap-code-repo != '' @@ -209,12 +209,12 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 if: inputs.swap-code-repo != '' with: - repo: ${{ inputs.swap-code-repo }} - token: ${{ secrets.TAG_DEPLOYMENT_TOKEN }} - tag: ${{ inputs.tag-prefix }}/latest - allowUpdates: true - generateReleaseNotes: true - artifacts: artifacts/*.nupkg, artifacts/*.snupkg + repo: ${{ inputs.swap-code-repo }} + token: ${{ secrets.TAG_DEPLOYMENT_TOKEN }} + tag: ${{ inputs.tag-prefix }}/latest + allowUpdates: true + generateReleaseNotes: true + artifacts: artifacts/*.nupkg, artifacts/*.snupkg - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' From 1819a9e4333583270845d3a7f1abbb87e642bcc9 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Mon, 22 Jul 2024 12:55:11 +0200 Subject: [PATCH 09/50] Formatting --- .../workflows/deploy-to-azure-app-service.yml | 10 +++--- .../workflows/swap-azure-web-app-slots.yml | 33 ++++++++++--------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 52bc09ac9..f57c23c63 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -271,15 +271,15 @@ jobs: if ($latestTag) { git tag -d '${{ inputs.tag-prefix }}/latest' - git push origin ":refs/tags/${{ inputs.tag-prefix }}/latest" + git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' } - name: Tag Latest and add Timestamp Tag run: | - git tag '${{ inputs.tag-prefix }}/latest' - git push origin tag '${{ inputs.tag-prefix }}/latest' - git tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' - git push origin tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' + git tag '${{ inputs.tag-prefix }}/latest' + git push origin tag '${{ inputs.tag-prefix }}/latest' + git tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' + git push origin tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index e51845460..fb40bb2ec 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -155,8 +155,8 @@ jobs: - name: Setup Git Config if: inputs.swap-code-repo != '' run: | - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config user.name "github-actions[bot]" + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git config user.name 'github-actions[bot]' - name: Fetch tags if: inputs.swap-code-repo != '' @@ -177,31 +177,34 @@ jobs: if ($latestTag) { git tag -d '${{ inputs.tag-prefix }}/latest' - git push origin ":refs/tags/${{ inputs.tag-prefix }}/latest" + git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' } - name: Move Latest Tag (Swap) and Add Timestamp Tag if: inputs.swap-code-repo != '' run: | - if([string]::IsNullOrEmpty("${{ inputs.tag-prefix }}")) + if([string]::IsNullOrEmpty('${{ inputs.tag-prefix }}')) { - throw "Tag prefix not set, exiting" + throw 'Tag prefix not set, exiting' } - $tagExists = (git tag -l "${{ inputs.swap-prefix }}/latest") - if ([string]::IsNullOrEmpty($tagExists)){ - throw "No latest tag found for swap prefix" + $tagExists = (git tag -l '${{ inputs.swap-prefix }}/latest') + if ([string]::IsNullOrEmpty($tagExists)) + { + throw 'No latest tag found for swap prefix' } - $latest = (git rev-list -n 1 "${{ inputs.swap-prefix }}/latest") + $latest = (git rev-list -n 1 '${{ inputs.swap-prefix }}/latest') if ($latest) { - git tag -a "${{ inputs.tag-prefix }}/latest" $latest -m "Latest tag for ${{ inputs.tag-prefix }}" - git push origin tag "${{ inputs.tag-prefix }}/latest" - $gitMessage = "Swap tagged at ${{steps.determine-timestamp.outputs.timestamp}}" - git tag -a "${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" $latest -m $gitMessage - git push origin tag "${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}" - } else { + git tag -a '${{ inputs.tag-prefix }}/latest' $latest -m 'Latest tag for ${{ inputs.tag-prefix }}' + git push origin tag '${{ inputs.tag-prefix }}/latest' + $gitMessage = 'Swap tagged at ${{steps.determine-timestamp.outputs.timestamp}}' + git tag -a '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' $latest -m $gitMessage + git push origin tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' + } + else + { throw "No latest tag found for swap prefix" } From b3ef953f5c7ae4a6589f50d5da38ce4aa8c9d0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 23 Jul 2024 03:25:30 +0200 Subject: [PATCH 10/50] Formatting --- .github/workflows/deploy-to-azure-app-service.yml | 6 +++--- .github/workflows/swap-azure-web-app-slots.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index f57c23c63..0cc91dd3d 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -265,13 +265,13 @@ jobs: # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags "timestamp=$(Get-Date -Format 'yyyy-MM-dd-HH.mmUTC')" >> $Env:GITHUB_OUTPUT - - name: Delete Old prefix/latest tag + - name: Delete Old prefix/latest Tag run: | $latestTag = (git tag -l '${{ inputs.tag-prefix }}/latest') if ($latestTag) { - git tag -d '${{ inputs.tag-prefix }}/latest' - git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' + git tag -d '${{ inputs.tag-prefix }}/latest' + git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' } - name: Tag Latest and add Timestamp Tag diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index fb40bb2ec..6e813c9b5 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -176,8 +176,8 @@ jobs: $latestTag = (git tag -l '${{ inputs.tag-prefix }}/latest') if ($latestTag) { - git tag -d '${{ inputs.tag-prefix }}/latest' - git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' + git tag -d '${{ inputs.tag-prefix }}/latest' + git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' } - name: Move Latest Tag (Swap) and Add Timestamp Tag From 31efd2cf9f627d3c81dff4a409d11acd22f40e75 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 24 Jul 2024 17:56:40 +0200 Subject: [PATCH 11/50] Review changes --- .github/actions/create-timestamp/action.yml | 16 ++++++ .github/actions/remove-old-tags/action.yml | 23 ++++++++ .../workflows/deploy-to-azure-app-service.yml | 32 ++++------- .../workflows/swap-azure-web-app-slots.yml | 57 +++++++------------ .../AzureHosting/DeployToAzureAppService.md | 2 + .../AzureHosting/SwapAzureWebAppSlots.md | 8 +++ 6 files changed, 81 insertions(+), 57 deletions(-) create mode 100644 .github/actions/create-timestamp/action.yml create mode 100644 .github/actions/remove-old-tags/action.yml diff --git a/.github/actions/create-timestamp/action.yml b/.github/actions/create-timestamp/action.yml new file mode 100644 index 000000000..3b9b7be5a --- /dev/null +++ b/.github/actions/create-timestamp/action.yml @@ -0,0 +1,16 @@ +name: create-timestamp +author: qwerty +description: Create a timestamp in ISO 8601 format for use in tags (replaces ":" with "." for use in git tags). +runs: + using: composite + steps: + - name: Get timestamp + shell: pwsh + run: | + # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags + $timestamp = (Get-Date -Format 'yyyy-MM-ddTHH.mm.ssZ' -AsUTC) -replace ':', '.' + +outputs: + timestamp: + description: The generated timestamp + value: ${{ steps.get-timestamp.outputs.timestamp }} diff --git a/.github/actions/remove-old-tags/action.yml b/.github/actions/remove-old-tags/action.yml new file mode 100644 index 000000000..f06c4ecdd --- /dev/null +++ b/.github/actions/remove-old-tags/action.yml @@ -0,0 +1,23 @@ +name: remove-old-tags +description: > + Removes the old prefix/latest tag so that a new one can be set. + +inputs: + tag-prefix: + description: > + The prefix for the tag we are removing + required: true + +runs: + using: composite + steps: + - name: Delete latest tag + shell: pwsh + run: | + git fetch --tags + $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') + if ($latestTag) + { + git tag --delete '${{ inputs.tag-prefix }}/latest' + git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' + } diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index f57c23c63..628e14cff 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -138,7 +138,8 @@ on: default: ${{ inputs.slot-name }} description: > The prefix to use for the tag. If not set, the slot name will be used as the prefix. The tag will be in the - format of "/latest" and "/". + format of "/latest" and "/". This is used for tracking what's deployed, where and + when by tagging the deployed commit. jobs: deploy: @@ -254,32 +255,21 @@ jobs: -WebAppName ${{ inputs.app-name }} ` -SlotName ${{ inputs.slot-name }} - - name: Fetch tags - id: fetch-tags - run: | - git fetch --tags - - - name: Determine timestamp - id: determine-timestamp - run: | - # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags - "timestamp=$(Get-Date -Format 'yyyy-MM-dd-HH.mmUTC')" >> $Env:GITHUB_OUTPUT + - name: Remove old tags + uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 + with: + tag-prefix: '${{ inputs.tag-prefix }}' - - name: Delete Old prefix/latest tag - run: | - $latestTag = (git tag -l '${{ inputs.tag-prefix }}/latest') - if ($latestTag) - { - git tag -d '${{ inputs.tag-prefix }}/latest' - git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' - } + - name: Create timestamp + id: create-timestamp + uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - name: Tag Latest and add Timestamp Tag run: | git tag '${{ inputs.tag-prefix }}/latest' git push origin tag '${{ inputs.tag-prefix }}/latest' - git tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' - git push origin tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' + git tag '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}' + git push origin tag '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}' - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index fb40bb2ec..39eae3740 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -29,7 +29,7 @@ on: The ID of the Azure Subscription the resources are under, which will be mapped to the subscription-id parameter when calling azure/login. You can look this up e.g. in the Azure Portal under any resource or the subscription itself. - TAG_DEPLOYMENT_TOKEN: + CODE_REPOSITORY_WRITE_TOKEN: default: ${{ github.token }} required: false description: > @@ -88,14 +88,16 @@ on: required: false description: > The prefix for the tags that will be added to the swap-code-repo. If not set, the slot name will be used as - the prefix. The tag will be in the format of "/latest" and "/". + the prefix. The tag will be in the format of "/latest" and "/". This is used for + tracking what's deployed, where and when by tagging the deployed commit. swap-prefix: type: string default: ${{ inputs.source-slot-name }} required: false description: > The prefix of the deployment tag that we will be looking for in the swap-code-repo. If not set, the source - slot name will be used as the prefix. + slot name will be used as the prefix. This is used to find the currently deployed commit by its tag in the + swap-code-repo. jobs: swap-azure-web-app-slots: @@ -145,40 +147,24 @@ jobs: -WebAppName ${{ inputs.app-name }} ` -SlotName ${{ inputs.destination-slot-name }} - - name: Checkout Repository + - name: Checkout Code Repository and Setup Git Config if: inputs.swap-code-repo != '' + run: | + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git config user.name 'github-actions[bot]' uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: repository: ${{ inputs.swap-code-repo }} - token: ${{ secrets.TAG_DEPLOYMENT_TOKEN }} - - - name: Setup Git Config - if: inputs.swap-code-repo != '' - run: | - git config user.email '41898282+github-actions[bot]@users.noreply.github.com' - git config user.name 'github-actions[bot]' - - - name: Fetch tags - if: inputs.swap-code-repo != '' - run: | - git fetch --tags + token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} - - name: Determine timestamp - if: inputs.swap-code-repo != '' - id: determine-timestamp - run: | - # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags - "timestamp=$(Get-Date -Format 'yyyy-MM-dd-HH.mmUTC')" >> $Env:GITHUB_OUTPUT + - name: Remove old tags + uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 + with: + tag-prefix: '${{ inputs.tag-prefix }}' - - name: Delete Old prefix/latest tag - if: inputs.swap-code-repo != '' - run: | - $latestTag = (git tag -l '${{ inputs.tag-prefix }}/latest') - if ($latestTag) - { - git tag -d '${{ inputs.tag-prefix }}/latest' - git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' - } + - name: Create timestamp + id: create-timestamp + uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - name: Move Latest Tag (Swap) and Add Timestamp Tag if: inputs.swap-code-repo != '' @@ -188,7 +174,7 @@ jobs: throw 'Tag prefix not set, exiting' } - $tagExists = (git tag -l '${{ inputs.swap-prefix }}/latest') + $tagExists = (git tag --list '${{ inputs.swap-prefix }}/latest') if ([string]::IsNullOrEmpty($tagExists)) { throw 'No latest tag found for swap prefix' @@ -197,10 +183,10 @@ jobs: $latest = (git rev-list -n 1 '${{ inputs.swap-prefix }}/latest') if ($latest) { - git tag -a '${{ inputs.tag-prefix }}/latest' $latest -m 'Latest tag for ${{ inputs.tag-prefix }}' + git tag --annotate '${{ inputs.tag-prefix }}/latest' $latest --message 'Latest tag for ${{ inputs.tag-prefix }}' git push origin tag '${{ inputs.tag-prefix }}/latest' $gitMessage = 'Swap tagged at ${{steps.determine-timestamp.outputs.timestamp}}' - git tag -a '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' $latest -m $gitMessage + git tag --annotate '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' $latest --message $gitMessage git push origin tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' } else @@ -213,11 +199,10 @@ jobs: if: inputs.swap-code-repo != '' with: repo: ${{ inputs.swap-code-repo }} - token: ${{ secrets.TAG_DEPLOYMENT_TOKEN }} + token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} tag: ${{ inputs.tag-prefix }}/latest allowUpdates: true generateReleaseNotes: true - artifacts: artifacts/*.nupkg, artifacts/*.snupkg - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' diff --git a/Docs/Workflows/AzureHosting/DeployToAzureAppService.md b/Docs/Workflows/AzureHosting/DeployToAzureAppService.md index 4f160dadc..4472a5a17 100644 --- a/Docs/Workflows/AzureHosting/DeployToAzureAppService.md +++ b/Docs/Workflows/AzureHosting/DeployToAzureAppService.md @@ -23,6 +23,8 @@ jobs: self-contained: true ready-to-run: true application-insights-resource-id: "Azure resource ID of the corresponding AI resource" + # Defaults to slot-name if not set, used for adding git tags to the deployed commit. + tag-prefix: staging secrets: AZURE_APP_SERVICE_DEPLOYMENT_SERVICE_PRINCIPAL_ID: ${{ secrets.AZURE_APP_SERVICE_DEPLOYMENT_SERVICE_PRINCIPAL_ID }} AZURE_APP_SERVICE_DEPLOYMENT_AZURE_TENANT_ID: ${{ secrets.AZURE_APP_SERVICE_DEPLOYMENT_AZURE_TENANT_ID }} diff --git a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md index 238e00bee..a9941e4b4 100644 --- a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md +++ b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md @@ -20,10 +20,18 @@ jobs: source-slot-name: Staging destination-slot-name: Production application-insights-resource-id: "Azure resource ID of the corresponding AI resource" + # Defaults to destination-slot-name if not set, used for adding git tags to the deployed commit. + tag-prefix: production + # Defaults to source-slot-name if not set, used looking up the currently deployed commit by tag. + swap-prefix: staging + # The repository that hosts the code that will be swapped. This is necessary for adding tags and releases. + swap-code-repo: Lombiq/Lombiq-GitHub-Actions secrets: AZURE_APP_SERVICE_SWAP_SERVICE_PRINCIPAL_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_SERVICE_PRINCIPAL_ID }} AZURE_APP_SERVICE_SWAP_AZURE_TENANT_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_AZURE_TENANT_ID }} AZURE_APP_SERVICE_SWAP_AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_AZURE_SUBSCRIPTION_ID }} + # Needs to have access to create tags and releases in the target repository. + CODE_REPOSITORY_WRITE_TOKEN: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} ``` To restrict who can edit or run the Swap workflow, we recommend putting into a separate repository independent of your application code. If you're [on the Enterprise plan, you can add required reviewers](https://github.com/orgs/community/discussions/26262) instead, so that not everyone is able to run a swap who has write access to the repository. From 50a5f9a76e70a5b0ab66073fa3c3958a2bb5cf06 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 24 Jul 2024 18:12:34 +0200 Subject: [PATCH 12/50] YAML linting --- .github/actions/create-timestamp/action.yml | 20 ++++++------ .github/actions/remove-old-tags/action.yml | 31 +++++++++---------- .../workflows/deploy-to-azure-app-service.yml | 3 +- .../workflows/swap-azure-web-app-slots.yml | 3 +- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/.github/actions/create-timestamp/action.yml b/.github/actions/create-timestamp/action.yml index 3b9b7be5a..5744b4852 100644 --- a/.github/actions/create-timestamp/action.yml +++ b/.github/actions/create-timestamp/action.yml @@ -2,15 +2,15 @@ author: qwerty description: Create a timestamp in ISO 8601 format for use in tags (replaces ":" with "." for use in git tags). runs: - using: composite - steps: - - name: Get timestamp - shell: pwsh - run: | - # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags - $timestamp = (Get-Date -Format 'yyyy-MM-ddTHH.mm.ssZ' -AsUTC) -replace ':', '.' + using: composite + steps: + - name: Get timestamp + shell: pwsh + run: | + # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags + $timestamp = (Get-Date -Format 'yyyy-MM-ddTHH.mm.ssZ' -AsUTC) -replace ':', '.' outputs: - timestamp: - description: The generated timestamp - value: ${{ steps.get-timestamp.outputs.timestamp }} + timestamp: + description: The generated timestamp + value: ${{ steps.get-timestamp.outputs.timestamp }} diff --git a/.github/actions/remove-old-tags/action.yml b/.github/actions/remove-old-tags/action.yml index f06c4ecdd..e2332f4db 100644 --- a/.github/actions/remove-old-tags/action.yml +++ b/.github/actions/remove-old-tags/action.yml @@ -3,21 +3,20 @@ description: > Removes the old prefix/latest tag so that a new one can be set. inputs: - tag-prefix: - description: > - The prefix for the tag we are removing - required: true + tag-prefix: + description: The prefix for the tag we are removing + required: true runs: - using: composite - steps: - - name: Delete latest tag - shell: pwsh - run: | - git fetch --tags - $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') - if ($latestTag) - { - git tag --delete '${{ inputs.tag-prefix }}/latest' - git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' - } + using: composite + steps: + - name: Delete latest tag + shell: pwsh + run: | + git fetch --tags + $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') + if ($latestTag) + { + git tag --delete '${{ inputs.tag-prefix }}/latest' + git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' + } diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 68fa3e891..2bbac5716 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -258,11 +258,12 @@ jobs: - name: Remove old tags uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 with: - tag-prefix: '${{ inputs.tag-prefix }}' + tag-prefix: ${{ inputs.tag-prefix }} - name: Create timestamp id: create-timestamp uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 + - name: Determine timestamp id: determine-timestamp run: | diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 4f2c5cb77..82749b5af 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -160,11 +160,12 @@ jobs: - name: Remove old tags uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 with: - tag-prefix: '${{ inputs.tag-prefix }}' + tag-prefix: ${{ inputs.tag-prefix }} - name: Create timestamp id: create-timestamp uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 + - name: Fetch tags if: inputs.swap-code-repo != '' run: | From 6773d176438eab766b454693b5a00430818d95ca Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 24 Jul 2024 18:18:11 +0200 Subject: [PATCH 13/50] rename to app-code-repo --- .../workflows/swap-azure-web-app-slots.yml | 35 ++++++++++--------- .../AzureHosting/SwapAzureWebAppSlots.md | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 82749b5af..6cc863ec5 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -76,7 +76,7 @@ on: description: > ID of the Application Insights resource that the release annotation for the swap should be added to. This can e.g. be looked up on the Azure Portal under the given AI resource's Overview page -> JSON View. - swap-code-repo: + app-code-repo: type: string default: '' required: false @@ -87,7 +87,7 @@ on: default: ${{ inputs.destination-slot-name }} required: false description: > - The prefix for the tags that will be added to the swap-code-repo. If not set, the slot name will be used as + The prefix for the tags that will be added to the app-code-repo. If not set, the slot name will be used as the prefix. The tag will be in the format of "/latest" and "/". This is used for tracking what's deployed, where and when by tagging the deployed commit. swap-prefix: @@ -95,9 +95,9 @@ on: default: ${{ inputs.source-slot-name }} required: false description: > - The prefix of the deployment tag that we will be looking for in the swap-code-repo. If not set, the source + The prefix of the deployment tag that we will be looking for in the app-code-repo. If not set, the source slot name will be used as the prefix. This is used to find the currently deployed commit by its tag in the - swap-code-repo. + app-code-repo. jobs: swap-azure-web-app-slots: @@ -147,16 +147,19 @@ jobs: -WebAppName ${{ inputs.app-name }} ` -SlotName ${{ inputs.destination-slot-name }} - - name: Checkout Code Repository and Setup Git Config - if: inputs.swap-code-repo != '' - run: | - git config user.email '41898282+github-actions[bot]@users.noreply.github.com' - git config user.name 'github-actions[bot]' + - name: Checkout Code Repository + if: inputs.app-code-repo != '' uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: - repository: ${{ inputs.swap-code-repo }} + repository: ${{ inputs.app-code-repo }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} + - name: Setup Git Config + if: inputs.app-code-repo != '' + run: | + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git config user.name 'github-actions[bot]' + - name: Remove old tags uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 with: @@ -167,19 +170,19 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - name: Fetch tags - if: inputs.swap-code-repo != '' + if: inputs.app-code-repo != '' run: | git fetch --tags - name: Determine timestamp - if: inputs.swap-code-repo != '' + if: inputs.app-code-repo != '' id: determine-timestamp run: | # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags "timestamp=$(Get-Date -Format 'yyyy-MM-dd-HH.mmUTC')" >> $Env:GITHUB_OUTPUT - name: Delete Old prefix/latest tag - if: inputs.swap-code-repo != '' + if: inputs.app-code-repo != '' run: | $latestTag = (git tag -l '${{ inputs.tag-prefix }}/latest') if ($latestTag) @@ -189,7 +192,7 @@ jobs: } - name: Move Latest Tag (Swap) and Add Timestamp Tag - if: inputs.swap-code-repo != '' + if: inputs.app-code-repo != '' run: | if([string]::IsNullOrEmpty('${{ inputs.tag-prefix }}')) { @@ -218,9 +221,9 @@ jobs: - name: Create Release uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 - if: inputs.swap-code-repo != '' + if: inputs.app-code-repo != '' with: - repo: ${{ inputs.swap-code-repo }} + repo: ${{ inputs.app-code-repo }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} tag: ${{ inputs.tag-prefix }}/latest allowUpdates: true diff --git a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md index a9941e4b4..e8875e468 100644 --- a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md +++ b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md @@ -25,7 +25,7 @@ jobs: # Defaults to source-slot-name if not set, used looking up the currently deployed commit by tag. swap-prefix: staging # The repository that hosts the code that will be swapped. This is necessary for adding tags and releases. - swap-code-repo: Lombiq/Lombiq-GitHub-Actions + app-code-repo: Lombiq/Lombiq-GitHub-Actions secrets: AZURE_APP_SERVICE_SWAP_SERVICE_PRINCIPAL_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_SERVICE_PRINCIPAL_ID }} AZURE_APP_SERVICE_SWAP_AZURE_TENANT_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_AZURE_TENANT_ID }} From abc8de4517c482576df7467d462a252945572649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 24 Jul 2024 19:02:07 +0200 Subject: [PATCH 14/50] More long git CLI switches --- .github/workflows/deploy-to-azure-app-service.yml | 2 +- .github/workflows/swap-azure-web-app-slots.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 2bbac5716..bf1b9f78f 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -272,7 +272,7 @@ jobs: - name: Delete Old prefix/latest Tag run: | - $latestTag = (git tag -l '${{ inputs.tag-prefix }}/latest') + $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') if ($latestTag) { git tag -d '${{ inputs.tag-prefix }}/latest' diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 6cc863ec5..12c6d0545 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -184,7 +184,7 @@ jobs: - name: Delete Old prefix/latest tag if: inputs.app-code-repo != '' run: | - $latestTag = (git tag -l '${{ inputs.tag-prefix }}/latest') + $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') if ($latestTag) { git tag -d '${{ inputs.tag-prefix }}/latest' From 144cff309e4c280f4b67a64f96c3624e23476b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 24 Jul 2024 19:14:59 +0200 Subject: [PATCH 15/50] Formatting --- .github/actions/remove-old-tags/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/remove-old-tags/action.yml b/.github/actions/remove-old-tags/action.yml index e2332f4db..9c8ee55bb 100644 --- a/.github/actions/remove-old-tags/action.yml +++ b/.github/actions/remove-old-tags/action.yml @@ -17,6 +17,6 @@ runs: $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') if ($latestTag) { - git tag --delete '${{ inputs.tag-prefix }}/latest' - git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' + git tag --delete '${{ inputs.tag-prefix }}/latest' + git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' } From 771611d508b2e6b1f443ecbcae67bd307057452e Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Mon, 5 Aug 2024 10:47:57 +0200 Subject: [PATCH 16/50] Add optional ref --- .github/workflows/swap-azure-web-app-slots.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 6cc863ec5..dfc2c5b8f 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -82,6 +82,12 @@ on: required: false description: > The repository that hosts the code that will be swapped. This is necessary for adding tags. + ref: + type: string + required: false + description: > + The branch, tag or SHA to checkout. When checking out the repository that triggered a workflow, this defaults + to the reference or SHA for that event. Otherwise, uses the default branch. tag-prefix: type: string default: ${{ inputs.destination-slot-name }} @@ -152,6 +158,7 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: repository: ${{ inputs.app-code-repo }} + ref: ${{ inputs.ref }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} - name: Setup Git Config From eb8b6293ade9c4c14ac8baaa8d154acf8cf4cf89 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Mon, 5 Aug 2024 10:51:50 +0200 Subject: [PATCH 17/50] Actions versions --- .github/workflows/build-and-test-dotnet.yml | 2 +- .github/workflows/build-and-test-orchard-core.yml | 2 +- .github/workflows/msbuild-and-test.yml | 2 +- .github/workflows/validate-pull-request.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test-dotnet.yml b/.github/workflows/build-and-test-dotnet.yml index afd688e1b..e471bc0fb 100644 --- a/.github/workflows/build-and-test-dotnet.yml +++ b/.github/workflows/build-and-test-dotnet.yml @@ -246,7 +246,7 @@ jobs: - name: Tests if: inputs.test-disable == 'false' - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-861 with: blame-hang-timeout: ${{ inputs.blame-hang-timeout }} build-directory: ${{ inputs.build-directory }} diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index ba38b10f3..1e7b8329c 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -300,7 +300,7 @@ jobs: - name: Tests if: inputs.test-disable == 'false' - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-861 with: blame-hang-timeout: ${{ inputs.blame-hang-timeout }} build-directory: ${{ inputs.build-directory }} diff --git a/.github/workflows/msbuild-and-test.yml b/.github/workflows/msbuild-and-test.yml index 01c2fdabb..05be8ea01 100644 --- a/.github/workflows/msbuild-and-test.yml +++ b/.github/workflows/msbuild-and-test.yml @@ -138,7 +138,7 @@ jobs: - name: Tests if: inputs.test-disable == 'false' - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-861 with: build-directory: ${{ inputs.build-directory }} dotnet-test-process-timeout: ${{ inputs.dotnet-test-process-timeout }} diff --git a/.github/workflows/validate-pull-request.yml b/.github/workflows/validate-pull-request.yml index d892b20cb..b8137e81e 100644 --- a/.github/workflows/validate-pull-request.yml +++ b/.github/workflows/validate-pull-request.yml @@ -28,6 +28,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check for Merge Conflict in PR - uses: Lombiq/GitHub-Actions/.github/actions/check-merge-conflict@dev + uses: Lombiq/GitHub-Actions/.github/actions/check-merge-conflict@issue/OSOE-861 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ab5c0f3b7be421885eeb39c0e6493afa0a023ac5 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 7 Aug 2024 11:10:59 +0200 Subject: [PATCH 18/50] Fix review points --- .github/actions/create-timestamp/action.yml | 7 +++---- .github/actions/remove-old-tags/action.yml | 4 ++-- .github/workflows/swap-azure-web-app-slots.yml | 6 ------ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/actions/create-timestamp/action.yml b/.github/actions/create-timestamp/action.yml index 5744b4852..37a9c3789 100644 --- a/.github/actions/create-timestamp/action.yml +++ b/.github/actions/create-timestamp/action.yml @@ -1,13 +1,12 @@ -name: create-timestamp -author: qwerty +name: Create Timestamp description: Create a timestamp in ISO 8601 format for use in tags (replaces ":" with "." for use in git tags). runs: using: composite steps: - - name: Get timestamp + - name: Get Timestamp shell: pwsh run: | - # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags + # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags. $timestamp = (Get-Date -Format 'yyyy-MM-ddTHH.mm.ssZ' -AsUTC) -replace ':', '.' outputs: diff --git a/.github/actions/remove-old-tags/action.yml b/.github/actions/remove-old-tags/action.yml index 9c8ee55bb..a21574cea 100644 --- a/.github/actions/remove-old-tags/action.yml +++ b/.github/actions/remove-old-tags/action.yml @@ -1,4 +1,4 @@ -name: remove-old-tags +name: Remove Old Tags description: > Removes the old prefix/latest tag so that a new one can be set. @@ -10,7 +10,7 @@ inputs: runs: using: composite steps: - - name: Delete latest tag + - name: Delete Latest Tag shell: pwsh run: | git fetch --tags diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 85adc991b..641aeb6a4 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -176,13 +176,7 @@ jobs: id: create-timestamp uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - - name: Fetch tags - if: inputs.app-code-repo != '' - run: | - git fetch --tags - - name: Determine timestamp - if: inputs.app-code-repo != '' id: determine-timestamp run: | # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags From 6a2ff6176785d4548e70ccf2b49d07f92fdf6ce6 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 7 Aug 2024 11:56:49 +0200 Subject: [PATCH 19/50] Update deploy-to-azure-app-service.yml --- .github/workflows/deploy-to-azure-app-service.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index bf1b9f78f..0c25391ba 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -134,10 +134,10 @@ on: If ready to run is set to `true` the `runtime` input is needed. tag-prefix: type: string + default: 'staging' required: false - default: ${{ inputs.slot-name }} description: > - The prefix to use for the tag. If not set, the slot name will be used as the prefix. The tag will be in the + The prefix to use for the tag. If not set, 'staging' will be used as the prefix. The tag will be in the format of "/latest" and "/". This is used for tracking what's deployed, where and when by tagging the deployed commit. From 530fb9c40faea2af99e4d2fc23ea8abfbbfa90bc Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 7 Aug 2024 12:30:20 +0200 Subject: [PATCH 20/50] Change defaults to staging --- .github/workflows/deploy-to-azure-app-service.yml | 4 ++-- .github/workflows/swap-azure-web-app-slots.yml | 11 +++++------ .../Workflows/AzureHosting/DeployToAzureAppService.md | 2 +- Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 0c25391ba..de6a11091 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -282,9 +282,9 @@ jobs: - name: Tag Latest and add Timestamp Tag run: | git tag '${{ inputs.tag-prefix }}/latest' - git push origin tag '${{ inputs.tag-prefix }}/latest' + git push origin 'refs/tags/${{ inputs.tag-prefix }}/latest' git tag '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}' - git push origin tag '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}' + git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}/latest' - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 641aeb6a4..086e81ad9 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -98,12 +98,11 @@ on: tracking what's deployed, where and when by tagging the deployed commit. swap-prefix: type: string - default: ${{ inputs.source-slot-name }} + default: 'staging' required: false description: > - The prefix of the deployment tag that we will be looking for in the app-code-repo. If not set, the source - slot name will be used as the prefix. This is used to find the currently deployed commit by its tag in the - app-code-repo. + The prefix of the deployment tag that we will be looking for in the app-code-repo. If not set, 'staging' will + be used as the prefix. This is used to find the currently deployed commit by its tag in the app-code-repo. jobs: swap-azure-web-app-slots: @@ -210,10 +209,10 @@ jobs: if ($latest) { git tag --annotate '${{ inputs.tag-prefix }}/latest' $latest --message 'Latest tag for ${{ inputs.tag-prefix }}' - git push origin tag '${{ inputs.tag-prefix }}/latest' + git push origin 'refs/tags/${{ inputs.tag-prefix }}/latest' $gitMessage = 'Swap tagged at ${{steps.determine-timestamp.outputs.timestamp}}' git tag --annotate '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' $latest --message $gitMessage - git push origin tag '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' + git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' } else { diff --git a/Docs/Workflows/AzureHosting/DeployToAzureAppService.md b/Docs/Workflows/AzureHosting/DeployToAzureAppService.md index 4472a5a17..453ad4ef6 100644 --- a/Docs/Workflows/AzureHosting/DeployToAzureAppService.md +++ b/Docs/Workflows/AzureHosting/DeployToAzureAppService.md @@ -23,7 +23,7 @@ jobs: self-contained: true ready-to-run: true application-insights-resource-id: "Azure resource ID of the corresponding AI resource" - # Defaults to slot-name if not set, used for adding git tags to the deployed commit. + # Defaults to 'staging' if not set, used for adding git tags to the deployed commit. tag-prefix: staging secrets: AZURE_APP_SERVICE_DEPLOYMENT_SERVICE_PRINCIPAL_ID: ${{ secrets.AZURE_APP_SERVICE_DEPLOYMENT_SERVICE_PRINCIPAL_ID }} diff --git a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md index e8875e468..f6d0c92a4 100644 --- a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md +++ b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md @@ -22,7 +22,7 @@ jobs: application-insights-resource-id: "Azure resource ID of the corresponding AI resource" # Defaults to destination-slot-name if not set, used for adding git tags to the deployed commit. tag-prefix: production - # Defaults to source-slot-name if not set, used looking up the currently deployed commit by tag. + # Defaults to 'staging' if not set, used looking up the currently deployed commit by tag. swap-prefix: staging # The repository that hosts the code that will be swapped. This is necessary for adding tags and releases. app-code-repo: Lombiq/Lombiq-GitHub-Actions From b671f73cdca3b050b0c7d6376ee57842219a0e97 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 7 Aug 2024 13:26:33 +0200 Subject: [PATCH 21/50] timestamp output --- .github/actions/create-timestamp/action.yml | 2 ++ .github/workflows/deploy-to-azure-app-service.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/create-timestamp/action.yml b/.github/actions/create-timestamp/action.yml index 37a9c3789..617874957 100644 --- a/.github/actions/create-timestamp/action.yml +++ b/.github/actions/create-timestamp/action.yml @@ -4,10 +4,12 @@ runs: using: composite steps: - name: Get Timestamp + id: get-timestamp shell: pwsh run: | # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags. $timestamp = (Get-Date -Format 'yyyy-MM-ddTHH.mm.ssZ' -AsUTC) -replace ':', '.' + $timestamp >> $env:GITHUB_OUTPUT outputs: timestamp: diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index de6a11091..fa309f597 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -284,7 +284,7 @@ jobs: git tag '${{ inputs.tag-prefix }}/latest' git push origin 'refs/tags/${{ inputs.tag-prefix }}/latest' git tag '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}' - git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}/latest' + git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}' - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' From 0cdb7a4d07e9e62fb142ef381fc734e155c1aaf7 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 7 Aug 2024 13:53:34 +0200 Subject: [PATCH 22/50] Timestamp fixes --- .github/actions/create-timestamp/action.yml | 4 ++-- .github/workflows/deploy-to-azure-app-service.yml | 6 ------ .github/workflows/swap-azure-web-app-slots.yml | 12 +++--------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/actions/create-timestamp/action.yml b/.github/actions/create-timestamp/action.yml index 617874957..49b9a2c7b 100644 --- a/.github/actions/create-timestamp/action.yml +++ b/.github/actions/create-timestamp/action.yml @@ -8,8 +8,8 @@ runs: shell: pwsh run: | # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags. - $timestamp = (Get-Date -Format 'yyyy-MM-ddTHH.mm.ssZ' -AsUTC) -replace ':', '.' - $timestamp >> $env:GITHUB_OUTPUT + $timestamp = ((Get-Date).ToUniversalTime().GetDateTimeFormats('s')[0]) -replace ':', '.' + echo "timestamp=$timestamp" >> $env:GITHUB_OUTPUT outputs: timestamp: diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index fa309f597..25166553d 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -264,12 +264,6 @@ jobs: id: create-timestamp uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - - name: Determine timestamp - id: determine-timestamp - run: | - # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags - "timestamp=$(Get-Date -Format 'yyyy-MM-dd-HH.mmUTC')" >> $Env:GITHUB_OUTPUT - - name: Delete Old prefix/latest Tag run: | $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 086e81ad9..f137ca5d6 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -175,12 +175,6 @@ jobs: id: create-timestamp uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - - name: Determine timestamp - id: determine-timestamp - run: | - # Get the current timestamp in the format of yyyy-MM-dd-HH.mmUTC - can't use : in tags - "timestamp=$(Get-Date -Format 'yyyy-MM-dd-HH.mmUTC')" >> $Env:GITHUB_OUTPUT - - name: Delete Old prefix/latest tag if: inputs.app-code-repo != '' run: | @@ -210,9 +204,9 @@ jobs: { git tag --annotate '${{ inputs.tag-prefix }}/latest' $latest --message 'Latest tag for ${{ inputs.tag-prefix }}' git push origin 'refs/tags/${{ inputs.tag-prefix }}/latest' - $gitMessage = 'Swap tagged at ${{steps.determine-timestamp.outputs.timestamp}}' - git tag --annotate '${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' $latest --message $gitMessage - git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{steps.determine-timestamp.outputs.timestamp}}' + $gitMessage = 'Swap tagged at ${{steps.create-timestamp.outputs.timestamp}}' + git tag --annotate '${{ inputs.tag-prefix }}/${{steps.create-timestamp.outputs.timestamp}}' $latest --message $gitMessage + git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{steps.create-timestamp.outputs.timestamp}}' } else { From c4ffd16d311585138c49d0cf1589f9aabb4f3f29 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Thu, 8 Aug 2024 13:17:49 +0200 Subject: [PATCH 23/50] Change when timestamp is created in workflow --- .github/actions/create-timestamp/action.yml | 2 +- .../workflows/deploy-to-azure-app-service.yml | 32 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/actions/create-timestamp/action.yml b/.github/actions/create-timestamp/action.yml index 49b9a2c7b..ec173d3e2 100644 --- a/.github/actions/create-timestamp/action.yml +++ b/.github/actions/create-timestamp/action.yml @@ -8,7 +8,7 @@ runs: shell: pwsh run: | # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags. - $timestamp = ((Get-Date).ToUniversalTime().GetDateTimeFormats('s')[0]) -replace ':', '.' + $timestamp = ((Get-Date).ToUniversalTime().GetDateTimeFormats('s')[0]) -replace ':', '-' echo "timestamp=$timestamp" >> $env:GITHUB_OUTPUT outputs: diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 25166553d..16aa60922 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -241,20 +241,6 @@ jobs: release-name: 'Deploy #${{ github.run_number }} to ${{ inputs.slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} - - name: Start Web App Slot - run: | - Start-AzureWebAppSlot ` - -ResourceGroupName ${{ inputs.resource-group-name }} ` - -WebAppName ${{ inputs.app-name }} ` - -SlotName ${{ inputs.slot-name }} - - - name: Test Web App Slot - run: | - Test-AzureWebApp ` - -ResourceGroupName ${{ inputs.resource-group-name }} ` - -WebAppName ${{ inputs.app-name }} ` - -SlotName ${{ inputs.slot-name }} - - name: Remove old tags uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 with: @@ -269,8 +255,8 @@ jobs: $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') if ($latestTag) { - git tag -d '${{ inputs.tag-prefix }}/latest' - git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' + git tag -d '${{ inputs.tag-prefix }}/latest' + git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' } - name: Tag Latest and add Timestamp Tag @@ -280,6 +266,20 @@ jobs: git tag '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}' git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}' + - name: Start Web App Slot + run: | + Start-AzureWebAppSlot ` + -ResourceGroupName ${{ inputs.resource-group-name }} ` + -WebAppName ${{ inputs.app-name }} ` + -SlotName ${{ inputs.slot-name }} + + - name: Test Web App Slot + run: | + Test-AzureWebApp ` + -ResourceGroupName ${{ inputs.resource-group-name }} ` + -WebAppName ${{ inputs.app-name }} ` + -SlotName ${{ inputs.slot-name }} + - name: Cancel Workflow on Failure if: failure() && inputs.cancel-workflow-on-failure == 'true' uses: Lombiq/GitHub-Actions/.github/actions/cancel-workflow@dev From 6dc1e8037153af8c60647c9ed4b16f8c631f1159 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Thu, 8 Aug 2024 13:22:39 +0200 Subject: [PATCH 24/50] Remove redundant quotes --- .github/workflows/deploy-to-azure-app-service.yml | 2 +- .github/workflows/swap-azure-web-app-slots.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 16aa60922..9cf62557e 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -134,7 +134,7 @@ on: If ready to run is set to `true` the `runtime` input is needed. tag-prefix: type: string - default: 'staging' + default: staging required: false description: > The prefix to use for the tag. If not set, 'staging' will be used as the prefix. The tag will be in the diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index f137ca5d6..5e5ea14f3 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -98,7 +98,7 @@ on: tracking what's deployed, where and when by tagging the deployed commit. swap-prefix: type: string - default: 'staging' + default: staging required: false description: > The prefix of the deployment tag that we will be looking for in the app-code-repo. If not set, 'staging' will From 24d0b3a01bf6eb85368fa371907768f0e6d51a50 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Thu, 8 Aug 2024 13:53:11 +0200 Subject: [PATCH 25/50] Move timestamp creation moment --- .github/workflows/deploy-to-azure-app-service.yml | 8 ++++---- .github/workflows/swap-azure-web-app-slots.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 9cf62557e..9c7417cc1 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -235,6 +235,10 @@ jobs: restart: false clean: false + - name: Create timestamp + id: create-timestamp + uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 + - name: Add Azure Application Insights Release Annotation uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev with: @@ -246,10 +250,6 @@ jobs: with: tag-prefix: ${{ inputs.tag-prefix }} - - name: Create timestamp - id: create-timestamp - uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - - name: Delete Old prefix/latest Tag run: | $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 5e5ea14f3..85a7864d2 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -139,6 +139,10 @@ jobs: -SourceSlotName ${{ inputs.source-slot-name }} ` -DestinationSlotName ${{ inputs.destination-slot-name }} + - name: Create timestamp + id: create-timestamp + uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 + - name: Add Azure Application Insights Release Annotation uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev with: @@ -171,10 +175,6 @@ jobs: with: tag-prefix: ${{ inputs.tag-prefix }} - - name: Create timestamp - id: create-timestamp - uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - - name: Delete Old prefix/latest tag if: inputs.app-code-repo != '' run: | From db8485fb3a306f1541ebd0e129a2f884601f3c47 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 9 Aug 2024 14:33:45 +0200 Subject: [PATCH 26/50] Release Annotation Timestamp --- .../Add-ReleaseAnnotation.ps1 | 3 ++- .../action.yml | 7 +++++++ .github/workflows/deploy-orchard1-to-azure-app-service.yml | 2 +- .github/workflows/deploy-to-azure-app-service.yml | 2 +- .github/workflows/reset-azure-environment.yml | 2 +- .github/workflows/swap-azure-web-app-slots.yml | 2 +- .github/workflows/swap-orchard1-azure-web-app-slots.yml | 2 +- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/actions/add-azure-application-insights-release-annotation/Add-ReleaseAnnotation.ps1 b/.github/actions/add-azure-application-insights-release-annotation/Add-ReleaseAnnotation.ps1 index 5ce83edaf..ed306058e 100644 --- a/.github/actions/add-azure-application-insights-release-annotation/Add-ReleaseAnnotation.ps1 +++ b/.github/actions/add-azure-application-insights-release-annotation/Add-ReleaseAnnotation.ps1 @@ -1,6 +1,7 @@ param( [parameter(Mandatory = $true)][string]$ApplicationInsightsResourceId, [parameter(Mandatory = $true)][string]$ReleaseName, + [parameter(Mandatory = $false)][string]$Timestamp = '', [parameter(Mandatory = $false)]$ReleaseProperties = @() ) @@ -9,7 +10,7 @@ Write-Output "Adding release annotation with the release name `"$ReleaseName`"." $annotation = @{ Id = [Guid]::NewGuid() AnnotationName = $ReleaseName - EventTime = (Get-Date).ToUniversalTime().GetDateTimeFormats('s')[0] + EventTime = if ($Timestamp) { $Timestamp } else { (Get-Date).ToUniversalTime().GetDateTimeFormats('s')[0] } # AI only displays annotations from the "Deployment" category so this must be this string. Category = 'Deployment' Properties = ConvertTo-Json $ReleaseProperties -Compress diff --git a/.github/actions/add-azure-application-insights-release-annotation/action.yml b/.github/actions/add-azure-application-insights-release-annotation/action.yml index 610844f25..916410146 100644 --- a/.github/actions/add-azure-application-insights-release-annotation/action.yml +++ b/.github/actions/add-azure-application-insights-release-annotation/action.yml @@ -13,6 +13,11 @@ inputs: required: false description: > The name to give the created release annotation. This will be visible on the Azure Portal when viewing it. + timestamp: + required: false + description: > + The timestamp to use for the release annotation. If not set then the current time will be used. This can be useful + when using a single timestamp for multiple actions in a workflow. runs: using: composite @@ -28,10 +33,12 @@ runs: # Might contain user input so should go via an env var for security. RELEASE_NAME: ${{ inputs.release-name }} AI_RESOURCE_ID: ${{ inputs.application-insights-resource-id }} + TIMESTAMP: ${{ inputs.timestamp }} run: | $params = @{ ApplicationInsightsResourceId = $Env:AI_RESOURCE_ID ReleaseName = $Env:RELEASE_NAME ? $Env:RELEASE_NAME : 'Run #${{ github.run_number }} (GitHub Actions)' + Timestamp = $Env:TIMESTAMP ReleaseProperties = @{ 'Commit branch' = '${{ github.head_ref }}' 'Commit SHA' = '${{ github.sha }}' diff --git a/.github/workflows/deploy-orchard1-to-azure-app-service.yml b/.github/workflows/deploy-orchard1-to-azure-app-service.yml index 9fc64e0db..cfc547227 100644 --- a/.github/workflows/deploy-orchard1-to-azure-app-service.yml +++ b/.github/workflows/deploy-orchard1-to-azure-app-service.yml @@ -183,7 +183,7 @@ jobs: - name: Add Azure Application Insights Release Annotation if: ${{ inputs.application-insights-resource-id != '' }} - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 with: release-name: 'Deploy #${{ github.run_number }} to ${{ inputs.slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 9c7417cc1..4418ae5c8 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -240,7 +240,7 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - name: Add Azure Application Insights Release Annotation - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 with: release-name: 'Deploy #${{ github.run_number }} to ${{ inputs.slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} diff --git a/.github/workflows/reset-azure-environment.yml b/.github/workflows/reset-azure-environment.yml index 2192d1eca..076abb6a5 100644 --- a/.github/workflows/reset-azure-environment.yml +++ b/.github/workflows/reset-azure-environment.yml @@ -193,7 +193,7 @@ jobs: - name: Add Azure Application Insights Release Annotation if: ${{ inputs.application-insights-resource-id != '' }} - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 with: release-name: 'Reset #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 85a7864d2..d75b61d50 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -144,7 +144,7 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - name: Add Azure Application Insights Release Annotation - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 with: release-name: 'Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} diff --git a/.github/workflows/swap-orchard1-azure-web-app-slots.yml b/.github/workflows/swap-orchard1-azure-web-app-slots.yml index 30c9def3f..ff995551e 100644 --- a/.github/workflows/swap-orchard1-azure-web-app-slots.yml +++ b/.github/workflows/swap-orchard1-azure-web-app-slots.yml @@ -111,7 +111,7 @@ jobs: - name: Add Azure Application Insights Release Annotation if: ${{ inputs.application-insights-resource-id != '' }} - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 with: release-name: 'Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} From ba715f60951bf2533245600c13afb51fd5a8bbca Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 9 Aug 2024 17:18:54 +0200 Subject: [PATCH 27/50] Pass timestamp to action --- .github/workflows/deploy-to-azure-app-service.yml | 1 + .github/workflows/swap-azure-web-app-slots.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 4418ae5c8..b2842b5a4 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -244,6 +244,7 @@ jobs: with: release-name: 'Deploy #${{ github.run_number }} to ${{ inputs.slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} + timestamp: ${{ steps.create-timestamp.outputs.timestamp }} - name: Remove old tags uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index d75b61d50..1e65fd132 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -148,6 +148,7 @@ jobs: with: release-name: 'Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} + timestamp: ${{ steps.create-timestamp.outputs.timestamp }} - name: Test Destination Web App Slot run: | From be6a8a2b39b55760fc55f2f94d1a9e9ab7672005 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 9 Aug 2024 17:40:18 +0200 Subject: [PATCH 28/50] actual timestamp and timestamp tag --- .github/actions/create-timestamp/action.yml | 7 ++++++- .github/workflows/deploy-to-azure-app-service.yml | 4 ++-- .github/workflows/swap-azure-web-app-slots.yml | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/actions/create-timestamp/action.yml b/.github/actions/create-timestamp/action.yml index ec173d3e2..1795577e1 100644 --- a/.github/actions/create-timestamp/action.yml +++ b/.github/actions/create-timestamp/action.yml @@ -8,10 +8,15 @@ runs: shell: pwsh run: | # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags. - $timestamp = ((Get-Date).ToUniversalTime().GetDateTimeFormats('s')[0]) -replace ':', '-' + $timestamp = ((Get-Date).ToUniversalTime().GetDateTimeFormats('s')[0]) + $timestamp-tag = $timestamp -replace ":", "." echo "timestamp=$timestamp" >> $env:GITHUB_OUTPUT + echo "timestamp-tag=$timestamp-tag" >> $env:GITHUB_OUTPUT outputs: timestamp: description: The generated timestamp value: ${{ steps.get-timestamp.outputs.timestamp }} + timestamp-tag: + description: The generated timestamp parsed as a usable git tag + value: ${{ steps.get-timestamp.outputs.timestamp-tag }} diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index b2842b5a4..874d5e1d8 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -264,8 +264,8 @@ jobs: run: | git tag '${{ inputs.tag-prefix }}/latest' git push origin 'refs/tags/${{ inputs.tag-prefix }}/latest' - git tag '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}' - git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp }}' + git tag '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }}' + git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }}' - name: Start Web App Slot run: | diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 1e65fd132..5631fd53f 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -205,9 +205,9 @@ jobs: { git tag --annotate '${{ inputs.tag-prefix }}/latest' $latest --message 'Latest tag for ${{ inputs.tag-prefix }}' git push origin 'refs/tags/${{ inputs.tag-prefix }}/latest' - $gitMessage = 'Swap tagged at ${{steps.create-timestamp.outputs.timestamp}}' - git tag --annotate '${{ inputs.tag-prefix }}/${{steps.create-timestamp.outputs.timestamp}}' $latest --message $gitMessage - git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{steps.create-timestamp.outputs.timestamp}}' + $gitMessage = 'Swap tagged at ${{ steps.create-timestamp.outputs.timestamp-tag }}' + git tag --annotate '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }}' $latest --message $gitMessage + git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }}' } else { From c89918130cb5f7867b4190bea8f4db1daaabb990 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 9 Aug 2024 17:54:24 +0200 Subject: [PATCH 29/50] Update action.yml --- .github/actions/create-timestamp/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/create-timestamp/action.yml b/.github/actions/create-timestamp/action.yml index 1795577e1..16bc0f23e 100644 --- a/.github/actions/create-timestamp/action.yml +++ b/.github/actions/create-timestamp/action.yml @@ -9,9 +9,9 @@ runs: run: | # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags. $timestamp = ((Get-Date).ToUniversalTime().GetDateTimeFormats('s')[0]) - $timestamp-tag = $timestamp -replace ":", "." + $timestampTag = $timestamp -replace ":", "." echo "timestamp=$timestamp" >> $env:GITHUB_OUTPUT - echo "timestamp-tag=$timestamp-tag" >> $env:GITHUB_OUTPUT + echo "timestamp-tag=$timestampTag" >> $env:GITHUB_OUTPUT outputs: timestamp: From 39404533cfd28ff9534ac7b53f6712a802975cd9 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Mon, 12 Aug 2024 18:02:09 +0200 Subject: [PATCH 30/50] Renames, docs updates and fixes --- .github/actions/create-timestamp/action.yml | 2 +- .github/actions/remove-old-tags/action.yml | 2 + .../workflows/deploy-to-azure-app-service.yml | 6 +-- .../workflows/swap-azure-web-app-slots.yml | 47 +++++++++---------- .../AzureHosting/SwapAzureWebAppSlots.md | 6 ++- 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/actions/create-timestamp/action.yml b/.github/actions/create-timestamp/action.yml index 16bc0f23e..3d386e883 100644 --- a/.github/actions/create-timestamp/action.yml +++ b/.github/actions/create-timestamp/action.yml @@ -9,7 +9,7 @@ runs: run: | # Get the current timestamp in the ISO 8601 format but replace ":" with "." because we can't use ":" in tags. $timestamp = ((Get-Date).ToUniversalTime().GetDateTimeFormats('s')[0]) - $timestampTag = $timestamp -replace ":", "." + $timestampTag = $timestamp -replace ":", "-" echo "timestamp=$timestamp" >> $env:GITHUB_OUTPUT echo "timestamp-tag=$timestampTag" >> $env:GITHUB_OUTPUT diff --git a/.github/actions/remove-old-tags/action.yml b/.github/actions/remove-old-tags/action.yml index a21574cea..6da80b5c5 100644 --- a/.github/actions/remove-old-tags/action.yml +++ b/.github/actions/remove-old-tags/action.yml @@ -13,6 +13,8 @@ runs: - name: Delete Latest Tag shell: pwsh run: | + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git config user.name 'github-actions[bot]' git fetch --tags $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') if ($latestTag) diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 874d5e1d8..79a87d800 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -235,7 +235,7 @@ jobs: restart: false clean: false - - name: Create timestamp + - name: Create Timestamp id: create-timestamp uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 @@ -246,7 +246,7 @@ jobs: application-insights-resource-id: ${{ inputs.application-insights-resource-id }} timestamp: ${{ steps.create-timestamp.outputs.timestamp }} - - name: Remove old tags + - name: Remove Old Tags uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 with: tag-prefix: ${{ inputs.tag-prefix }} @@ -260,7 +260,7 @@ jobs: git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' } - - name: Tag Latest and add Timestamp Tag + - name: Tag Latest and Add Timestamp Tag run: | git tag '${{ inputs.tag-prefix }}/latest' git push origin 'refs/tags/${{ inputs.tag-prefix }}/latest' diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 5631fd53f..07dd9c1b3 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -30,7 +30,6 @@ on: parameter when calling azure/login. You can look this up e.g. in the Azure Portal under any resource or the subscription itself. CODE_REPOSITORY_WRITE_TOKEN: - default: ${{ github.token }} required: false description: > An authentication token, like a personal access token (PAT) that gives access to the other repository. @@ -76,33 +75,38 @@ on: description: > ID of the Application Insights resource that the release annotation for the swap should be added to. This can e.g. be looked up on the Azure Portal under the given AI resource's Overview page -> JSON View. - app-code-repo: + app-code-repository: type: string default: '' required: false description: > - The repository that hosts the code that will be swapped. This is necessary for adding tags. - ref: + The repository that hosts the code that will be swapped during the Azure Web App slot swap process. This is + necessary for adding tags to the repository to track the deployment status and history. If not specified, + tagging steps will be skipped. Example input: 'organization/repository-name' + app-code-repository-ref: type: string required: false description: > - The branch, tag or SHA to checkout. When checking out the repository that triggered a workflow, this defaults - to the reference or SHA for that event. Otherwise, uses the default branch. + The branch, tag, or SHA to checkout from the specified app-code-repository. When checking out the repository + that triggered this workflow, this defaults to the reference or SHA for that event. Otherwise, it uses the + default branch of the app-code-repository. This is used to ensure the correct version of the code is used + during the tagging process. tag-prefix: type: string default: ${{ inputs.destination-slot-name }} required: false description: > - The prefix for the tags that will be added to the app-code-repo. If not set, the slot name will be used as - the prefix. The tag will be in the format of "/latest" and "/". This is used for + The prefix for the tags that will be added to the app-code-repository. If not set, 'production' will be used + as the prefix. The tag will be in the format of "/latest" and "/". This is used for tracking what's deployed, where and when by tagging the deployed commit. swap-prefix: type: string default: staging required: false description: > - The prefix of the deployment tag that we will be looking for in the app-code-repo. If not set, 'staging' will - be used as the prefix. This is used to find the currently deployed commit by its tag in the app-code-repo. + The prefix of the deployment tag that we will be looking for in the app-code-repository. If not set, 'staging' + will be used as the prefix. This is used to find the currently deployed commit by its tag in the + app-code-repository. jobs: swap-azure-web-app-slots: @@ -158,26 +162,19 @@ jobs: -SlotName ${{ inputs.destination-slot-name }} - name: Checkout Code Repository - if: inputs.app-code-repo != '' + if: inputs.app-code-repository != '' uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: - repository: ${{ inputs.app-code-repo }} - ref: ${{ inputs.ref }} + repository: ${{ inputs.app-code-repository }} + ref: ${{ inputs.app-code-repository-ref }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} - - name: Setup Git Config - if: inputs.app-code-repo != '' - run: | - git config user.email '41898282+github-actions[bot]@users.noreply.github.com' - git config user.name 'github-actions[bot]' - - - name: Remove old tags + - name: Remove Old Tags uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 with: tag-prefix: ${{ inputs.tag-prefix }} - - name: Delete Old prefix/latest tag - if: inputs.app-code-repo != '' + - name: Delete Old prefix/latest Tag run: | $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') if ($latestTag) @@ -187,7 +184,7 @@ jobs: } - name: Move Latest Tag (Swap) and Add Timestamp Tag - if: inputs.app-code-repo != '' + if: inputs.app-code-repository != '' run: | if([string]::IsNullOrEmpty('${{ inputs.tag-prefix }}')) { @@ -216,9 +213,9 @@ jobs: - name: Create Release uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 - if: inputs.app-code-repo != '' + if: inputs.app-code-repository != '' with: - repo: ${{ inputs.app-code-repo }} + repo: ${{ inputs.app-code-repository }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} tag: ${{ inputs.tag-prefix }}/latest allowUpdates: true diff --git a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md index f6d0c92a4..6fa70df48 100644 --- a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md +++ b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md @@ -20,12 +20,14 @@ jobs: source-slot-name: Staging destination-slot-name: Production application-insights-resource-id: "Azure resource ID of the corresponding AI resource" - # Defaults to destination-slot-name if not set, used for adding git tags to the deployed commit. + # Defaults to 'production' if not set, used for adding git tags to the deployed commit. tag-prefix: production # Defaults to 'staging' if not set, used looking up the currently deployed commit by tag. swap-prefix: staging # The repository that hosts the code that will be swapped. This is necessary for adding tags and releases. - app-code-repo: Lombiq/Lombiq-GitHub-Actions + app-code-repository: Lombiq/Lombiq-GitHub-Actions + # The branch, tag, or SHA to check out from the app-code-repository. + app-code-repository-ref: main secrets: AZURE_APP_SERVICE_SWAP_SERVICE_PRINCIPAL_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_SERVICE_PRINCIPAL_ID }} AZURE_APP_SERVICE_SWAP_AZURE_TENANT_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_AZURE_TENANT_ID }} From d4a43e7652771cbac0dc631a32bf6cbff832de08 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Mon, 12 Aug 2024 21:49:41 +0200 Subject: [PATCH 31/50] Update swap-azure-web-app-slots.yml --- .github/workflows/swap-azure-web-app-slots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 07dd9c1b3..3a70a7fc3 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -93,7 +93,7 @@ on: during the tagging process. tag-prefix: type: string - default: ${{ inputs.destination-slot-name }} + default: production required: false description: > The prefix for the tags that will be added to the app-code-repository. If not set, 'production' will be used From ba7c71325356f1fba37ec5670965abd306eae230 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Mon, 12 Aug 2024 22:00:46 +0200 Subject: [PATCH 32/50] Update action.yml --- .github/actions/remove-old-tags/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/remove-old-tags/action.yml b/.github/actions/remove-old-tags/action.yml index 6da80b5c5..14c346c09 100644 --- a/.github/actions/remove-old-tags/action.yml +++ b/.github/actions/remove-old-tags/action.yml @@ -4,7 +4,7 @@ description: > inputs: tag-prefix: - description: The prefix for the tag we are removing + description: The prefix for the tag we are removing. required: true runs: From 2cf5ba412ccc6e1d857657eba2ed5269d77c9cf2 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 14 Aug 2024 10:41:53 +0200 Subject: [PATCH 33/50] Optional sha for ai annotation --- .../action.yml | 9 ++++++++- .github/workflows/swap-azure-web-app-slots.yml | 14 ++------------ .../Workflows/AzureHosting/SwapAzureWebAppSlots.md | 2 -- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/actions/add-azure-application-insights-release-annotation/action.yml b/.github/actions/add-azure-application-insights-release-annotation/action.yml index 916410146..9c2214bad 100644 --- a/.github/actions/add-azure-application-insights-release-annotation/action.yml +++ b/.github/actions/add-azure-application-insights-release-annotation/action.yml @@ -18,6 +18,13 @@ inputs: description: > The timestamp to use for the release annotation. If not set then the current time will be used. This can be useful when using a single timestamp for multiple actions in a workflow. + commit-sha: + required: false + default: ${{ github.sha }} + description: > + The commit SHA to include in the release annotation. If not set then the current commit SHA will be used. This is + useful in case of a swap deployment where the code repository is different than the repository the action is + running in. runs: using: composite @@ -41,7 +48,7 @@ runs: Timestamp = $Env:TIMESTAMP ReleaseProperties = @{ 'Commit branch' = '${{ github.head_ref }}' - 'Commit SHA' = '${{ github.sha }}' + 'Commit SHA' = '${{ inputs.commit-sha }}' 'Workflow name' = '${{ github.workflow }}' 'Workflow run URL' = 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}' } diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 3a70a7fc3..1ab19c572 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -83,14 +83,6 @@ on: The repository that hosts the code that will be swapped during the Azure Web App slot swap process. This is necessary for adding tags to the repository to track the deployment status and history. If not specified, tagging steps will be skipped. Example input: 'organization/repository-name' - app-code-repository-ref: - type: string - required: false - description: > - The branch, tag, or SHA to checkout from the specified app-code-repository. When checking out the repository - that triggered this workflow, this defaults to the reference or SHA for that event. Otherwise, it uses the - default branch of the app-code-repository. This is used to ensure the correct version of the code is used - during the tagging process. tag-prefix: type: string default: production @@ -166,7 +158,6 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: repository: ${{ inputs.app-code-repository }} - ref: ${{ inputs.app-code-repository-ref }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} - name: Remove Old Tags @@ -200,10 +191,9 @@ jobs: $latest = (git rev-list -n 1 '${{ inputs.swap-prefix }}/latest') if ($latest) { - git tag --annotate '${{ inputs.tag-prefix }}/latest' $latest --message 'Latest tag for ${{ inputs.tag-prefix }}' + git tag '${{ inputs.tag-prefix }}/latest' git push origin 'refs/tags/${{ inputs.tag-prefix }}/latest' - $gitMessage = 'Swap tagged at ${{ steps.create-timestamp.outputs.timestamp-tag }}' - git tag --annotate '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }}' $latest --message $gitMessage + git tag '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }}' git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }}' } else diff --git a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md index 6fa70df48..9a46aa569 100644 --- a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md +++ b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md @@ -26,8 +26,6 @@ jobs: swap-prefix: staging # The repository that hosts the code that will be swapped. This is necessary for adding tags and releases. app-code-repository: Lombiq/Lombiq-GitHub-Actions - # The branch, tag, or SHA to check out from the app-code-repository. - app-code-repository-ref: main secrets: AZURE_APP_SERVICE_SWAP_SERVICE_PRINCIPAL_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_SERVICE_PRINCIPAL_ID }} AZURE_APP_SERVICE_SWAP_AZURE_TENANT_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_AZURE_TENANT_ID }} From 681b5074906c08aad29714d12dadebe6137aa0d6 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 14 Aug 2024 11:11:57 +0200 Subject: [PATCH 34/50] Passthrough submodules input for checkout --- .github/actions/checkout/action.yml | 6 +++++- .github/workflows/swap-azure-web-app-slots.yml | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/checkout/action.yml b/.github/actions/checkout/action.yml index 11415cfc0..97cba7a5f 100644 --- a/.github/actions/checkout/action.yml +++ b/.github/actions/checkout/action.yml @@ -22,6 +22,10 @@ inputs: fetch-depth: description: Number of commits to fetch. 0 indicates all history for all branches and tags. default: 1 + submodules: + description: > + Whether to checkout submodules - `true` to checkout submodules or `recursive` to recursively checkout submodules. + default: recursive runs: using: composite @@ -40,7 +44,7 @@ runs: with: repository: ${{ inputs.repository }} ref: ${{ inputs.ref }} - submodules: recursive + submodules: ${{ inputs.submodules }} token: ${{ env.CHECKOUT_TOKEN }} path: ${{ inputs.path }} fetch-depth: ${{ inputs.fetch-depth }} diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 1ab19c572..be717c4c7 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -155,10 +155,11 @@ jobs: - name: Checkout Code Repository if: inputs.app-code-repository != '' - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: repository: ${{ inputs.app-code-repository }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} + submodules: false - name: Remove Old Tags uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 From 75c459aeeaca8beee2c9acfb5f0935ff15362ed7 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 14 Aug 2024 11:15:02 +0200 Subject: [PATCH 35/50] Checkout refs --- .github/workflows/build-and-test-dotnet.yml | 2 +- .github/workflows/build-and-test-orchard-core.yml | 2 +- .github/workflows/build-dotnet.yml | 2 +- .github/workflows/deploy-orchard1-to-azure-app-service.yml | 2 +- .github/workflows/deploy-to-azure-app-service.yml | 2 +- .github/workflows/markdown-lint.yml | 2 +- .github/workflows/msbuild-and-test.yml | 2 +- .github/workflows/publish-nuget.yml | 2 +- .github/workflows/spelling.yml | 2 +- .github/workflows/tag-version.yml | 2 +- .github/workflows/test-analysis-failure.yml | 2 +- .github/workflows/validate-this-gha-refs.yml | 4 ++-- .github/workflows/yaml-lint.yml | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-test-dotnet.yml b/.github/workflows/build-and-test-dotnet.yml index e471bc0fb..998627733 100644 --- a/.github/workflows/build-and-test-dotnet.yml +++ b/.github/workflows/build-and-test-dotnet.yml @@ -212,7 +212,7 @@ jobs: github_token: ${{ secrets.CHECKOUT_TOKEN }} - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 1e7b8329c..1e4807786 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -245,7 +245,7 @@ jobs: Write-Output $message - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/build-dotnet.yml b/.github/workflows/build-dotnet.yml index 22013e6f0..9b6a4febb 100644 --- a/.github/workflows/build-dotnet.yml +++ b/.github/workflows/build-dotnet.yml @@ -88,7 +88,7 @@ jobs: Write-Output '::warning::This workflow is deprecated. Use build-and-test-dotnet instead, that can also execute tests.' - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/deploy-orchard1-to-azure-app-service.yml b/.github/workflows/deploy-orchard1-to-azure-app-service.yml index cfc547227..e1d2786fe 100644 --- a/.github/workflows/deploy-orchard1-to-azure-app-service.yml +++ b/.github/workflows/deploy-orchard1-to-azure-app-service.yml @@ -128,7 +128,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 79a87d800..cdce96cbe 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -152,7 +152,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 47fe28d4a..97b48200f 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -43,7 +43,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/msbuild-and-test.yml b/.github/workflows/msbuild-and-test.yml index 05be8ea01..82edd7184 100644 --- a/.github/workflows/msbuild-and-test.yml +++ b/.github/workflows/msbuild-and-test.yml @@ -116,7 +116,7 @@ jobs: github_token: ${{ secrets.CHECKOUT_TOKEN }} - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index 2ff2514c3..1c7722527 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -65,7 +65,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index 8808148f0..03d29586b 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -94,7 +94,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/tag-version.yml b/.github/workflows/tag-version.yml index a280576ab..42441ad63 100644 --- a/.github/workflows/tag-version.yml +++ b/.github/workflows/tag-version.yml @@ -74,7 +74,7 @@ jobs: shell: pwsh steps: - name: Checkout Repository - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.TAG_VERSION_TOKEN }} diff --git a/.github/workflows/test-analysis-failure.yml b/.github/workflows/test-analysis-failure.yml index 42771d56d..3893fe69e 100644 --- a/.github/workflows/test-analysis-failure.yml +++ b/.github/workflows/test-analysis-failure.yml @@ -74,7 +74,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/validate-this-gha-refs.yml b/.github/workflows/validate-this-gha-refs.yml index 5a22c5c7e..1b44344e8 100644 --- a/.github/workflows/validate-this-gha-refs.yml +++ b/.github/workflows/validate-this-gha-refs.yml @@ -17,13 +17,13 @@ jobs: github.event_name == 'pull_request' || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || github.event_name == 'merge_group' - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: fetch-depth: 0 - name: Checkout Repository (Push) if: github.event_name == 'push' - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 - name: Check Merge Queue Adds id: check-merge-queue-adds diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml index 2c1d82db0..377758176 100644 --- a/.github/workflows/yaml-lint.yml +++ b/.github/workflows/yaml-lint.yml @@ -38,7 +38,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: token: ${{ secrets.CHECKOUT_TOKEN }} From 46ec11c6aabde3599525faf35c2671158e6a3c60 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 14 Aug 2024 11:17:56 +0200 Subject: [PATCH 36/50] refs --- .github/actions/precompile-orchard1-app/action.yml | 2 +- .github/workflows/markdown-lint-this-repo.yml | 2 +- .github/workflows/spelling-this-repo.yml | 2 +- .github/workflows/yaml-lint-this-repo.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/precompile-orchard1-app/action.yml b/.github/actions/precompile-orchard1-app/action.yml index 34430f384..3d05aaff5 100644 --- a/.github/actions/precompile-orchard1-app/action.yml +++ b/.github/actions/precompile-orchard1-app/action.yml @@ -55,7 +55,7 @@ runs: if: inputs.repository != '' # Using the official checkout action directly, because our wrapper action doesn't have most of the parameters we # need here. We only need those parameters for this action though. - uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev + uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 with: repository: ${{ inputs.repository }} ref: ${{ inputs.checkout-ref }} diff --git a/.github/workflows/markdown-lint-this-repo.yml b/.github/workflows/markdown-lint-this-repo.yml index 910f32726..8252933d9 100644 --- a/.github/workflows/markdown-lint-this-repo.yml +++ b/.github/workflows/markdown-lint-this-repo.yml @@ -10,7 +10,7 @@ on: jobs: markdown-linting: name: Markdown Linting - uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@dev + uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@issue/OSOE-861 with: globs: '**/*.{md,markdown};!License.md' separator: ; diff --git a/.github/workflows/spelling-this-repo.yml b/.github/workflows/spelling-this-repo.yml index cc1d2dd9b..d8629d3c1 100644 --- a/.github/workflows/spelling-this-repo.yml +++ b/.github/workflows/spelling-this-repo.yml @@ -11,7 +11,7 @@ on: jobs: spelling: name: Spelling - uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@dev + uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@issue/OSOE-861 with: additional-dictionaries: | cspell:companies/src/companies.txt diff --git a/.github/workflows/yaml-lint-this-repo.yml b/.github/workflows/yaml-lint-this-repo.yml index 430585523..99d54ac53 100644 --- a/.github/workflows/yaml-lint-this-repo.yml +++ b/.github/workflows/yaml-lint-this-repo.yml @@ -10,7 +10,7 @@ on: jobs: yaml-linting: name: YAML Linting - uses: Lombiq/GitHub-Actions/.github/workflows/yaml-lint.yml@dev + uses: Lombiq/GitHub-Actions/.github/workflows/yaml-lint.yml@issue/OSOE-861 with: config-file-path: .trunk/configs/.yamllint.yaml search-path: . From 5850112010691c0c8dedb55f773f2834a1eefa4a Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 16 Aug 2024 17:08:20 +0200 Subject: [PATCH 37/50] Tag proper commit --- .github/workflows/swap-azure-web-app-slots.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index be717c4c7..1b39fdb46 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -192,9 +192,10 @@ jobs: $latest = (git rev-list -n 1 '${{ inputs.swap-prefix }}/latest') if ($latest) { - git tag '${{ inputs.tag-prefix }}/latest' + git tag --annotate '${{ inputs.tag-prefix }}/latest' $latest --message 'Latest tag for ${{ inputs.tag-prefix }}' git push origin 'refs/tags/${{ inputs.tag-prefix }}/latest' - git tag '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }}' + $gitMessage = 'Swap tagged at ${{ steps.create-timestamp.outputs.timestamp-tag }}' + git tag --annotate '${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }}' $latest --message $gitMessage git push origin 'refs/tags/${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }}' } else From 3592c6e2a9a6f0b70c996eed806722d5bc1a46e9 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Fri, 16 Aug 2024 18:16:42 +0200 Subject: [PATCH 38/50] Update swap-azure-web-app-slots.yml --- .github/workflows/swap-azure-web-app-slots.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 1b39fdb46..9a45862a6 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -203,11 +203,18 @@ jobs: throw "No latest tag found for swap prefix" } + # Required because the release action takes the repository name and owner as separate inputs. + - name: Extract Repository Name + if: inputs.app-code-repository != '' + run: | + $repoName = '${{ inputs.app-code-repository }}'.Split('/')[1] + echo "repo_name=$repoName" >> $env:GITHUB_ENV + - name: Create Release uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 if: inputs.app-code-repository != '' with: - repo: ${{ inputs.app-code-repository }} + repo: ${{ env.repo_name }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} tag: ${{ inputs.tag-prefix }}/latest allowUpdates: true From acead90fef66b2c2e1b4f80fd1e150d608ec8a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 16 Aug 2024 21:06:21 +0200 Subject: [PATCH 39/50] Docs --- .github/actions/create-timestamp/action.yml | 9 ++++++--- .github/actions/release-action/action.yml | 4 ++-- .github/actions/remove-old-tags/action.yml | 3 ++- .github/workflows/swap-azure-web-app-slots.yml | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/actions/create-timestamp/action.yml b/.github/actions/create-timestamp/action.yml index 3d386e883..8a7aa5e9a 100644 --- a/.github/actions/create-timestamp/action.yml +++ b/.github/actions/create-timestamp/action.yml @@ -1,5 +1,8 @@ name: Create Timestamp -description: Create a timestamp in ISO 8601 format for use in tags (replaces ":" with "." for use in git tags). +description: > + Create a timestamp in ISO 8601 format for use in tags (replaces ":" with "." for use in git tags). Intentionally not + documented in Actions.md since it's only meant for internal use. + runs: using: composite steps: @@ -15,8 +18,8 @@ runs: outputs: timestamp: - description: The generated timestamp + description: The generated timestamp. value: ${{ steps.get-timestamp.outputs.timestamp }} timestamp-tag: - description: The generated timestamp parsed as a usable git tag + description: The generated timestamp parsed as a usable git tag. value: ${{ steps.get-timestamp.outputs.timestamp-tag }} diff --git a/.github/actions/release-action/action.yml b/.github/actions/release-action/action.yml index 92a1a0812..6f8d49539 100644 --- a/.github/actions/release-action/action.yml +++ b/.github/actions/release-action/action.yml @@ -3,8 +3,8 @@ description: > Runs ncipollo/release-action. Exists only to centralize which version of the action we use. Intentionally not documented in Actions.md since it's only meant for internal use. -# Copied from https://github.com/ncipollo/release-action/blob/v1.11.2/action.yml. Formatted to wrap long -# descriptions. Removed inputs not used by Lombiq GitHub-Actions. +# Copied from https://github.com/ncipollo/release-action/blob/main/action.yml. Formatted to wrap long descriptions. +# Removed inputs not used by Lombiq GitHub-Actions. inputs: allowUpdates: description: > diff --git a/.github/actions/remove-old-tags/action.yml b/.github/actions/remove-old-tags/action.yml index 14c346c09..383c071cb 100644 --- a/.github/actions/remove-old-tags/action.yml +++ b/.github/actions/remove-old-tags/action.yml @@ -1,6 +1,7 @@ name: Remove Old Tags description: > - Removes the old prefix/latest tag so that a new one can be set. + Removes the old prefix/latest tag so that a new one can be set. Intentionally not documented in Actions.md since + it's only meant for internal use. inputs: tag-prefix: diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 9a45862a6..11d895cbd 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -135,7 +135,7 @@ jobs: -SourceSlotName ${{ inputs.source-slot-name }} ` -DestinationSlotName ${{ inputs.destination-slot-name }} - - name: Create timestamp + - name: Create Timestamp id: create-timestamp uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 From 3a63e454d3954988c4d276e3dccb53974185054b Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Mon, 19 Aug 2024 18:28:45 +0200 Subject: [PATCH 40/50] Changes based on review --- .github/actions/release-action/action.yml | 5 +++++ .../action.yml | 2 +- .../workflows/deploy-to-azure-app-service.yml | 13 ++---------- .../workflows/swap-azure-web-app-slots.yml | 21 +++++++------------ 4 files changed, 15 insertions(+), 26 deletions(-) rename .github/actions/{remove-old-tags => remove-old-latest-tags}/action.yml (95%) diff --git a/.github/actions/release-action/action.yml b/.github/actions/release-action/action.yml index 92a1a0812..0e5c1ac1a 100644 --- a/.github/actions/release-action/action.yml +++ b/.github/actions/release-action/action.yml @@ -33,6 +33,10 @@ inputs: description: The GitHub token. required: false default: ${{ github.token }} + releaseName: + description: An optional name for the release. If this is omitted the tag will be used. + required: false + default: '' outputs: id: @@ -59,3 +63,4 @@ runs: tag: ${{ inputs.tag }} repo: ${{ inputs.repo }} token: ${{ inputs.token }} + name: ${{ inputs.name }} diff --git a/.github/actions/remove-old-tags/action.yml b/.github/actions/remove-old-latest-tags/action.yml similarity index 95% rename from .github/actions/remove-old-tags/action.yml rename to .github/actions/remove-old-latest-tags/action.yml index 14c346c09..8b27739fd 100644 --- a/.github/actions/remove-old-tags/action.yml +++ b/.github/actions/remove-old-latest-tags/action.yml @@ -1,4 +1,4 @@ -name: Remove Old Tags +name: Remove Old Latest Tags description: > Removes the old prefix/latest tag so that a new one can be set. diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index cdce96cbe..7207ff606 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -246,20 +246,11 @@ jobs: application-insights-resource-id: ${{ inputs.application-insights-resource-id }} timestamp: ${{ steps.create-timestamp.outputs.timestamp }} - - name: Remove Old Tags - uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 + - name: Remove Old Latest Tags + uses: Lombiq/GitHub-Actions/.github/actions/remove-old-latest-tags@issue/OSOE-861 with: tag-prefix: ${{ inputs.tag-prefix }} - - name: Delete Old prefix/latest Tag - run: | - $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') - if ($latestTag) - { - git tag -d '${{ inputs.tag-prefix }}/latest' - git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' - } - - name: Tag Latest and Add Timestamp Tag run: | git tag '${{ inputs.tag-prefix }}/latest' diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 9a45862a6..b88b33a9e 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -161,20 +161,11 @@ jobs: token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} submodules: false - - name: Remove Old Tags - uses: Lombiq/GitHub-Actions/.github/actions/remove-old-tags@issue/OSOE-861 + - name: Remove Old Latest Tags + uses: Lombiq/GitHub-Actions/.github/actions/remove-old-latest-tags@issue/OSOE-861 with: tag-prefix: ${{ inputs.tag-prefix }} - - name: Delete Old prefix/latest Tag - run: | - $latestTag = (git tag --list '${{ inputs.tag-prefix }}/latest') - if ($latestTag) - { - git tag -d '${{ inputs.tag-prefix }}/latest' - git push origin ':refs/tags/${{ inputs.tag-prefix }}/latest' - } - - name: Move Latest Tag (Swap) and Add Timestamp Tag if: inputs.app-code-repository != '' run: | @@ -205,18 +196,20 @@ jobs: # Required because the release action takes the repository name and owner as separate inputs. - name: Extract Repository Name + id: extract-repo-name if: inputs.app-code-repository != '' run: | $repoName = '${{ inputs.app-code-repository }}'.Split('/')[1] - echo "repo_name=$repoName" >> $env:GITHUB_ENV + echo "repoName=$repoName" >> $env:GITHUB_OUTPUT - name: Create Release uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 if: inputs.app-code-repository != '' with: - repo: ${{ env.repo_name }} + repo: ${{ steps.extract-repo-name.outputs.repo_name }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} - tag: ${{ inputs.tag-prefix }}/latest + tag: ${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }} + releaseName: ${{ steps.create-timestamp.outputs.timestamp }} allowUpdates: true generateReleaseNotes: true From 8da0f5caf7cff77bfd2e2801b354a312ae21070f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 20 Aug 2024 23:02:24 +0200 Subject: [PATCH 41/50] PS syntax fix --- .github/workflows/swap-azure-web-app-slots.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 0e0a994ad..296e7f1ec 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -200,7 +200,7 @@ jobs: if: inputs.app-code-repository != '' run: | $repoName = '${{ inputs.app-code-repository }}'.Split('/')[1] - echo "repoName=$repoName" >> $env:GITHUB_OUTPUT + "$Key=$Value" >> $Env:GITHUB_OUTPUT - name: Create Release uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 From 0f75b3c38c83f4c28bd1a2fd2b3d1f70b0cf32fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 20 Aug 2024 23:14:40 +0200 Subject: [PATCH 42/50] Fixing copy-paste error and output name --- .github/workflows/swap-azure-web-app-slots.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 296e7f1ec..f0d2d3224 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -200,13 +200,13 @@ jobs: if: inputs.app-code-repository != '' run: | $repoName = '${{ inputs.app-code-repository }}'.Split('/')[1] - "$Key=$Value" >> $Env:GITHUB_OUTPUT + "repo-name=$repoName" >> $Env:GITHUB_OUTPUT - name: Create Release uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 if: inputs.app-code-repository != '' with: - repo: ${{ steps.extract-repo-name.outputs.repo_name }} + repo: ${{ steps.extract-repo-name.outputs.repo-name }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} tag: ${{ inputs.tag-prefix }}/${{ steps.create-timestamp.outputs.timestamp-tag }} releaseName: ${{ steps.create-timestamp.outputs.timestamp }} From fb759d43fc3d459e917eb8bd4ac04812394a986a Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Wed, 21 Aug 2024 10:11:46 +0200 Subject: [PATCH 43/50] Update action.yml --- .github/actions/release-action/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/release-action/action.yml b/.github/actions/release-action/action.yml index 6a57ee5ad..099a3ccda 100644 --- a/.github/actions/release-action/action.yml +++ b/.github/actions/release-action/action.yml @@ -63,4 +63,4 @@ runs: tag: ${{ inputs.tag }} repo: ${{ inputs.repo }} token: ${{ inputs.token }} - name: ${{ inputs.name }} + name: ${{ inputs.releaseName }} From f29852d1215a6e5d2b81ebe7678769d646844d94 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Thu, 29 Aug 2024 09:55:37 +0200 Subject: [PATCH 44/50] Update swap-azure-web-app-slots.yml --- .../workflows/swap-azure-web-app-slots.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index f0d2d3224..4b2821999 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -139,13 +139,6 @@ jobs: id: create-timestamp uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 - - name: Add Azure Application Insights Release Annotation - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 - with: - release-name: 'Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' - application-insights-resource-id: ${{ inputs.application-insights-resource-id }} - timestamp: ${{ steps.create-timestamp.outputs.timestamp }} - - name: Test Destination Web App Slot run: | Test-AzureWebApp ` @@ -167,6 +160,7 @@ jobs: tag-prefix: ${{ inputs.tag-prefix }} - name: Move Latest Tag (Swap) and Add Timestamp Tag + id: move-latest-tag if: inputs.app-code-repository != '' run: | if([string]::IsNullOrEmpty('${{ inputs.tag-prefix }}')) @@ -193,8 +187,17 @@ jobs: { throw "No latest tag found for swap prefix" } + "commit-sha=$latest" >> $Env:GITHUB_OUTPUT + + - name: Add Azure Application Insights Release Annotation + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 + with: + release-name: 'Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' + application-insights-resource-id: ${{ inputs.application-insights-resource-id }} + timestamp: ${{ steps.create-timestamp.outputs.timestamp }} + commit-sha: ${{ steps.move-latest-tag.outputs.commit-sha }} - # Required because the release action takes the repository name and owner as separate inputs. + # Required because the release action takes the repository name and owner as separate inputs. - name: Extract Repository Name id: extract-repo-name if: inputs.app-code-repository != '' From a6ad302eb9a0bce6e2c18b09336aa6a21fb2ed50 Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Thu, 29 Aug 2024 09:57:51 +0200 Subject: [PATCH 45/50] Update swap-azure-web-app-slots.yml --- .github/workflows/swap-azure-web-app-slots.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 4b2821999..cd996d55e 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -192,12 +192,12 @@ jobs: - name: Add Azure Application Insights Release Annotation uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 with: - release-name: 'Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' - application-insights-resource-id: ${{ inputs.application-insights-resource-id }} - timestamp: ${{ steps.create-timestamp.outputs.timestamp }} - commit-sha: ${{ steps.move-latest-tag.outputs.commit-sha }} + release-name: 'Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' + application-insights-resource-id: ${{ inputs.application-insights-resource-id }} + timestamp: ${{ steps.create-timestamp.outputs.timestamp }} + commit-sha: ${{ steps.move-latest-tag.outputs.commit-sha }} - # Required because the release action takes the repository name and owner as separate inputs. + # Required because the release action takes the repository name and owner as separate inputs. - name: Extract Repository Name id: extract-repo-name if: inputs.app-code-repository != '' From 496a454ea1e282abf69851f32c06e34b56dc73cc Mon Sep 17 00:00:00 2001 From: Aydin Erdas Date: Thu, 29 Aug 2024 10:52:12 +0200 Subject: [PATCH 46/50] Update SwapAzureWebAppSlots.md --- Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md index 9a46aa569..57b300689 100644 --- a/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md +++ b/Docs/Workflows/AzureHosting/SwapAzureWebAppSlots.md @@ -30,7 +30,7 @@ jobs: AZURE_APP_SERVICE_SWAP_SERVICE_PRINCIPAL_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_SERVICE_PRINCIPAL_ID }} AZURE_APP_SERVICE_SWAP_AZURE_TENANT_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_AZURE_TENANT_ID }} AZURE_APP_SERVICE_SWAP_AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_APP_SERVICE_SWAP_AZURE_SUBSCRIPTION_ID }} - # Needs to have access to create tags and releases in the target repository. + # Needs to have access to create tags and releases in the code repository. CODE_REPOSITORY_WRITE_TOKEN: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} ``` From f9437f522d452a522462fb5f3ff2d52d87799259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 29 Aug 2024 18:49:34 +0200 Subject: [PATCH 47/50] Adding notice message to the swap workflow about which commit was swapped out --- .github/workflows/swap-azure-web-app-slots.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index cd996d55e..2ca56ff84 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -187,6 +187,8 @@ jobs: { throw "No latest tag found for swap prefix" } + + Write-Output "::notice::The commit from the app code repository with the SHA $latest was swapped out." "commit-sha=$latest" >> $Env:GITHUB_OUTPUT - name: Add Azure Application Insights Release Annotation From fbb0ba9d2d6c6aa6d79c618b4e2c0ba0c168c9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 29 Aug 2024 19:58:52 +0200 Subject: [PATCH 48/50] Reverting issue branch references for GHA [skip ci] --- .github/actions/precompile-orchard1-app/action.yml | 2 +- .github/actions/publish-nuget/action.yml | 2 +- .github/workflows/build-and-test-dotnet.yml | 4 ++-- .github/workflows/build-and-test-orchard-core.yml | 4 ++-- .github/workflows/build-dotnet.yml | 2 +- .../workflows/deploy-orchard1-to-azure-app-service.yml | 4 ++-- .github/workflows/deploy-to-azure-app-service.yml | 8 ++++---- .github/workflows/markdown-lint-this-repo.yml | 2 +- .github/workflows/markdown-lint.yml | 2 +- .github/workflows/msbuild-and-test.yml | 4 ++-- .github/workflows/publish-nuget.yml | 4 ++-- .github/workflows/reset-azure-environment.yml | 2 +- .github/workflows/spelling-this-repo.yml | 2 +- .github/workflows/spelling.yml | 2 +- .github/workflows/swap-azure-web-app-slots.yml | 10 +++++----- .../workflows/swap-orchard1-azure-web-app-slots.yml | 2 +- .github/workflows/tag-version-this-repo.yml | 2 +- .github/workflows/tag-version.yml | 4 ++-- .github/workflows/test-analysis-failure.yml | 2 +- .github/workflows/validate-pull-request.yml | 2 +- .github/workflows/validate-this-gha-refs.yml | 4 ++-- .github/workflows/yaml-lint-this-repo.yml | 2 +- .github/workflows/yaml-lint.yml | 2 +- 23 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/actions/precompile-orchard1-app/action.yml b/.github/actions/precompile-orchard1-app/action.yml index 3d05aaff5..34430f384 100644 --- a/.github/actions/precompile-orchard1-app/action.yml +++ b/.github/actions/precompile-orchard1-app/action.yml @@ -55,7 +55,7 @@ runs: if: inputs.repository != '' # Using the official checkout action directly, because our wrapper action doesn't have most of the parameters we # need here. We only need those parameters for this action though. - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: repository: ${{ inputs.repository }} ref: ${{ inputs.checkout-ref }} diff --git a/.github/actions/publish-nuget/action.yml b/.github/actions/publish-nuget/action.yml index bbb12ac11..b2a29914d 100644 --- a/.github/actions/publish-nuget/action.yml +++ b/.github/actions/publish-nuget/action.yml @@ -233,7 +233,7 @@ runs: retention-days: ${{ inputs.nuget-artifact-retention-days }} - name: Create Release - uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/release-action@dev # This is to prevent creating releases when pushing tags for issue-specific pre-releases like # v4.3.1-alpha.osoe-86. if: "!contains(steps.setup.outputs.publish-version, '-')" diff --git a/.github/workflows/build-and-test-dotnet.yml b/.github/workflows/build-and-test-dotnet.yml index 9384616de..17d15e593 100644 --- a/.github/workflows/build-and-test-dotnet.yml +++ b/.github/workflows/build-and-test-dotnet.yml @@ -234,7 +234,7 @@ jobs: ENVIRONMENT_VARIABLES_JSON: ${{ secrets.ENVIRONMENT_VARIABLES_JSON }} - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: repository: ${{ inputs.repository }} ref: ${{ inputs.repository-ref }} @@ -270,7 +270,7 @@ jobs: - name: Tests if: inputs.test-disable == 'false' - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev with: blame-hang-timeout: ${{ inputs.blame-hang-timeout }} build-directory: ${{ inputs.build-directory }} diff --git a/.github/workflows/build-and-test-orchard-core.yml b/.github/workflows/build-and-test-orchard-core.yml index 901ba9def..c20385c74 100644 --- a/.github/workflows/build-and-test-orchard-core.yml +++ b/.github/workflows/build-and-test-orchard-core.yml @@ -267,7 +267,7 @@ jobs: Write-Output $message - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: repository: ${{ inputs.repository }} ref: ${{ inputs.repository-ref }} @@ -324,7 +324,7 @@ jobs: - name: Tests if: inputs.test-disable == 'false' - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev with: blame-hang-timeout: ${{ inputs.blame-hang-timeout }} build-directory: ${{ inputs.build-directory }} diff --git a/.github/workflows/build-dotnet.yml b/.github/workflows/build-dotnet.yml index 9b6a4febb..22013e6f0 100644 --- a/.github/workflows/build-dotnet.yml +++ b/.github/workflows/build-dotnet.yml @@ -88,7 +88,7 @@ jobs: Write-Output '::warning::This workflow is deprecated. Use build-and-test-dotnet instead, that can also execute tests.' - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/deploy-orchard1-to-azure-app-service.yml b/.github/workflows/deploy-orchard1-to-azure-app-service.yml index e1d2786fe..9fc64e0db 100644 --- a/.github/workflows/deploy-orchard1-to-azure-app-service.yml +++ b/.github/workflows/deploy-orchard1-to-azure-app-service.yml @@ -128,7 +128,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: token: ${{ secrets.CHECKOUT_TOKEN }} @@ -183,7 +183,7 @@ jobs: - name: Add Azure Application Insights Release Annotation if: ${{ inputs.application-insights-resource-id != '' }} - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev with: release-name: 'Deploy #${{ github.run_number }} to ${{ inputs.slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} diff --git a/.github/workflows/deploy-to-azure-app-service.yml b/.github/workflows/deploy-to-azure-app-service.yml index 7207ff606..a740c5851 100644 --- a/.github/workflows/deploy-to-azure-app-service.yml +++ b/.github/workflows/deploy-to-azure-app-service.yml @@ -152,7 +152,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: token: ${{ secrets.CHECKOUT_TOKEN }} @@ -237,17 +237,17 @@ jobs: - name: Create Timestamp id: create-timestamp - uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@dev - name: Add Azure Application Insights Release Annotation - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev with: release-name: 'Deploy #${{ github.run_number }} to ${{ inputs.slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} timestamp: ${{ steps.create-timestamp.outputs.timestamp }} - name: Remove Old Latest Tags - uses: Lombiq/GitHub-Actions/.github/actions/remove-old-latest-tags@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/remove-old-latest-tags@dev with: tag-prefix: ${{ inputs.tag-prefix }} diff --git a/.github/workflows/markdown-lint-this-repo.yml b/.github/workflows/markdown-lint-this-repo.yml index 8252933d9..910f32726 100644 --- a/.github/workflows/markdown-lint-this-repo.yml +++ b/.github/workflows/markdown-lint-this-repo.yml @@ -10,7 +10,7 @@ on: jobs: markdown-linting: name: Markdown Linting - uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/workflows/markdown-lint.yml@dev with: globs: '**/*.{md,markdown};!License.md' separator: ; diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index 97b48200f..47fe28d4a 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -43,7 +43,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/msbuild-and-test.yml b/.github/workflows/msbuild-and-test.yml index 474bd66f5..5ed7e7bf7 100644 --- a/.github/workflows/msbuild-and-test.yml +++ b/.github/workflows/msbuild-and-test.yml @@ -138,7 +138,7 @@ jobs: ENVIRONMENT_VARIABLES_JSON: ${{ secrets.ENVIRONMENT_VARIABLES_JSON }} - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: repository: ${{ inputs.repository }} ref: ${{ inputs.repository-ref }} @@ -162,7 +162,7 @@ jobs: - name: Tests if: inputs.test-disable == 'false' - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev with: build-directory: ${{ inputs.build-directory }} dotnet-test-process-timeout: ${{ inputs.dotnet-test-process-timeout }} diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml index eb726b8ff..643ca94b5 100644 --- a/.github/workflows/publish-nuget.yml +++ b/.github/workflows/publish-nuget.yml @@ -81,7 +81,7 @@ jobs: ENVIRONMENT_VARIABLES_JSON: ${{ secrets.ENVIRONMENT_VARIABLES_JSON }} - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: token: ${{ secrets.CHECKOUT_TOKEN }} @@ -91,7 +91,7 @@ jobs: dotnet-version: ${{ inputs.dotnet-version }} - name: Publish to NuGet - uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/publish-nuget@dev with: source: ${{ inputs.source }} verbosity: ${{ inputs.verbosity }} diff --git a/.github/workflows/reset-azure-environment.yml b/.github/workflows/reset-azure-environment.yml index 076abb6a5..2192d1eca 100644 --- a/.github/workflows/reset-azure-environment.yml +++ b/.github/workflows/reset-azure-environment.yml @@ -193,7 +193,7 @@ jobs: - name: Add Azure Application Insights Release Annotation if: ${{ inputs.application-insights-resource-id != '' }} - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev with: release-name: 'Reset #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} diff --git a/.github/workflows/spelling-this-repo.yml b/.github/workflows/spelling-this-repo.yml index d8629d3c1..cc1d2dd9b 100644 --- a/.github/workflows/spelling-this-repo.yml +++ b/.github/workflows/spelling-this-repo.yml @@ -11,7 +11,7 @@ on: jobs: spelling: name: Spelling - uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@dev with: additional-dictionaries: | cspell:companies/src/companies.txt diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index 03d29586b..8808148f0 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -94,7 +94,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/swap-azure-web-app-slots.yml b/.github/workflows/swap-azure-web-app-slots.yml index 2ca56ff84..50820f1e4 100644 --- a/.github/workflows/swap-azure-web-app-slots.yml +++ b/.github/workflows/swap-azure-web-app-slots.yml @@ -137,7 +137,7 @@ jobs: - name: Create Timestamp id: create-timestamp - uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/create-timestamp@dev - name: Test Destination Web App Slot run: | @@ -148,14 +148,14 @@ jobs: - name: Checkout Code Repository if: inputs.app-code-repository != '' - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: repository: ${{ inputs.app-code-repository }} token: ${{ secrets.CODE_REPOSITORY_WRITE_TOKEN }} submodules: false - name: Remove Old Latest Tags - uses: Lombiq/GitHub-Actions/.github/actions/remove-old-latest-tags@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/remove-old-latest-tags@dev with: tag-prefix: ${{ inputs.tag-prefix }} @@ -192,7 +192,7 @@ jobs: "commit-sha=$latest" >> $Env:GITHUB_OUTPUT - name: Add Azure Application Insights Release Annotation - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev with: release-name: 'Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} @@ -208,7 +208,7 @@ jobs: "repo-name=$repoName" >> $Env:GITHUB_OUTPUT - name: Create Release - uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/release-action@dev if: inputs.app-code-repository != '' with: repo: ${{ steps.extract-repo-name.outputs.repo-name }} diff --git a/.github/workflows/swap-orchard1-azure-web-app-slots.yml b/.github/workflows/swap-orchard1-azure-web-app-slots.yml index ff995551e..30c9def3f 100644 --- a/.github/workflows/swap-orchard1-azure-web-app-slots.yml +++ b/.github/workflows/swap-orchard1-azure-web-app-slots.yml @@ -111,7 +111,7 @@ jobs: - name: Add Azure Application Insights Release Annotation if: ${{ inputs.application-insights-resource-id != '' }} - uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/add-azure-application-insights-release-annotation@dev with: release-name: 'Swap #${{ github.run_number }} from ${{ inputs.source-slot-name }} to ${{ inputs.destination-slot-name }}' application-insights-resource-id: ${{ inputs.application-insights-resource-id }} diff --git a/.github/workflows/tag-version-this-repo.yml b/.github/workflows/tag-version-this-repo.yml index ca21b79ff..2105aea5d 100644 --- a/.github/workflows/tag-version-this-repo.yml +++ b/.github/workflows/tag-version-this-repo.yml @@ -9,7 +9,7 @@ jobs: run: name: Tag Version Automation if: github.event.pusher.name != 'LombiqBot' - uses: Lombiq/GitHub-Actions/.github/workflows/tag-version.yml@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/workflows/tag-version.yml@dev with: additional-pattern-include-list: '@("https://raw.githubusercontent.com/Lombiq/GitHub-Actions/(?[\w\./-]*)/.github")' secrets: diff --git a/.github/workflows/tag-version.yml b/.github/workflows/tag-version.yml index 42441ad63..a90ab9852 100644 --- a/.github/workflows/tag-version.yml +++ b/.github/workflows/tag-version.yml @@ -74,7 +74,7 @@ jobs: shell: pwsh steps: - name: Checkout Repository - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: token: ${{ secrets.TAG_VERSION_TOKEN }} @@ -106,7 +106,7 @@ jobs: run: git push --tags --force - name: Create Release - uses: Lombiq/GitHub-Actions/.github/actions/release-action@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/release-action@dev # This is to prevent creating releases when pushing tags for issue-specific pre-releases like # v4.3.1-alpha.osoe-86. if: "!contains(steps.determine-tag.outputs.tagname, '-')" diff --git a/.github/workflows/test-analysis-failure.yml b/.github/workflows/test-analysis-failure.yml index 3893fe69e..42771d56d 100644 --- a/.github/workflows/test-analysis-failure.yml +++ b/.github/workflows/test-analysis-failure.yml @@ -74,7 +74,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: token: ${{ secrets.CHECKOUT_TOKEN }} diff --git a/.github/workflows/validate-pull-request.yml b/.github/workflows/validate-pull-request.yml index b8137e81e..d892b20cb 100644 --- a/.github/workflows/validate-pull-request.yml +++ b/.github/workflows/validate-pull-request.yml @@ -28,6 +28,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check for Merge Conflict in PR - uses: Lombiq/GitHub-Actions/.github/actions/check-merge-conflict@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/check-merge-conflict@dev env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/validate-this-gha-refs.yml b/.github/workflows/validate-this-gha-refs.yml index 1b44344e8..5a22c5c7e 100644 --- a/.github/workflows/validate-this-gha-refs.yml +++ b/.github/workflows/validate-this-gha-refs.yml @@ -17,13 +17,13 @@ jobs: github.event_name == 'pull_request' || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved') || github.event_name == 'merge_group' - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: fetch-depth: 0 - name: Checkout Repository (Push) if: github.event_name == 'push' - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev - name: Check Merge Queue Adds id: check-merge-queue-adds diff --git a/.github/workflows/yaml-lint-this-repo.yml b/.github/workflows/yaml-lint-this-repo.yml index 99d54ac53..430585523 100644 --- a/.github/workflows/yaml-lint-this-repo.yml +++ b/.github/workflows/yaml-lint-this-repo.yml @@ -10,7 +10,7 @@ on: jobs: yaml-linting: name: YAML Linting - uses: Lombiq/GitHub-Actions/.github/workflows/yaml-lint.yml@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/workflows/yaml-lint.yml@dev with: config-file-path: .trunk/configs/.yamllint.yaml search-path: . diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml index 377758176..2c1d82db0 100644 --- a/.github/workflows/yaml-lint.yml +++ b/.github/workflows/yaml-lint.yml @@ -38,7 +38,7 @@ jobs: timeout-minutes: ${{ inputs.timeout-minutes }} steps: - name: Checkout - uses: Lombiq/GitHub-Actions/.github/actions/checkout@issue/OSOE-861 + uses: Lombiq/GitHub-Actions/.github/actions/checkout@dev with: token: ${{ secrets.CHECKOUT_TOKEN }} From 395598680ed89a2548f638ac17a7b87bd5403717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 29 Aug 2024 20:00:03 +0200 Subject: [PATCH 49/50] Dummy change to kick off build --- New Text Document.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 New Text Document.txt diff --git a/New Text Document.txt b/New Text Document.txt new file mode 100644 index 000000000..e69de29bb From d1ce2bd5168357087bc63577c3d71d773be956bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 29 Aug 2024 20:00:08 +0200 Subject: [PATCH 50/50] Revert "Dummy change to kick off build" This reverts commit 395598680ed89a2548f638ac17a7b87bd5403717. --- New Text Document.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 New Text Document.txt diff --git a/New Text Document.txt b/New Text Document.txt deleted file mode 100644 index e69de29bb..000000000