Skip to content

Commit

Permalink
Updated CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
WolverinDEV committed Feb 27, 2024
1 parent fafed7f commit fac0fd0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/invoke-mapper.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
$Headers = @{
"Accept" = "application/vnd.github+json"
"Authorization" = "Bearer $env:UEFI_MAPPER_GITHUB_TOKEN"
"X-GitHub-Api-Version" = "2022-11-28"
}
$Payload = @{
"event_type" = "driver_updated"
"client_payload" = @{
"driver_authorization" = "$env:DRIVER_GITHUB_TOKEN"
"driver_url" = "https://api.github.com/repos/Valthrun/valthrun-driver/actions/artifacts/$env:DRIVER_ARTIFACT_ID/zip"
"driver_version" = "$env:GITHUB_REF_NAME-$($env:GITHUB_SHA.Substring(0, 7))"
}
}
Invoke-WebRequest -Uri "https://api.github.com/repos/Valthrun/valthrun-uefi-mapper/dispatches" `
-Method POST `
-Headers $Headers `
-Body $(ConvertTo-Json $Payload)

20 changes: 4 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,11 @@ jobs:
target/x86_64-pc-windows-msvc/release/driver_uefi.pdb
- name: Trigger ISO build
shell: bash
env:
UEFI_MAPPER_GITHUB_TOKEN: ${{ secrets.UEFI_MAPPER_GITHUB_TOKEN }}
DRIVER_GITHUB_TOKEN: ${{ secrets.DRIVER_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
DRIVER_ARTIFACT_ID: ${{ steps.uefi-driver-upload.outputs.artifact-id }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF_NAME: ${{ github.ref_name || 'unknown' }}
if: ${{ env.UEFI_MAPPER_GITHUB_TOKEN != '' }}
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.UEFI_MAPPER_GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/Valthrun/valthrun-uefi-mapper/dispatches \
-d '{
"event_type": "driver_updated",
"client_payload":{
"driver_authorization": "${{ secrets.DRIVER_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}",
"driver_url": "https://api.github.com/repos/Valthrun/valthrun-driver/actions/artifacts/${{ steps.uefi-driver-upload.outputs.artifact-id }}/zip",
"driver_version": "${{ github.ref_name || 'unknown' }}-${GITHUB_SHA::7}"
}
}'
run: ./.github/workflows/invoke-mapper.ps1

0 comments on commit fac0fd0

Please sign in to comment.