Skip to content

Commit 88a8cc4

Browse files
committed
[DEVOPS-4327] ci(release): add OneDrive upload functionality
1 parent 0563b4a commit 88a8cc4

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/build-release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,53 @@ jobs:
369369
& gh release create $ReleaseTag --repo $Repository --title $ReleaseTitle $Files.FullName
370370
}
371371
}
372+
373+
- name: Check out Devolutions/actions
374+
if: ${{ fromJSON(needs.preflight.outputs.dry-run) == false }}
375+
uses: actions/checkout@v4
376+
with:
377+
repository: Devolutions/actions
378+
ref: v1
379+
token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
380+
path: ./.github/workflows
381+
382+
- name: Install Devolutions Toolbox
383+
if: ${{ fromJSON(needs.preflight.outputs.dry-run) == false }}
384+
uses: ./.github/workflows/toolbox-install
385+
with:
386+
github_token: ${{ secrets.DEVOLUTIONSBOT_TOKEN }}
387+
388+
- name: Stage files for OneDrive upload
389+
if: ${{ fromJSON(needs.preflight.outputs.dry-run) == false }}
390+
shell: pwsh
391+
run: |
392+
$PackageVersion = '${{ needs.preflight.outputs.package-version }}'
393+
New-Item -Path "onedrive-staging" -ItemType Directory -Force | Out-Null
394+
395+
$Mappings = @{
396+
"output/UniGetUI-release-x64/UniGetUI.Installer.x64.exe" = "Devolutions.UniGetUI.win-x64.$PackageVersion.exe"
397+
"output/UniGetUI-release-arm64/UniGetUI.Installer.arm64.exe" = "Devolutions.UniGetUI.win-arm64.$PackageVersion.exe"
398+
"output/UniGetUI-release-x64/UniGetUI.x64.zip" = "Devolutions.UniGetUI.win-x64.$PackageVersion.zip"
399+
"output/UniGetUI-release-arm64/UniGetUI.arm64.zip" = "Devolutions.UniGetUI.win-arm64.$PackageVersion.zip"
400+
}
401+
402+
foreach ($entry in $Mappings.GetEnumerator()) {
403+
if (Test-Path $entry.Key) {
404+
Copy-Item -Path $entry.Key -Destination "onedrive-staging/$($entry.Value)"
405+
Write-Host "Staged: $($entry.Key) -> $($entry.Value)"
406+
} else {
407+
Write-Host "::warning::File not found: $($entry.Key)"
408+
}
409+
}
410+
411+
- name: Upload to OneDrive
412+
if: ${{ fromJSON(needs.preflight.outputs.dry-run) == false }}
413+
uses: ./.github/workflows/onedrive-upload
414+
with:
415+
azure_client_id: ${{ secrets.ONEDRIVE_AUTOMATION_CLIENT_ID }}
416+
azure_client_secret: ${{ secrets.ONEDRIVE_AUTOMATION_CLIENT_SECRET }}
417+
conflict_behavior: replace
418+
destination_path: /UniGetUI/${{ needs.preflight.outputs.package-version }}
419+
remote: releases
420+
source_path: Devolutions.UniGetUI.*
421+
working_directory: onedrive-staging

0 commit comments

Comments
 (0)