Skip to content

Commit

Permalink
Update ARM64EC workflow norifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Benualdo committed Nov 13, 2024
1 parent 5d46502 commit a5a43bd
Show file tree
Hide file tree
Showing 13 changed files with 810 additions and 245 deletions.
113 changes: 97 additions & 16 deletions .github/workflows/ARM64EC_DX12_Debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
name: "ARM64EC DX12 Debug "

on:
workflow_dispatch:
push:
branches: [ "master" ]
paths:
Expand Down Expand Up @@ -45,23 +46,103 @@ permissions:
contents: read

jobs:
build:
build_arm64ec_dx12_debug:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.11.2, 18.0.0)'
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.11.2, 18.0.0)'

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}
- name: Success Notification
if: ${{ success() }}
run: |
$DISCORD_BUILD_WEBHOOK_URL = "${{ secrets.DISCORD_BUILD_WEBHOOK_URL }}"
$commitMessage = "${{ github.event.head_commit.message }}"
$jobName = "${{ github.job }}"
$runId = "${{ github.run_id }}"
$repo = "${{ github.repository }}"
$serverUrl = "${{ github.server_url }}"
$jobsApiUrl = "https://api.github.com/repos/$repo/actions/runs/$runId/jobs"
$jobId = (curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" $jobsApiUrl | ConvertFrom-Json).jobs | Where-Object { $_.name -eq $jobName } | Select-Object -ExpandProperty id
$jobUrl = "$serverUrl/$repo/actions/runs/$runId/job/$jobId"
$jsonPayload = @"
{
"username": "GitHub",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Debug build succeeded",
"description": "$commitMessage",
"color": 38912,
"thumbnail": {
"url": "https://github.com/vimontgames/vgframework/blob/master/doc/img/buildsuccess.png?raw=true"
},
"author": {
"name": "$($env:GITHUB_ACTOR)",
"url": "https://github.com/$($env:GITHUB_ACTOR)",
"icon_url": "https://avatars.githubusercontent.com/u/$($env:GITHUB_ACTOR_ID)?v=4"
},
"url": "$jobUrl"
}
]
}
"@
$RESPONSE = curl -H "Content-Type: application/json" -X POST -d $jsonPayload $DISCORD_BUILD_WEBHOOK_URL
Write-Output "Webhook server response: $RESPONSE"

- name: Failure Notification
if: ${{ failure() }}
run: |
$DISCORD_BUILD_WEBHOOK_URL = "${{ secrets.DISCORD_BUILD_WEBHOOK_URL }}"
$commitMessage = "${{ github.event.head_commit.message }}"
$jobName = "${{ github.job }}"
$runId = "${{ github.run_id }}"
$repo = "${{ github.repository }}"
$serverUrl = "${{ github.server_url }}"
$jobsApiUrl = "https://api.github.com/repos/$repo/actions/runs/$runId/jobs"
$jobId = (curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" $jobsApiUrl | ConvertFrom-Json).jobs | Where-Object { $_.name -eq $jobName } | Select-Object -ExpandProperty id
$jobUrl = "$serverUrl/$repo/actions/runs/$runId/job/$jobId"
$jsonPayload = @"
{
"username": "GitHub",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Debug build failed",
"description": "$commitMessage",
"color": 16515049,
"thumbnail": {
"url": "https://github.com/vimontgames/vgframework/blob/master/doc/img/buildfailed.png?raw=true"
},
"author": {
"name": "$($env:GITHUB_ACTOR)",
"url": "https://github.com/$($env:GITHUB_ACTOR)",
"icon_url": "https://avatars.githubusercontent.com/u/$($env:GITHUB_ACTOR_ID)?v=4"
},
"url": "$jobUrl"
}
]
}
"@
$RESPONSE = curl -H "Content-Type: application/json" -X POST -d $jsonPayload $DISCORD_BUILD_WEBHOOK_URL
Write-Output "Webhook server response: $RESPONSE"
113 changes: 97 additions & 16 deletions .github/workflows/ARM64EC_DX12_Final.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
name: "ARM64EC DX12 Final "

on:
workflow_dispatch:
push:
branches: [ "master" ]
paths:
Expand Down Expand Up @@ -45,23 +46,103 @@ permissions:
contents: read

jobs:
build:
build_arm64ec_dx12_final:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.11.2, 18.0.0)'
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.11.2, 18.0.0)'

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}
- name: Success Notification
if: ${{ success() }}
run: |
$DISCORD_BUILD_WEBHOOK_URL = "${{ secrets.DISCORD_BUILD_WEBHOOK_URL }}"
$commitMessage = "${{ github.event.head_commit.message }}"
$jobName = "${{ github.job }}"
$runId = "${{ github.run_id }}"
$repo = "${{ github.repository }}"
$serverUrl = "${{ github.server_url }}"
$jobsApiUrl = "https://api.github.com/repos/$repo/actions/runs/$runId/jobs"
$jobId = (curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" $jobsApiUrl | ConvertFrom-Json).jobs | Where-Object { $_.name -eq $jobName } | Select-Object -ExpandProperty id
$jobUrl = "$serverUrl/$repo/actions/runs/$runId/job/$jobId"
$jsonPayload = @"
{
"username": "GitHub",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Final build succeeded",
"description": "$commitMessage",
"color": 38912,
"thumbnail": {
"url": "https://github.com/vimontgames/vgframework/blob/master/doc/img/buildsuccess.png?raw=true"
},
"author": {
"name": "$($env:GITHUB_ACTOR)",
"url": "https://github.com/$($env:GITHUB_ACTOR)",
"icon_url": "https://avatars.githubusercontent.com/u/$($env:GITHUB_ACTOR_ID)?v=4"
},
"url": "$jobUrl"
}
]
}
"@
$RESPONSE = curl -H "Content-Type: application/json" -X POST -d $jsonPayload $DISCORD_BUILD_WEBHOOK_URL
Write-Output "Webhook server response: $RESPONSE"

- name: Failure Notification
if: ${{ failure() }}
run: |
$DISCORD_BUILD_WEBHOOK_URL = "${{ secrets.DISCORD_BUILD_WEBHOOK_URL }}"
$commitMessage = "${{ github.event.head_commit.message }}"
$jobName = "${{ github.job }}"
$runId = "${{ github.run_id }}"
$repo = "${{ github.repository }}"
$serverUrl = "${{ github.server_url }}"
$jobsApiUrl = "https://api.github.com/repos/$repo/actions/runs/$runId/jobs"
$jobId = (curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" $jobsApiUrl | ConvertFrom-Json).jobs | Where-Object { $_.name -eq $jobName } | Select-Object -ExpandProperty id
$jobUrl = "$serverUrl/$repo/actions/runs/$runId/job/$jobId"
$jsonPayload = @"
{
"username": "GitHub",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Final build failed",
"description": "$commitMessage",
"color": 16515049,
"thumbnail": {
"url": "https://github.com/vimontgames/vgframework/blob/master/doc/img/buildfailed.png?raw=true"
},
"author": {
"name": "$($env:GITHUB_ACTOR)",
"url": "https://github.com/$($env:GITHUB_ACTOR)",
"icon_url": "https://avatars.githubusercontent.com/u/$($env:GITHUB_ACTOR_ID)?v=4"
},
"url": "$jobUrl"
}
]
}
"@
$RESPONSE = curl -H "Content-Type: application/json" -X POST -d $jsonPayload $DISCORD_BUILD_WEBHOOK_URL
Write-Output "Webhook server response: $RESPONSE"
114 changes: 98 additions & 16 deletions .github/workflows/ARM64EC_DX12_Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
name: "ARM64EC DX12 Release "

on:
workflow_dispatch:
push:
branches: [ "master" ]
paths:
Expand Down Expand Up @@ -45,23 +46,104 @@ permissions:
contents: read

jobs:
build:
build_arm64ec_dx12_release:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.11.2, 18.0.0)'

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- uses: actions/checkout@v4

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.11.2, 18.0.0)'

- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}

- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} ${{env.SOLUTION_FILE_PATH}}
- name: Success Notification
if: ${{ success() }}
run: |
$DISCORD_BUILD_WEBHOOK_URL = "${{ secrets.DISCORD_BUILD_WEBHOOK_URL }}"
$commitMessage = "${{ github.event.head_commit.message }}"
$jobName = "${{ github.job }}"
$runId = "${{ github.run_id }}"
$repo = "${{ github.repository }}"
$serverUrl = "${{ github.server_url }}"
$jobsApiUrl = "https://api.github.com/repos/$repo/actions/runs/$runId/jobs"
$jobId = (curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" $jobsApiUrl | ConvertFrom-Json).jobs | Where-Object { $_.name -eq $jobName } | Select-Object -ExpandProperty id
$jobUrl = "$serverUrl/$repo/actions/runs/$runId/job/$jobId"
$jsonPayload = @"
{
"username": "GitHub",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Release build succeeded",
"description": "$commitMessage",
"color": 38912,
"thumbnail": {
"url": "https://github.com/vimontgames/vgframework/blob/master/doc/img/buildsuccess.png?raw=true"
},
"author": {
"name": "$($env:GITHUB_ACTOR)",
"url": "https://github.com/$($env:GITHUB_ACTOR)",
"icon_url": "https://avatars.githubusercontent.com/u/$($env:GITHUB_ACTOR_ID)?v=4"
},
"url": "$jobUrl"
}
]
}
"@
$RESPONSE = curl -H "Content-Type: application/json" -X POST -d $jsonPayload $DISCORD_BUILD_WEBHOOK_URL
Write-Output "Webhook server response: $RESPONSE"

- name: Failure Notification
if: ${{ failure() }}
run: |
$DISCORD_BUILD_WEBHOOK_URL = "${{ secrets.DISCORD_BUILD_WEBHOOK_URL }}"
$commitMessage = "${{ github.event.head_commit.message }}"
$jobName = "${{ github.job }}"
$runId = "${{ github.run_id }}"
$repo = "${{ github.repository }}"
$serverUrl = "${{ github.server_url }}"
$jobsApiUrl = "https://api.github.com/repos/$repo/actions/runs/$runId/jobs"
$jobId = (curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" $jobsApiUrl | ConvertFrom-Json).jobs | Where-Object { $_.name -eq $jobName } | Select-Object -ExpandProperty id
$jobUrl = "$serverUrl/$repo/actions/runs/$runId/job/$jobId"
$jsonPayload = @"
{
"username": "GitHub",
"content": "",
"embeds": [
{
"type": "rich",
"title": "ARM64EC DX12 Release build failed",
"description": "$commitMessage",
"color": 16515049,
"thumbnail": {
"url": "https://github.com/vimontgames/vgframework/blob/master/doc/img/buildfailed.png?raw=true"
},
"author": {
"name": "$($env:GITHUB_ACTOR)",
"url": "https://github.com/$($env:GITHUB_ACTOR)",
"icon_url": "https://avatars.githubusercontent.com/u/$($env:GITHUB_ACTOR_ID)?v=4"
},
"url": "$jobUrl"
}
]
}
"@
$RESPONSE = curl -H "Content-Type: application/json" -X POST -d $jsonPayload $DISCORD_BUILD_WEBHOOK_URL
Write-Output "Webhook server response: $RESPONSE"

Loading

0 comments on commit a5a43bd

Please sign in to comment.