Download the newest MSI with installer/get-latest-msi.ps1
Some checks are pending
CI / Integration (mcr.microsoft.com/mssql/server:2017-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2019-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2022-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2025-latest) (push) Blocked by required conditions
CI / Build og unit tests (push) Successful in 57s
deploy community / deploy (push) Successful in 1s
CI / MSI-installer (push) Successful in 38s
Some checks are pending
CI / Integration (mcr.microsoft.com/mssql/server:2017-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2019-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2022-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2025-latest) (push) Blocked by required conditions
CI / Build og unit tests (push) Successful in 57s
deploy community / deploy (push) Successful in 1s
CI / MSI-installer (push) Successful in 38s
Forgejo 10 has no releases/latest/download/ URL, so the versionless second copy of the MSI in each release was useless. Releases now carry the MSI once; get-latest-msi.ps1 finds it through GET /releases/latest (no login). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c91908adce
commit
3da6f338b7
4 changed files with 27 additions and 9 deletions
|
|
@ -42,9 +42,9 @@ jobs:
|
|||
name: SQLInsight-Pro-msi
|
||||
path: dist/*.msi
|
||||
- name: Udgiv som release
|
||||
# Kun tags (v1.2.0): MSI'en vedhæftes releasen og kan hentes uden login fra
|
||||
# <repo>/releases/latest/download/SQLInsight-Pro-x64.msi. RELEASE_TOKEN (valgfri secret) bruges,
|
||||
# hvis Actions' automatiske token ikke må oprette releases.
|
||||
# Kun tags (v1.2.0): MSI'en vedhæftes releasen og kan hentes uden login, nyeste med
|
||||
# installer/get-latest-msi.ps1. RELEASE_TOKEN (valgfri secret) bruges, hvis Actions' automatiske
|
||||
# token ikke må oprette releases.
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
env:
|
||||
TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Begge bruger en **repository-database** på en SQL Server 2016+-instans, der hel
|
|||
|
||||
## Hurtigst: MSI-installeren
|
||||
|
||||
`SQLInsight-Pro-<version>-x64.msi` installerer agent og web som Windows-tjenester. .NET er indbygget, så serveren behøver ingen runtime. Opret først repository-databasen (trin 2) og giv rettigheder (trin 3). Kør derefter installeren som administrator:
|
||||
`SQLInsight-Pro-<version>-x64.msi` installerer agent og web som Windows-tjenester. .NET er indbygget, så serveren behøver ingen runtime. Hent den nyeste under [Releases](https://git.seosoft.dk/seo/sqlinsight-pro/releases), eller med `installer\get-latest-msi.ps1`. Opret først repository-databasen (trin 2) og giv rettigheder (trin 3). Kør derefter installeren som administrator:
|
||||
|
||||
- **Med installationsguiden:** Første side spørger om forbindelsesstrengen til repositoriet, den første SQL Server, tjenestekonti og port.
|
||||
- **Stille, fx med SCCM/Intune:**
|
||||
|
|
|
|||
21
installer/get-latest-msi.ps1
Normal file
21
installer/get-latest-msi.ps1
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<#
|
||||
.SYNOPSIS
|
||||
Henter den nyeste SQLInsight Pro-MSI fra Forgejo-releases (ingen login kræves).
|
||||
.EXAMPLE
|
||||
.\installer\get-latest-msi.ps1 # gemmer i den aktuelle mappe
|
||||
.\installer\get-latest-msi.ps1 -OutDir C:\Temp
|
||||
#>
|
||||
param(
|
||||
[string]$OutDir = (Get-Location).Path,
|
||||
[string]$Repo = 'https://git.seosoft.dk/api/v1/repos/seo/sqlinsight-pro'
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
$release = Invoke-RestMethod "$Repo/releases/latest"
|
||||
$asset = $release.assets | Where-Object name -like 'SQLInsight-Pro-*-x64.msi' | Select-Object -First 1
|
||||
if (-not $asset) { throw "Releasen $($release.tag_name) har ingen MSI." }
|
||||
|
||||
$target = Join-Path $OutDir $asset.name
|
||||
Invoke-WebRequest $asset.browser_download_url -OutFile $target -UseBasicParsing
|
||||
Write-Output "$($release.name): $target"
|
||||
|
|
@ -4,8 +4,8 @@
|
|||
publish-release.py dist/SQLInsight-Pro-1.2.0-x64.msi
|
||||
|
||||
Environment (set by Forgejo Actions): GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_REF_NAME, and TOKEN with write
|
||||
access to the repository. The MSI is attached twice: under its own name and as SQLInsight-Pro-x64.msi, so the
|
||||
newest one can always be fetched from .../releases/latest/download/SQLInsight-Pro-x64.msi.
|
||||
access to the repository. Forgejo has no .../releases/latest/download/ URL; installer/get-latest-msi.ps1 finds the
|
||||
newest MSI through the API (GET /repos/{repo}/releases/latest) instead.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
|
|
@ -14,8 +14,6 @@ import urllib.error
|
|||
import urllib.request
|
||||
import uuid
|
||||
|
||||
LATEST_NAME = "SQLInsight-Pro-x64.msi"
|
||||
|
||||
SERVER = os.environ["GITHUB_SERVER_URL"].rstrip("/")
|
||||
REPO = os.environ["GITHUB_REPOSITORY"]
|
||||
TAG = os.environ["GITHUB_REF_NAME"]
|
||||
|
|
@ -64,7 +62,6 @@ def main():
|
|||
})
|
||||
print(f"release {TAG} oprettet")
|
||||
upload(release, msi, os.path.basename(msi))
|
||||
upload(call("GET", f"{API}/releases/{release['id']}"), msi, LATEST_NAME)
|
||||
print(f"{SERVER}/{REPO}/releases/tag/{TAG}")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue