Skip to content

Commit

Permalink
fix loupedeck; change workflow triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mnich committed Oct 27, 2024
1 parent db3a6da commit b70a392
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/github-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
workflow_dispatch:
schedule:
- cron: '3 0/4 * * *' # every 4 hours
push:
branches:
- main
paths:
- .github/workflows/github-releases.yml

jobs:
update-releasebased:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/update-via-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
workflow_dispatch:
schedule:
- cron: 7 0/4 * * *

permissions:
contents: write
pull-requests: write
push:
branches:
- main
paths:
- .github/workflows/update-via-script.yml
- Scripts/Packages/*

jobs:
update-scriptbased:
Expand Down
12 changes: 9 additions & 3 deletions scripts/Packages/Update-Loupedeck.Loupedeck.ps1
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@


$latestVersionUrl = $WebsiteURL

# download latest version from loupedeck.com and get version by filename
$versionInfo = Get-ProductVersionFromFile -WebsiteURL $WebsiteURL -VersionInfoProperty "ProductVersion"


Write-Host "Found latest version: $versionInfo"
$latestversion = $versionInfo
# extract major and minor version e.g. 5.9 from 5.9.10
$majorMinorVersion = $versionInfo -replace '\.\d+\.\d+$'
$majorMinorVersion = $versionInfo -replace '\.\d+$'
$fullDownloadURL = "https://support.loupedeck.com/hubfs/Knowledge%20Base/LD%20Software%20Downloads/$majorMinorVersion/LoupedeckInstaller_" + $versionInfo + ".exe"
# check if full download URL is valid
Write-Host "Full download URL: $fullDownloadURL"
$fullDownloadURLResponse = Invoke-WebRequest -Uri $fullDownloadURL -UseBasicParsing -Method Head -ErrorAction Continue
if ($fullDownloadURLResponse.StatusCode -ne 200) {
Write-Host "Current download URL is not valid. Status Code: $($fullDownloadURLResponse.StatusCode) Checking alternative URL"
$majorMinorVersion = $versionInfo -replace '\.\d+\.\d+$'
$fullDownloadURL = "https://support.loupedeck.com/hubfs/Knowledge%20Base/LD%20Software%20Downloads/$majorMinorVersion/LoupedeckInstaller_" + $versionInfo + ".exe"
Write-Host "Alternative download URL: $fullDownloadURL"
}

# check if full download URL is valid
$fullDownloadURLResponse = Invoke-WebRequest -Uri $fullDownloadURL -UseBasicParsing -Method Head
Expand Down

0 comments on commit b70a392

Please sign in to comment.