fix: resolve latest release dynamically in installers (was hardcoded v0.2.0)
CI / Lint (push) Failing after 9m35s
CI / Test (push) Failing after 6m4s
CI / Build (darwin/amd64) (push) Skipped
CI / Build (linux/amd64) (push) Skipped
CI / Build (windows/amd64) (push) Skipped
CI / Build (darwin/arm64) (push) Skipped
CI / Build (linux/arm64) (push) Skipped
CI / Build (windows/arm64) (push) Skipped
CI / Release (push) Skipped
CI / Lint (push) Failing after 9m35s
CI / Test (push) Failing after 6m4s
CI / Build (darwin/amd64) (push) Skipped
CI / Build (linux/amd64) (push) Skipped
CI / Build (windows/amd64) (push) Skipped
CI / Build (darwin/arm64) (push) Skipped
CI / Build (linux/arm64) (push) Skipped
CI / Build (windows/arm64) (push) Skipped
CI / Release (push) Skipped
This commit is contained in:
+14
-1
@@ -8,8 +8,21 @@
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$Version = if ($env:CLIP_SYNC_VERSION) { $env:CLIP_SYNC_VERSION } else { 'v0.2.0' }
|
||||
$Version = if ($env:CLIP_SYNC_VERSION) { $env:CLIP_SYNC_VERSION } else { 'latest' }
|
||||
$Repo = 'https://git.dracodev.net/Projets/clip-sync'
|
||||
$ApiBase = 'https://git.dracodev.net/api/v1/repos/Projets/clip-sync'
|
||||
|
||||
# ── Resolve version ───────────────────────────────────────────────────
|
||||
|
||||
if ($Version -eq 'latest') {
|
||||
try {
|
||||
$release = Invoke-RestMethod "$ApiBase/releases/latest" -UseBasicParsing
|
||||
$Version = $release.tag_name
|
||||
if (-not $Version) { throw 'no tag_name' }
|
||||
} catch {
|
||||
throw "clip-sync: no release found. Publish one (git tag v0.2.0 && git push origin v0.2.0), or build from source: git clone $Repo && cd clip-sync && make install"
|
||||
}
|
||||
}
|
||||
|
||||
# ── Detect architecture ───────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user