1 Commits

Author SHA1 Message Date
Renovate Bot de3c84363b Add renovate.json
CI / Windows x64 (push) Successful in 9m5s
CI / Windows x64 (pull_request) Has been cancelled
2026-08-02 12:07:28 +00:00
5 changed files with 29 additions and 75 deletions
+18 -41
View File
@@ -135,16 +135,6 @@ jobs:
# Releases go through the Gitea API directly: it is GitHub-compatible in # Releases go through the Gitea API directly: it is GitHub-compatible in
# shape, but a self-hosted instance may not have ready-made actions. # shape, but a self-hosted instance may not have ready-made actions.
#
# The step is written to be repeatable. Creating a release in the Gitea
# web UI also creates the tag, so by the time this runs the release
# usually exists already and a blind POST would fail with 409. The same
# goes for re-running a build over a tag whose assets are in place.
#
# Keep it POSIX: the runner executes steps with dash, so no `pipefail`.
# curl calls therefore stay out of pipelines — under `set -e` a failed
# command substitution aborts the step, which is what pipefail bought us.
# No -x anywhere here: these commands carry the token.
- name: Publish release - name: Publish release
if: startsWith(github.ref, 'refs/tags/v') if: startsWith(github.ref, 'refs/tags/v')
env: env:
@@ -152,42 +142,29 @@ jobs:
API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }} API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }}
TAG: ${{ github.ref_name }} TAG: ${{ github.ref_name }}
run: | run: |
# Keep this POSIX: the runner executes steps with dash, where
# `set -o pipefail` does not exist. So the curl call is kept out of a
# pipeline — under `set -e` a failed command substitution aborts the
# step, which is what pipefail would have bought us. Without that, a
# failing curl would be masked by a successful jq, id would become
# null, and assets would be uploaded to a release that never existed.
# No -x here: the command carries the token.
set -eu set -eu
auth="Authorization: token $TOKEN" response=$(curl -fsS -X POST "$API/releases" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\"}")
# Reuse the release if it is already there, create it otherwise. id=$(printf '%s' "$response" | jq -r '.id // empty')
existing=$(curl -sS -o /tmp/release.json -w '%{http_code}' \
-H "$auth" "$API/releases/tags/$TAG")
if [ "$existing" = "200" ]; then
echo "release $TAG already exists, attaching assets to it"
else
echo "creating release $TAG"
curl -fsS -o /tmp/release.json -X POST "$API/releases" \
-H "$auth" -H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\"}"
fi
id=$(jq -r '.id // empty' /tmp/release.json)
if [ -z "$id" ]; then if [ -z "$id" ]; then
echo "could not resolve release id for $TAG:" >&2 echo "no release id in response: $response" >&2
cat /tmp/release.json >&2
exit 1 exit 1
fi fi
echo "release $TAG (id $id)"
for file in dist/*.exe; do for file in dist/*.exe; do
name=$(basename "$file") echo "uploading $(basename "$file")"
curl -fsS -X POST "$API/releases/$id/assets?name=$(basename "$file")" \
# Replace an asset of the same name rather than ending up with two. -H "Authorization: token $TOKEN" \
curl -fsS -o /tmp/assets.json -H "$auth" "$API/releases/$id/assets" -F "attachment=@$file" > /dev/null
for old in $(jq -r --arg n "$name" '.[] | select(.name==$n) | .id' /tmp/assets.json); do
echo "removing previous $name (asset $old)"
curl -fsS -X DELETE -H "$auth" "$API/releases/$id/assets/$old" > /dev/null
done done
echo "uploading $name"
curl -fsS -X POST "$API/releases/$id/assets?name=$name" \
-H "$auth" -F "attachment=@$file" > /dev/null
done
echo "release $TAG (id $id) is ready"
Generated
+1 -1
View File
@@ -1224,7 +1224,7 @@ dependencies = [
[[package]] [[package]]
name = "syshelper" name = "syshelper"
version = "0.1.1" version = "0.1.0"
dependencies = [ dependencies = [
"argon2", "argon2",
"axum", "axum",
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "syshelper" name = "syshelper"
version = "0.1.1" version = "0.1.0"
edition = "2021" edition = "2021"
[dependencies] [dependencies]
+3 -32
View File
@@ -185,18 +185,7 @@ begin
SW_HIDE, ewWaitUntilTerminated, Code); SW_HIDE, ewWaitUntilTerminated, Code);
end; end;
// Запускаем через net start, а не sc start, по той же причине, что и остановку: procedure InstallService();
// net дожидается фактического запуска и возвращает ошибку, если он не удался.
// sc отдаёт управление сразу, и сломанная установка выглядела бы успешной.
function StartService(): Boolean;
var
Code: Integer;
begin
Result := Exec(ExpandConstant('{sys}\net.exe'), 'start {#ServiceName}', '',
SW_HIDE, ewWaitUntilTerminated, Code) and (Code = 0);
end;
function InstallService(): Boolean;
var var
Bin: String; Bin: String;
begin begin
@@ -215,8 +204,7 @@ begin
RunSc('description {#ServiceName} "Родительский контроль: следит за запуском программ."'); RunSc('description {#ServiceName} "Родительский контроль: следит за запуском программ."');
// Родительский контроль не должен исчезать из-за одной аварии. // Родительский контроль не должен исчезать из-за одной аварии.
RunSc('failure {#ServiceName} reset= 86400 actions= restart/5000/restart/5000/restart/60000'); RunSc('failure {#ServiceName} reset= 86400 actions= restart/5000/restart/5000/restart/60000');
RunSc('start {#ServiceName}');
Result := StartService();
end; end;
// Каталог данных закрываем от обычных пользователей: унаследованные от // Каталог данных закрываем от обычных пользователей: унаследованные от
@@ -235,8 +223,6 @@ begin
end; end;
procedure CurStepChanged(CurStep: TSetupStep); procedure CurStepChanged(CurStep: TSetupStep);
var
Started: Boolean;
begin begin
if CurStep <> ssPostInstall then if CurStep <> ssPostInstall then
Exit; Exit;
@@ -245,22 +231,7 @@ begin
// только затем поднимаем службу. // только затем поднимаем службу.
LockDownDataDir(); LockDownDataDir();
SetPassword(); SetPassword();
Started := InstallService(); InstallService();
// Обе проверки — про молчаливый отказ: без них установка отрапортует об
// успехе, а защиты не будет. При тихой установке (автообновление) человека
// за экраном нет, и разбираться придётся по журналу Inno, /LOG= его пишет.
if WizardSilent() then
Exit;
if not AuthConfigured() then
MsgBox('Не удалось сохранить пароль панели.'#13#10 +
'Панель откроется без пароля, и задать его сможет любой, ' +
'кто зайдёт первым.', mbError, MB_OK);
if not Started then
MsgBox('Служба не запустилась — контроль сейчас не работает.'#13#10 +
'Откройте «Службы» и посмотрите System Helper.', mbError, MB_OK);
end; end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
+6
View File
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}