BlueGit

ict rusty-teams

Merged

ci(release): KVT-release, AUR-pakket kvt-rusty-teams-bin en updater via git.kvt.nl

!3 · merged 3 days ago

hephaestus bot wants to merge 1 commit from feat/kvt-release-aur-updater into master

Pipeline

#480 Passed

Reviews

  • No reviews yet.

Merged by hephaestus on 28 November 2026 18f32429

Overview Commits 1 Pipelines 1 Changes 18

Changes

18 files changed +1209 −31
Cargo.lock +9 −0
@@ -321,6 +321,7 @@ dependencies = [
321 321 "gpui-kit",
322 322 "image",
323 323 "ksni",
324 "kvt-update",
324 325 "libc",
325 326 "log",
326 327 "mcp",
@@ -5143,6 +5144,14 @@ dependencies = [
5143 5144 "smallvec",
5144 5145 ]
5145 5146
5147 [[package]]
5148 name = "kvt-update"
5149 version = "0.6.1"
5150 dependencies = [
5151 "serde",
5152 "serde_json",
5153 ]
5154
5146 5155 [[package]]
5147 5156 name = "lazy_static"
5148 5157 version = "1.5.1"
@@ -321,6 +321,7 @@ dependencies = [
321 "gpui-kit",
321 "gpui-kit",
322 "image",
322 "image",
323 "ksni",
323 "ksni",
324 "kvt-update",
324 "libc",
325 "libc",
325 "log",
326 "log",
326 "mcp",
327 "mcp",
@@ -5143,6 +5144,14 @@ dependencies = [
5143 "smallvec",
5144 "smallvec",
5144]
5145]
5145
5146
5147[[package]]
5148name = "kvt-update"
5149version = "0.6.1"
5150dependencies = [
5151 "serde",
5152 "serde_json",
5153]
5154
5146[[package]]
5155[[package]]
5147name = "lazy_static"
5156name = "lazy_static"
5148version = "1.5.1"
5157version = "1.5.1"
blue-ci-cd.yml +214 −18
@@ -1,19 +1,34 @@
1 # Upstream-volgbranch voor deze fork.
1 # CI voor deze fork op git.kvt.nl (BlueGit).
2 2 #
3 # Haalt branch `main` op van het oorspronkelijke project op GitHub en zet die
4 # geforceerd op branch `upstream-master` in deze repository. `upstream-master`
5 # is een pure volgbranch: lokale commits daarop worden overschreven.
3 # 1. sync-upstream (ongewijzigd): haalt branch `main` op van het oorspronkelijke
4 # project op GitHub en zet die geforceerd op branch `upstream-master`.
5 # `upstream-master` is een pure volgbranch: lokale commits daarop worden
6 # overschreven. Draait alleen bij een handmatige, API- of geplande start
7 # (knop "Run pipeline" op master, of
8 # POST /api/v1/projects/ict/rusty-teams/pipelines {"ref": "master"}),
9 # nooit bij een push, tag of merge request.
10 # 2. Controle bij een merge request of push: kvt_test (de KVT-crate en
11 # -scripts, snel), aur_check (PKGBUILD en .SRCINFO in Arch) en app_test
12 # (bouwt app-base en app en draait de updatertests; alleen als Rust-code of
13 # Cargo-bestanden veranderen).
14 # 3. Release bij een tag v* (schema v<versie>-kvt.<n>, bijvoorbeeld v0.6.1-kvt.1):
15 # linux_release Linux-binary + FHS-tarball (packaging/linux/package.sh)
16 # windows_release teams.exe, cross-build met cargo-xwin en fxc onder wine
17 # (allow_failure: zonder exe gaat de release door)
18 # checksums SHA256SUMS van alle assets
19 # release maakt de release op git.kvt.nl met de assets
20 # publish_aur AUR-pakket kvt-rusty-teams-bin (allow_failure; slaat
21 # zichzelf over zonder AUR-geheim)
22 # De app leest die release (crates/kvt-update) en werkt zichzelf bij, behalve
23 # in het AUR-pakket. Zie packaging/kvt/README.md.
6 24 #
7 # BlueGit kent (nog) geen geplande pipelines. Start deze pipeline handmatig
8 # (knop "Run pipeline" op master) of extern via
9 # POST /api/v1/projects/ict/rusty-teams/pipelines {"ref": "master"}
10 # Bij een gewone push of merge request draait er niets.
11 #
12 # Pushen gebeurt met het beschermde repositorygeheim UPSTREAM_PUSH_BOT_TOKEN
13 # (of anders UPSTREAM_PUSH_TOKEN): een BlueGit-access token met scope
14 # write_repository. Het job-token (CI_JOB_TOKEN) mag
15 # niet pushen en is alleen een terugval. Beschermde geheimen komen alleen mee
16 # op beschermde branches, zoals master.
25 # Geheimen (repository ict/rusty-teams of groep ict, beschermd):
26 # UPSTREAM_PUSH_BOT_TOKEN (of UPSTREAM_PUSH_TOKEN) sync-upstream
27 # AUR_SSH_PRIVATE_KEY of AUR_SSH_PRIVATE_KEY_B64 publish_aur
28 # AUR_GIT_AUTHOR_NAME, AUR_GIT_AUTHOR_EMAIL publish_aur
29 # Beschermde geheimen komen alleen mee op een beschermde branch of tag: bescherm
30 # het tagpatroon v*. De release zelf gebruikt alleen CI_JOB_TOKEN; wie de tag
31 # pusht moet maintainer zijn.
17 32 # Zet nooit een token in deze (publieke) repository. `upstream-master` mag
18 33 # beschermd zijn: het pushtoken hoort bij een account met beheerrechten.
19 34 #
@@ -22,12 +37,13 @@
22 37
23 38 workflow:
24 39 rules:
25 - if: $CI_PIPELINE_SOURCE == "push"
26 when: never
27 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
40 # upstream-master heeft geen blue-ci-cd.yml; voor de zekerheid.
41 - if: $CI_COMMIT_BRANCH == "upstream-master"
28 42 when: never
29 43 - when: always
30 44
45 stages: [sync, test, build, package, release]
46
31 47 variables:
32 48 UPSTREAM_URL: "https://github.com/danieldaeschle/rusty-teams.git"
33 49 UPSTREAM_BRANCH: "main"
@@ -35,6 +51,13 @@ variables:
35 51
36 52 sync-upstream:
37 53 stage: sync
54 # Alleen handmatig, via de API of gepland; nooit bij push, tag of merge request.
55 rules:
56 - if: $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event"
57 when: never
58 - if: $CI_COMMIT_TAG != null
59 when: never
60 - when: always
38 61 image: bluegit/base
39 62 resource_group: upstream-sync
40 63 timeout: 15m
@@ -70,4 +93,177 @@ sync-upstream:
70 93 push --force "$CI_PROJECT_URL.git" "refs/heads/$UPSTREAM_BRANCH:refs/heads/$TARGET_BRANCH"
71 94 echo "$TARGET_BRANCH staat nu op $(git rev-parse "refs/heads/$UPSTREAM_BRANCH")"
72 95
73 stages: [sync]
96
97 # ---------------------------------------------------------------------------
98 # KVT: controle, release, AUR. Alles hieronder staat los van sync-upstream.
99 # ---------------------------------------------------------------------------
100
101 .kvt_check:
102 rules:
103 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
104 - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != null
105 - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v[0-9]/
106
107 .kvt_tag:
108 rules:
109 - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v[0-9]/
110
111 # De KVT-crate (BlueGit-releasefeed, versies, assetnamen, pakketbeheer-vlag) en
112 # de scripts in packaging/kvt. Klein en snel.
113 kvt_test:
114 stage: test
115 image: rust:1-bookworm
116 extends: .kvt_check
117 needs: []
118 timeout: 30m
119 script:
120 - apt-get update -qq && apt-get install -y -qq --no-install-recommends clang mold >/dev/null
121 - cargo test -p kvt-update --locked
122 - for f in packaging/kvt/*.sh; do bash -n "$f"; done
123 - packaging/kvt/tests.sh
124
125 # PKGBUILD renderen en .SRCINFO maken op Arch, zoals publish_aur dat doet.
126 aur_check:
127 stage: test
128 image: archlinux/archlinux:base-devel
129 extends: .kvt_check
130 needs: []
131 timeout: 20m
132 script:
133 - |
134 set -eu
135 useradd --create-home aurcheck
136 out="$(mktemp -d)"
137 packaging/kvt/publish-aur.sh --render v0.0.1-kvt.1 "$(printf '0%.0s' $(seq 64))" "$out"
138 chown -R aurcheck "$out"
139 (cd "$out" && runuser -u aurcheck -- makepkg --printsrcinfo > .SRCINFO)
140 cat "$out/.SRCINFO"
141 grep -qP '^\tprovides = rusty-teams$' "$out/.SRCINFO"
142 grep -qP '^\tconflicts = rusty-teams$' "$out/.SRCINFO"
143 grep -q 'source = rusty-teams-0.0.1-kvt.1-linux-x86_64.tar.gz::https://git.kvt.nl/' "$out/.SRCINFO"
144 grep -qP '^\tpkgver = 0\.0\.1\.kvt\.1$' "$out/.SRCINFO"
145
146 # Bouwt app-base en app en draait de updatertests (release_feed, kvt_feed).
147 # Alleen als Rust-code of Cargo-bestanden veranderen; zwaar (volledige build).
148 app_test:
149 stage: test
150 image: ubuntu:22.04
151 needs: []
152 timeout: 120m
153 rules:
154 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
155 changes: [crates/**/*, vendor/**/*, Cargo.toml, Cargo.lock, .cargo/**/*, blue-ci-cd.yml]
156 - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != null
157 changes: [crates/**/*, vendor/**/*, Cargo.toml, Cargo.lock, .cargo/**/*, blue-ci-cd.yml]
158 variables:
159 CC: clang-21
160 CXX: clang++-21
161 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang-21
162 script:
163 - packaging/kvt/ci-setup.sh linux
164 - . "$HOME/.cargo/env"
165 - cargo test --locked -p app-base --lib -- release_feed kvt_feed updater
166 - cargo check --locked -p app
167
168 # Linux: release-build met de tag als versie (TEAMS_RELEASE_TAG via build.rs),
169 # daarna de FHS-tarball van packaging/linux/package.sh. Vaste artifactnamen;
170 # de release geeft ze hun versienaam (packaging/kvt/release-assets.sh).
171 linux_release:
172 stage: build
173 image: ubuntu:22.04
174 extends: .kvt_tag
175 needs: [kvt_test, aur_check]
176 timeout: 150m
177 variables:
178 CC: clang-21
179 CXX: clang++-21
180 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang-21
181 script:
182 - packaging/kvt/ci-setup.sh linux
183 - . "$HOME/.cargo/env"
184 - export GITHUB_REF_NAME="$CI_COMMIT_TAG" GITHUB_REF_TYPE=tag RUSTY_TEAMS_VERSION="$CI_COMMIT_TAG"
185 - export RUSTY_TEAMS_MAINTAINER="KVT ICT <hephaestus@noreply.kvt.nl>"
186 - cargo build -p app --release --locked
187 - DIST="$PWD/dist/release" packaging/linux/package.sh --skip-build --formats tar
188 - mkdir -p dist/kvt
189 - cp "dist/release/rusty-teams-${CI_COMMIT_TAG#v}-linux-x86_64.tar.gz" dist/kvt/linux-x86_64.tar.gz
190 - install -m755 target/release/teams dist/kvt/teams-linux-amd64
191 - strip dist/kvt/teams-linux-amd64
192 - grep -aq "$CI_COMMIT_TAG" dist/kvt/teams-linux-amd64
193 - ls -la dist/kvt
194 artifacts:
195 paths:
196 - dist/kvt/teams-linux-amd64
197 - dist/kvt/linux-x86_64.tar.gz
198 expire_in: 7d
199
200 # Windows x86_64: cross-build vanuit Linux (packaging/kvt/build-windows.sh).
201 # allow_failure: mislukt hij, dan krijgt de release geen exe en biedt een
202 # Windows-installatie die versie niet aan; Linux en AUR gaan door.
203 windows_release:
204 stage: build
205 image: ubuntu:24.04
206 extends: .kvt_tag
207 needs: [kvt_test]
208 allow_failure: true
209 timeout: 180m
210 variables:
211 CC: clang-21
212 CXX: clang++-21
213 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang-21
214 XWIN_ACCEPT_LICENSE: "1"
215 script:
216 - packaging/kvt/ci-setup.sh windows
217 - . "$HOME/.cargo/env"
218 - export GITHUB_REF_NAME="$CI_COMMIT_TAG" GITHUB_REF_TYPE=tag
219 - packaging/kvt/build-windows.sh
220 - mkdir -p dist/kvt
221 - cp target/x86_64-pc-windows-msvc/release/teams.exe dist/kvt/teams-windows-amd64.exe
222 - head -c 2 dist/kvt/teams-windows-amd64.exe | grep -q MZ
223 - grep -aq "$CI_COMMIT_TAG" dist/kvt/teams-windows-amd64.exe
224 - ls -la dist/kvt
225 artifacts:
226 paths:
227 - dist/kvt/teams-windows-amd64.exe
228 expire_in: 7d
229
230 checksums:
231 stage: package
232 image: bluegit/base
233 extends: .kvt_tag
234 needs: [linux_release, windows_release]
235 script:
236 - packaging/kvt/release-assets.sh sums "$CI_COMMIT_TAG"
237 artifacts:
238 paths:
239 - dist/kvt/SHA256SUMS
240 expire_in: 7d
241
242 # Publiceert de release op de bestaande tag (create-only; de tag blijft staan).
243 # Alleen een tag-pipeline van een maintainer mag dit met CI_JOB_TOKEN.
244 release:
245 stage: release
246 image: bluegit/base
247 extends: .kvt_tag
248 needs: [checksums, linux_release, windows_release]
249 script:
250 - packaging/kvt/release-assets.sh json "$CI_COMMIT_TAG" "$CI_COMMIT_SHA" > release.json
251 - cat release.json
252 - |
253 curl -fsS -X POST "$CI_API_URL/repos/$CI_PROJECT_PATH/releases/$CI_COMMIT_TAG/assets" \
254 -H "Authorization: Bearer $CI_JOB_TOKEN" \
255 -H "Content-Type: application/json" \
256 --data-binary @release.json
257
258 # AUR-pakket kvt-rusty-teams-bin, zelfde aanpak en geheimen als BlueGit's
259 # publish_aur. Zonder AUR-geheim meldt hij dat en eindigt hij groen.
260 publish_aur:
261 stage: release
262 image: archlinux/archlinux:base-devel
263 extends: .kvt_tag
264 needs: [release]
265 allow_failure: true
266 script:
267 - pacman -Syu --noconfirm >/dev/null
268 - pacman -S --noconfirm --needed git openssh curl coreutils shadow util-linux >/dev/null
269 - packaging/kvt/publish-aur.sh "$CI_COMMIT_TAG"
@@ -1,19 +1,34 @@
1# Upstream-volgbranch voor deze fork.
1# CI voor deze fork op git.kvt.nl (BlueGit).
2#
2#
3# Haalt branch `main` op van het oorspronkelijke project op GitHub en zet die
3# 1. sync-upstream (ongewijzigd): haalt branch `main` op van het oorspronkelijke
4# geforceerd op branch `upstream-master` in deze repository. `upstream-master`
4# project op GitHub en zet die geforceerd op branch `upstream-master`.
5# is een pure volgbranch: lokale commits daarop worden overschreven.
5# `upstream-master` is een pure volgbranch: lokale commits daarop worden
6# overschreven. Draait alleen bij een handmatige, API- of geplande start
7# (knop "Run pipeline" op master, of
8# POST /api/v1/projects/ict/rusty-teams/pipelines {"ref": "master"}),
9# nooit bij een push, tag of merge request.
10# 2. Controle bij een merge request of push: kvt_test (de KVT-crate en
11# -scripts, snel), aur_check (PKGBUILD en .SRCINFO in Arch) en app_test
12# (bouwt app-base en app en draait de updatertests; alleen als Rust-code of
13# Cargo-bestanden veranderen).
14# 3. Release bij een tag v* (schema v<versie>-kvt.<n>, bijvoorbeeld v0.6.1-kvt.1):
15# linux_release Linux-binary + FHS-tarball (packaging/linux/package.sh)
16# windows_release teams.exe, cross-build met cargo-xwin en fxc onder wine
17# (allow_failure: zonder exe gaat de release door)
18# checksums SHA256SUMS van alle assets
19# release maakt de release op git.kvt.nl met de assets
20# publish_aur AUR-pakket kvt-rusty-teams-bin (allow_failure; slaat
21# zichzelf over zonder AUR-geheim)
22# De app leest die release (crates/kvt-update) en werkt zichzelf bij, behalve
23# in het AUR-pakket. Zie packaging/kvt/README.md.
6#
24#
7# BlueGit kent (nog) geen geplande pipelines. Start deze pipeline handmatig
25# Geheimen (repository ict/rusty-teams of groep ict, beschermd):
8# (knop "Run pipeline" op master) of extern via
26# UPSTREAM_PUSH_BOT_TOKEN (of UPSTREAM_PUSH_TOKEN) sync-upstream
9# POST /api/v1/projects/ict/rusty-teams/pipelines {"ref": "master"}
27# AUR_SSH_PRIVATE_KEY of AUR_SSH_PRIVATE_KEY_B64 publish_aur
10# Bij een gewone push of merge request draait er niets.
28# AUR_GIT_AUTHOR_NAME, AUR_GIT_AUTHOR_EMAIL publish_aur
11#
29# Beschermde geheimen komen alleen mee op een beschermde branch of tag: bescherm
12# Pushen gebeurt met het beschermde repositorygeheim UPSTREAM_PUSH_BOT_TOKEN
30# het tagpatroon v*. De release zelf gebruikt alleen CI_JOB_TOKEN; wie de tag
13# (of anders UPSTREAM_PUSH_TOKEN): een BlueGit-access token met scope
31# pusht moet maintainer zijn.
14# write_repository. Het job-token (CI_JOB_TOKEN) mag
15# niet pushen en is alleen een terugval. Beschermde geheimen komen alleen mee
16# op beschermde branches, zoals master.
17# Zet nooit een token in deze (publieke) repository. `upstream-master` mag
32# Zet nooit een token in deze (publieke) repository. `upstream-master` mag
18# beschermd zijn: het pushtoken hoort bij een account met beheerrechten.
33# beschermd zijn: het pushtoken hoort bij een account met beheerrechten.
19#
34#
@@ -22,12 +37,13 @@
22
37
23workflow:
38workflow:
24 rules:
39 rules:
25 - if: $CI_PIPELINE_SOURCE == "push"
40 # upstream-master heeft geen blue-ci-cd.yml; voor de zekerheid.
26 when: never
41 - if: $CI_COMMIT_BRANCH == "upstream-master"
27 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
28 when: never
42 when: never
29 - when: always
43 - when: always
30
44
45stages: [sync, test, build, package, release]
46
31variables:
47variables:
32 UPSTREAM_URL: "https://github.com/danieldaeschle/rusty-teams.git"
48 UPSTREAM_URL: "https://github.com/danieldaeschle/rusty-teams.git"
33 UPSTREAM_BRANCH: "main"
49 UPSTREAM_BRANCH: "main"
@@ -35,6 +51,13 @@ variables:
35
51
36sync-upstream:
52sync-upstream:
37 stage: sync
53 stage: sync
54 # Alleen handmatig, via de API of gepland; nooit bij push, tag of merge request.
55 rules:
56 - if: $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event"
57 when: never
58 - if: $CI_COMMIT_TAG != null
59 when: never
60 - when: always
38 image: bluegit/base
61 image: bluegit/base
39 resource_group: upstream-sync
62 resource_group: upstream-sync
40 timeout: 15m
63 timeout: 15m
@@ -70,4 +93,177 @@ sync-upstream:
70 push --force "$CI_PROJECT_URL.git" "refs/heads/$UPSTREAM_BRANCH:refs/heads/$TARGET_BRANCH"
93 push --force "$CI_PROJECT_URL.git" "refs/heads/$UPSTREAM_BRANCH:refs/heads/$TARGET_BRANCH"
71 echo "$TARGET_BRANCH staat nu op $(git rev-parse "refs/heads/$UPSTREAM_BRANCH")"
94 echo "$TARGET_BRANCH staat nu op $(git rev-parse "refs/heads/$UPSTREAM_BRANCH")"
72
95
73stages: [sync]
96
97# ---------------------------------------------------------------------------
98# KVT: controle, release, AUR. Alles hieronder staat los van sync-upstream.
99# ---------------------------------------------------------------------------
100
101.kvt_check:
102 rules:
103 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
104 - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != null
105 - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v[0-9]/
106
107.kvt_tag:
108 rules:
109 - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG =~ /^v[0-9]/
110
111# De KVT-crate (BlueGit-releasefeed, versies, assetnamen, pakketbeheer-vlag) en
112# de scripts in packaging/kvt. Klein en snel.
113kvt_test:
114 stage: test
115 image: rust:1-bookworm
116 extends: .kvt_check
117 needs: []
118 timeout: 30m
119 script:
120 - apt-get update -qq && apt-get install -y -qq --no-install-recommends clang mold >/dev/null
121 - cargo test -p kvt-update --locked
122 - for f in packaging/kvt/*.sh; do bash -n "$f"; done
123 - packaging/kvt/tests.sh
124
125# PKGBUILD renderen en .SRCINFO maken op Arch, zoals publish_aur dat doet.
126aur_check:
127 stage: test
128 image: archlinux/archlinux:base-devel
129 extends: .kvt_check
130 needs: []
131 timeout: 20m
132 script:
133 - |
134 set -eu
135 useradd --create-home aurcheck
136 out="$(mktemp -d)"
137 packaging/kvt/publish-aur.sh --render v0.0.1-kvt.1 "$(printf '0%.0s' $(seq 64))" "$out"
138 chown -R aurcheck "$out"
139 (cd "$out" && runuser -u aurcheck -- makepkg --printsrcinfo > .SRCINFO)
140 cat "$out/.SRCINFO"
141 grep -qP '^\tprovides = rusty-teams$' "$out/.SRCINFO"
142 grep -qP '^\tconflicts = rusty-teams$' "$out/.SRCINFO"
143 grep -q 'source = rusty-teams-0.0.1-kvt.1-linux-x86_64.tar.gz::https://git.kvt.nl/' "$out/.SRCINFO"
144 grep -qP '^\tpkgver = 0\.0\.1\.kvt\.1$' "$out/.SRCINFO"
145
146# Bouwt app-base en app en draait de updatertests (release_feed, kvt_feed).
147# Alleen als Rust-code of Cargo-bestanden veranderen; zwaar (volledige build).
148app_test:
149 stage: test
150 image: ubuntu:22.04
151 needs: []
152 timeout: 120m
153 rules:
154 - if: $CI_PIPELINE_SOURCE == "merge_request_event"
155 changes: [crates/**/*, vendor/**/*, Cargo.toml, Cargo.lock, .cargo/**/*, blue-ci-cd.yml]
156 - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != null
157 changes: [crates/**/*, vendor/**/*, Cargo.toml, Cargo.lock, .cargo/**/*, blue-ci-cd.yml]
158 variables:
159 CC: clang-21
160 CXX: clang++-21
161 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang-21
162 script:
163 - packaging/kvt/ci-setup.sh linux
164 - . "$HOME/.cargo/env"
165 - cargo test --locked -p app-base --lib -- release_feed kvt_feed updater
166 - cargo check --locked -p app
167
168# Linux: release-build met de tag als versie (TEAMS_RELEASE_TAG via build.rs),
169# daarna de FHS-tarball van packaging/linux/package.sh. Vaste artifactnamen;
170# de release geeft ze hun versienaam (packaging/kvt/release-assets.sh).
171linux_release:
172 stage: build
173 image: ubuntu:22.04
174 extends: .kvt_tag
175 needs: [kvt_test, aur_check]
176 timeout: 150m
177 variables:
178 CC: clang-21
179 CXX: clang++-21
180 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang-21
181 script:
182 - packaging/kvt/ci-setup.sh linux
183 - . "$HOME/.cargo/env"
184 - export GITHUB_REF_NAME="$CI_COMMIT_TAG" GITHUB_REF_TYPE=tag RUSTY_TEAMS_VERSION="$CI_COMMIT_TAG"
185 - export RUSTY_TEAMS_MAINTAINER="KVT ICT <hephaestus@noreply.kvt.nl>"
186 - cargo build -p app --release --locked
187 - DIST="$PWD/dist/release" packaging/linux/package.sh --skip-build --formats tar
188 - mkdir -p dist/kvt
189 - cp "dist/release/rusty-teams-${CI_COMMIT_TAG#v}-linux-x86_64.tar.gz" dist/kvt/linux-x86_64.tar.gz
190 - install -m755 target/release/teams dist/kvt/teams-linux-amd64
191 - strip dist/kvt/teams-linux-amd64
192 - grep -aq "$CI_COMMIT_TAG" dist/kvt/teams-linux-amd64
193 - ls -la dist/kvt
194 artifacts:
195 paths:
196 - dist/kvt/teams-linux-amd64
197 - dist/kvt/linux-x86_64.tar.gz
198 expire_in: 7d
199
200# Windows x86_64: cross-build vanuit Linux (packaging/kvt/build-windows.sh).
201# allow_failure: mislukt hij, dan krijgt de release geen exe en biedt een
202# Windows-installatie die versie niet aan; Linux en AUR gaan door.
203windows_release:
204 stage: build
205 image: ubuntu:24.04
206 extends: .kvt_tag
207 needs: [kvt_test]
208 allow_failure: true
209 timeout: 180m
210 variables:
211 CC: clang-21
212 CXX: clang++-21
213 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang-21
214 XWIN_ACCEPT_LICENSE: "1"
215 script:
216 - packaging/kvt/ci-setup.sh windows
217 - . "$HOME/.cargo/env"
218 - export GITHUB_REF_NAME="$CI_COMMIT_TAG" GITHUB_REF_TYPE=tag
219 - packaging/kvt/build-windows.sh
220 - mkdir -p dist/kvt
221 - cp target/x86_64-pc-windows-msvc/release/teams.exe dist/kvt/teams-windows-amd64.exe
222 - head -c 2 dist/kvt/teams-windows-amd64.exe | grep -q MZ
223 - grep -aq "$CI_COMMIT_TAG" dist/kvt/teams-windows-amd64.exe
224 - ls -la dist/kvt
225 artifacts:
226 paths:
227 - dist/kvt/teams-windows-amd64.exe
228 expire_in: 7d
229
230checksums:
231 stage: package
232 image: bluegit/base
233 extends: .kvt_tag
234 needs: [linux_release, windows_release]
235 script:
236 - packaging/kvt/release-assets.sh sums "$CI_COMMIT_TAG"
237 artifacts:
238 paths:
239 - dist/kvt/SHA256SUMS
240 expire_in: 7d
241
242# Publiceert de release op de bestaande tag (create-only; de tag blijft staan).
243# Alleen een tag-pipeline van een maintainer mag dit met CI_JOB_TOKEN.
244release:
245 stage: release
246 image: bluegit/base
247 extends: .kvt_tag
248 needs: [checksums, linux_release, windows_release]
249 script:
250 - packaging/kvt/release-assets.sh json "$CI_COMMIT_TAG" "$CI_COMMIT_SHA" > release.json
251 - cat release.json
252 - |
253 curl -fsS -X POST "$CI_API_URL/repos/$CI_PROJECT_PATH/releases/$CI_COMMIT_TAG/assets" \
254 -H "Authorization: Bearer $CI_JOB_TOKEN" \
255 -H "Content-Type: application/json" \
256 --data-binary @release.json
257
258# AUR-pakket kvt-rusty-teams-bin, zelfde aanpak en geheimen als BlueGit's
259# publish_aur. Zonder AUR-geheim meldt hij dat en eindigt hij groen.
260publish_aur:
261 stage: release
262 image: archlinux/archlinux:base-devel
263 extends: .kvt_tag
264 needs: [release]
265 allow_failure: true
266 script:
267 - pacman -Syu --noconfirm >/dev/null
268 - pacman -S --noconfirm --needed git openssh curl coreutils shadow util-linux >/dev/null
269 - packaging/kvt/publish-aur.sh "$CI_COMMIT_TAG"
crates/app-base/Cargo.toml +1 −0
@@ -26,6 +26,7 @@ session.workspace = true
26 26 store.workspace = true
27 27 teams-core.workspace = true
28 28 tokio.workspace = true
29 kvt-update = { path = "../kvt-update" }
29 30 image = { version = "0.25", default-features = false, features = ["bmp", "gif", "ico", "jpeg", "png", "webp"] }
30 31 raw-window-handle = "0.6"
31 32 sha2 = "0.10"
@@ -26,6 +26,7 @@ session.workspace = true
26store.workspace = true
26store.workspace = true
27teams-core.workspace = true
27teams-core.workspace = true
28tokio.workspace = true
28tokio.workspace = true
29kvt-update = { path = "../kvt-update" }
29image = { version = "0.25", default-features = false, features = ["bmp", "gif", "ico", "jpeg", "png", "webp"] }
30image = { version = "0.25", default-features = false, features = ["bmp", "gif", "ico", "jpeg", "png", "webp"] }
30raw-window-handle = "0.6"
31raw-window-handle = "0.6"
31sha2 = "0.10"
32sha2 = "0.10"
crates/app-base/src/kvt_feed.rs added +94 −0
@@ -0,0 +1,94 @@
1 //! KVT fork only: the updater reads the releases of `ict/rusty-teams` on git.kvt.nl
2 //! instead of GitHub. The BlueGit-specific parsing lives in `crates/kvt-update`; this
3 //! file only fetches and fills upstream's `Release` structs, so `release_feed.rs`
4 //! needs two call sites changed and nothing else.
5
6 use std::collections::HashMap;
7
8 use crate::release_feed::{self, HttpClient, Release, ReleaseAsset};
9
10 /// The AUR package and any other system package update through the package manager.
11 pub fn package_managed() -> bool {
12 kvt_update::package_managed()
13 }
14
15 pub(crate) fn release_page_url(tag: &str) -> String {
16 kvt_update::release_page_url(tag)
17 }
18
19 fn to_release(
20 release: &kvt_update::BlueGitRelease,
21 checksums: &HashMap<String, String>,
22 ) -> Release {
23 let shaped = kvt_update::to_github(release, checksums);
24 Release {
25 tag_name: shaped.tag_name,
26 draft: shaped.draft,
27 prerelease: shaped.prerelease,
28 assets: shaped
29 .assets
30 .into_iter()
31 .map(|asset| ReleaseAsset {
32 name: asset.name,
33 browser_download_url: asset.browser_download_url,
34 size: asset.size,
35 digest: asset.digest,
36 })
37 .collect(),
38 }
39 }
40
41 /// The releases on git.kvt.nl. Only releases newer than `running_tag` get their
42 /// `SHA256SUMS` fetched: those are the only ones the updater can install, and an
43 /// asset without a digest is refused by `verify_download`.
44 pub(crate) async fn releases(
45 client: &HttpClient,
46 running_tag: &str,
47 ) -> Result<Vec<Release>, String> {
48 let list = release_feed::get(client, &kvt_update::releases_url(), None).await?;
49 let list = kvt_update::parse_releases(&list)?;
50 let mut releases = Vec::with_capacity(list.len());
51 for release in &list {
52 let mut checksums = HashMap::new();
53 if release_feed::is_newer(&release.tag, running_tag) && release.has_checksums() {
54 match release_feed::get(client, &release.checksums_url(), None).await {
55 Ok(bytes) => {
56 checksums = kvt_update::parse_checksums(&String::from_utf8_lossy(&bytes))
57 }
58 Err(error) => log::warn!("{}: SHA256SUMS: {error}", release.tag),
59 }
60 }
61 releases.push(to_release(release, &checksums));
62 }
63 Ok(releases)
64 }
65
66 #[cfg(test)]
67 mod tests {
68 use super::*;
69
70 #[test]
71 fn a_bluegit_release_becomes_an_installable_upstream_release() {
72 let list = kvt_update::parse_releases(
73 br#"[{"tag":"v0.6.1-kvt.2","assets":[{"name":"SHA256SUMS","size":1},{"name":"rusty-teams-0.6.1-kvt.2-linux-amd64","size":4},{"name":"rusty-teams-0.6.1-kvt.2-windows-amd64.exe","size":2}]}]"#,
74 )
75 .unwrap();
76 let mut sums = HashMap::new();
77 for asset in &list[0].assets {
78 sums.insert(asset.name.clone(), "ab".repeat(32));
79 }
80 let releases = vec![to_release(&list[0], &sums)];
81 let (release, asset) = release_feed::newest_update("v0.6.1-kvt.1", &releases).unwrap();
82 assert_eq!(release.tag_name, "v0.6.1-kvt.2");
83 assert!(
84 asset
85 .digest
86 .as_deref()
87 .is_some_and(|d| d.starts_with("sha256:"))
88 );
89 assert!(asset.browser_download_url.starts_with(
90 "https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases/v0.6.1-kvt.2/assets/"
91 ));
92 assert!(release_feed::newest_update("v0.6.1-kvt.2", &releases).is_none());
93 }
94 }
@@ -0,0 +1,94 @@
1//! KVT fork only: the updater reads the releases of `ict/rusty-teams` on git.kvt.nl
2//! instead of GitHub. The BlueGit-specific parsing lives in `crates/kvt-update`; this
3//! file only fetches and fills upstream's `Release` structs, so `release_feed.rs`
4//! needs two call sites changed and nothing else.
5
6use std::collections::HashMap;
7
8use crate::release_feed::{self, HttpClient, Release, ReleaseAsset};
9
10/// The AUR package and any other system package update through the package manager.
11pub fn package_managed() -> bool {
12 kvt_update::package_managed()
13}
14
15pub(crate) fn release_page_url(tag: &str) -> String {
16 kvt_update::release_page_url(tag)
17}
18
19fn to_release(
20 release: &kvt_update::BlueGitRelease,
21 checksums: &HashMap<String, String>,
22) -> Release {
23 let shaped = kvt_update::to_github(release, checksums);
24 Release {
25 tag_name: shaped.tag_name,
26 draft: shaped.draft,
27 prerelease: shaped.prerelease,
28 assets: shaped
29 .assets
30 .into_iter()
31 .map(|asset| ReleaseAsset {
32 name: asset.name,
33 browser_download_url: asset.browser_download_url,
34 size: asset.size,
35 digest: asset.digest,
36 })
37 .collect(),
38 }
39}
40
41/// The releases on git.kvt.nl. Only releases newer than `running_tag` get their
42/// `SHA256SUMS` fetched: those are the only ones the updater can install, and an
43/// asset without a digest is refused by `verify_download`.
44pub(crate) async fn releases(
45 client: &HttpClient,
46 running_tag: &str,
47) -> Result<Vec<Release>, String> {
48 let list = release_feed::get(client, &kvt_update::releases_url(), None).await?;
49 let list = kvt_update::parse_releases(&list)?;
50 let mut releases = Vec::with_capacity(list.len());
51 for release in &list {
52 let mut checksums = HashMap::new();
53 if release_feed::is_newer(&release.tag, running_tag) && release.has_checksums() {
54 match release_feed::get(client, &release.checksums_url(), None).await {
55 Ok(bytes) => {
56 checksums = kvt_update::parse_checksums(&String::from_utf8_lossy(&bytes))
57 }
58 Err(error) => log::warn!("{}: SHA256SUMS: {error}", release.tag),
59 }
60 }
61 releases.push(to_release(release, &checksums));
62 }
63 Ok(releases)
64}
65
66#[cfg(test)]
67mod tests {
68 use super::*;
69
70 #[test]
71 fn a_bluegit_release_becomes_an_installable_upstream_release() {
72 let list = kvt_update::parse_releases(
73 br#"[{"tag":"v0.6.1-kvt.2","assets":[{"name":"SHA256SUMS","size":1},{"name":"rusty-teams-0.6.1-kvt.2-linux-amd64","size":4},{"name":"rusty-teams-0.6.1-kvt.2-windows-amd64.exe","size":2}]}]"#,
74 )
75 .unwrap();
76 let mut sums = HashMap::new();
77 for asset in &list[0].assets {
78 sums.insert(asset.name.clone(), "ab".repeat(32));
79 }
80 let releases = vec![to_release(&list[0], &sums)];
81 let (release, asset) = release_feed::newest_update("v0.6.1-kvt.1", &releases).unwrap();
82 assert_eq!(release.tag_name, "v0.6.1-kvt.2");
83 assert!(
84 asset
85 .digest
86 .as_deref()
87 .is_some_and(|d| d.starts_with("sha256:"))
88 );
89 assert!(asset.browser_download_url.starts_with(
90 "https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases/v0.6.1-kvt.2/assets/"
91 ));
92 assert!(release_feed::newest_update("v0.6.1-kvt.2", &releases).is_none());
93 }
94}
crates/app-base/src/lib.rs +1 −0
@@ -22,6 +22,7 @@ pub mod fuzzy;
22 22 pub mod image_clipboard;
23 23 pub mod image_view_math;
24 24 pub mod inline_image;
25 pub mod kvt_feed;
25 26 #[cfg(target_os = "linux")]
26 27 pub mod linux_desktop;
27 28 #[cfg(target_os = "linux")]
@@ -22,6 +22,7 @@ pub mod fuzzy;
22pub mod image_clipboard;
22pub mod image_clipboard;
23pub mod image_view_math;
23pub mod image_view_math;
24pub mod inline_image;
24pub mod inline_image;
25pub mod kvt_feed;
25#[cfg(target_os = "linux")]
26#[cfg(target_os = "linux")]
26pub mod linux_desktop;
27pub mod linux_desktop;
27#[cfg(target_os = "linux")]
28#[cfg(target_os = "linux")]
crates/app-base/src/release_feed.rs +25 −13
@@ -17,6 +17,8 @@ use crate::updater::UpdatePaths;
17 17
18 18 pub const FIRST_CHECK_DELAY: Duration = Duration::from_secs(60);
19 19 pub const CHECK_INTERVAL: Duration = Duration::from_secs(6 * 60 * 60);
20 // KVT: unused, kvt_feed reads git.kvt.nl.
21 #[allow(dead_code)]
20 22 const RELEASES_URL: &str =
21 23 "https://api.github.com/repos/danieldaeschle/rusty-teams/releases?per_page=10";
22 24 /// The release asset this platform installs, and the magic bytes it must start with.
@@ -134,11 +136,13 @@ pub fn is_newer(tag: &str, running_tag: &str) -> bool {
134 136 )
135 137 }
136 138
139 // KVT: unused, the page is on git.kvt.nl (kvt_feed).
140 #[allow(dead_code)]
137 141 const RELEASE_PAGE: &str = "https://github.com/danieldaeschle/rusty-teams/releases/tag/";
138 142
139 143 /// The GitHub page for one tag. Installs that must not replace themselves open this.
140 144 pub fn release_page_url(tag: &str) -> String {
141 format!("{RELEASE_PAGE}{tag}")
145 crate::kvt_feed::release_page_url(tag)
142 146 }
143 147
144 148 /// A newer tag, even when this platform has no installable asset.
@@ -245,10 +249,10 @@ pub struct AvailableUpdate {
245 249 pub asset: ReleaseAsset,
246 250 }
247 251
248 type HttpClient = std::sync::Arc<dyn gpui_kit::http_client::HttpClient>;
252 pub(crate) type HttpClient = std::sync::Arc<dyn gpui_kit::http_client::HttpClient>;
249 253
250 254 /// GETs `url`. `progress` counts the body bytes as they arrive.
251 async fn get(
255 pub(crate) async fn get(
252 256 client: &HttpClient,
253 257 url: &str,
254 258 progress: Option<&AtomicU64>,
@@ -285,12 +289,12 @@ pub fn find_release(
285 289 ) -> Task<Result<Option<TaggedRelease>, String>> {
286 290 let client = cx.http_client();
287 291 cx.background_executor().spawn(async move {
288 let releases: Vec<Release> =
289 serde_json::from_slice(&get(&client, RELEASES_URL, None).await?)
290 .map_err(|error| error.to_string())?;
291 Ok(newest_release(running_tag, &releases).map(|release| TaggedRelease {
292 tag: release.tag_name.clone(),
293 }))
292 let releases = crate::kvt_feed::releases(&client, running_tag).await?;
293 Ok(
294 newest_release(running_tag, &releases).map(|release| TaggedRelease {
295 tag: release.tag_name.clone(),
296 }),
297 )
294 298 })
295 299 }
296 300
@@ -301,9 +305,7 @@ pub fn find_update(
301 305 ) -> Task<Result<Option<AvailableUpdate>, String>> {
302 306 let client = cx.http_client();
303 307 cx.background_executor().spawn(async move {
304 let releases: Vec<Release> =
305 serde_json::from_slice(&get(&client, RELEASES_URL, None).await?)
306 .map_err(|error| error.to_string())?;
308 let releases = crate::kvt_feed::releases(&client, running_tag).await?;
307 309 Ok(
308 310 newest_update(running_tag, &releases).map(|(release, asset)| AvailableUpdate {
309 311 tag: release.tag_name.clone(),
@@ -451,10 +453,20 @@ mod tests {
451 453 fn the_release_page_is_the_tag_url() {
452 454 assert_eq!(
453 455 release_page_url("v0.5.0"),
454 "https://github.com/danieldaeschle/rusty-teams/releases/tag/v0.5.0"
456 "https://git.kvt.nl/ict/rusty-teams/-/releases#v0.5.0"
455 457 );
456 458 }
457 459
460 /// KVT tags are `v<version>-kvt.<n>`; a build of one follows the next.
461 #[test]
462 fn kvt_tags_order_by_number_and_version() {
463 assert!(is_newer("v0.6.1-kvt.2", "v0.6.1-kvt.1"));
464 assert!(is_newer("v0.6.1-kvt.10", "v0.6.1-kvt.9"));
465 assert!(is_newer("v0.7.0-kvt.1", "v0.6.1-kvt.9"));
466 assert!(!is_newer("v0.6.1-kvt.1", "v0.6.1-kvt.1"));
467 assert!(!is_newer("v0.6.0-kvt.5", "v0.6.1-kvt.1"));
468 }
469
458 470 #[test]
459 471 fn a_download_must_match_size_header_and_digest() {
460 472 let bytes = EXECUTABLE_MAGIC;
@@ -17,6 +17,8 @@ use crate::updater::UpdatePaths;
17
17
18pub const FIRST_CHECK_DELAY: Duration = Duration::from_secs(60);
18pub const FIRST_CHECK_DELAY: Duration = Duration::from_secs(60);
19pub const CHECK_INTERVAL: Duration = Duration::from_secs(6 * 60 * 60);
19pub const CHECK_INTERVAL: Duration = Duration::from_secs(6 * 60 * 60);
20// KVT: unused, kvt_feed reads git.kvt.nl.
21#[allow(dead_code)]
20const RELEASES_URL: &str =
22const RELEASES_URL: &str =
21 "https://api.github.com/repos/danieldaeschle/rusty-teams/releases?per_page=10";
23 "https://api.github.com/repos/danieldaeschle/rusty-teams/releases?per_page=10";
22/// The release asset this platform installs, and the magic bytes it must start with.
24/// The release asset this platform installs, and the magic bytes it must start with.
@@ -134,11 +136,13 @@ pub fn is_newer(tag: &str, running_tag: &str) -> bool {
134 )
136 )
135}
137}
136
138
139// KVT: unused, the page is on git.kvt.nl (kvt_feed).
140#[allow(dead_code)]
137const RELEASE_PAGE: &str = "https://github.com/danieldaeschle/rusty-teams/releases/tag/";
141const RELEASE_PAGE: &str = "https://github.com/danieldaeschle/rusty-teams/releases/tag/";
138
142
139/// The GitHub page for one tag. Installs that must not replace themselves open this.
143/// The GitHub page for one tag. Installs that must not replace themselves open this.
140pub fn release_page_url(tag: &str) -> String {
144pub fn release_page_url(tag: &str) -> String {
141 format!("{RELEASE_PAGE}{tag}")
145 crate::kvt_feed::release_page_url(tag)
142}
146}
143
147
144/// A newer tag, even when this platform has no installable asset.
148/// A newer tag, even when this platform has no installable asset.
@@ -245,10 +249,10 @@ pub struct AvailableUpdate {
245 pub asset: ReleaseAsset,
249 pub asset: ReleaseAsset,
246}
250}
247
251
248type HttpClient = std::sync::Arc<dyn gpui_kit::http_client::HttpClient>;
252pub(crate) type HttpClient = std::sync::Arc<dyn gpui_kit::http_client::HttpClient>;
249
253
250/// GETs `url`. `progress` counts the body bytes as they arrive.
254/// GETs `url`. `progress` counts the body bytes as they arrive.
251async fn get(
255pub(crate) async fn get(
252 client: &HttpClient,
256 client: &HttpClient,
253 url: &str,
257 url: &str,
254 progress: Option<&AtomicU64>,
258 progress: Option<&AtomicU64>,
@@ -285,12 +289,12 @@ pub fn find_release(
285) -> Task<Result<Option<TaggedRelease>, String>> {
289) -> Task<Result<Option<TaggedRelease>, String>> {
286 let client = cx.http_client();
290 let client = cx.http_client();
287 cx.background_executor().spawn(async move {
291 cx.background_executor().spawn(async move {
288 let releases: Vec<Release> =
292 let releases = crate::kvt_feed::releases(&client, running_tag).await?;
289 serde_json::from_slice(&get(&client, RELEASES_URL, None).await?)
293 Ok(
290 .map_err(|error| error.to_string())?;
294 newest_release(running_tag, &releases).map(|release| TaggedRelease {
291 Ok(newest_release(running_tag, &releases).map(|release| TaggedRelease {
295 tag: release.tag_name.clone(),
292 tag: release.tag_name.clone(),
296 }),
293 }))
297 )
294 })
298 })
295}
299}
296
300
@@ -301,9 +305,7 @@ pub fn find_update(
301) -> Task<Result<Option<AvailableUpdate>, String>> {
305) -> Task<Result<Option<AvailableUpdate>, String>> {
302 let client = cx.http_client();
306 let client = cx.http_client();
303 cx.background_executor().spawn(async move {
307 cx.background_executor().spawn(async move {
304 let releases: Vec<Release> =
308 let releases = crate::kvt_feed::releases(&client, running_tag).await?;
305 serde_json::from_slice(&get(&client, RELEASES_URL, None).await?)
306 .map_err(|error| error.to_string())?;
307 Ok(
309 Ok(
308 newest_update(running_tag, &releases).map(|(release, asset)| AvailableUpdate {
310 newest_update(running_tag, &releases).map(|(release, asset)| AvailableUpdate {
309 tag: release.tag_name.clone(),
311 tag: release.tag_name.clone(),
@@ -451,10 +453,20 @@ mod tests {
451 fn the_release_page_is_the_tag_url() {
453 fn the_release_page_is_the_tag_url() {
452 assert_eq!(
454 assert_eq!(
453 release_page_url("v0.5.0"),
455 release_page_url("v0.5.0"),
454 "https://github.com/danieldaeschle/rusty-teams/releases/tag/v0.5.0"
456 "https://git.kvt.nl/ict/rusty-teams/-/releases#v0.5.0"
455 );
457 );
456 }
458 }
457
459
460 /// KVT tags are `v<version>-kvt.<n>`; a build of one follows the next.
461 #[test]
462 fn kvt_tags_order_by_number_and_version() {
463 assert!(is_newer("v0.6.1-kvt.2", "v0.6.1-kvt.1"));
464 assert!(is_newer("v0.6.1-kvt.10", "v0.6.1-kvt.9"));
465 assert!(is_newer("v0.7.0-kvt.1", "v0.6.1-kvt.9"));
466 assert!(!is_newer("v0.6.1-kvt.1", "v0.6.1-kvt.1"));
467 assert!(!is_newer("v0.6.0-kvt.5", "v0.6.1-kvt.1"));
468 }
469
458 #[test]
470 #[test]
459 fn a_download_must_match_size_header_and_digest() {
471 fn a_download_must_match_size_header_and_digest() {
460 let bytes = EXECUTABLE_MAGIC;
472 let bytes = EXECUTABLE_MAGIC;
crates/app/src/linux_update.rs +4 −0
@@ -83,6 +83,10 @@ pub fn set_enabled(enabled: bool, cx: &mut App) {
83 83
84 84 /// Flatpak updates through the package. A build without a release tag does not look.
85 85 pub fn checks_releases() -> bool {
86 // KVT: the AUR package (and any system package) updates through the package manager.
87 if app_base::kvt_feed::package_managed() {
88 return false;
89 }
86 90 #[cfg(target_os = "linux")]
87 91 {
88 92 let flatpak = std::env::var_os("FLATPAK_ID");
@@ -83,6 +83,10 @@ pub fn set_enabled(enabled: bool, cx: &mut App) {
83
83
84/// Flatpak updates through the package. A build without a release tag does not look.
84/// Flatpak updates through the package. A build without a release tag does not look.
85pub fn checks_releases() -> bool {
85pub fn checks_releases() -> bool {
86 // KVT: the AUR package (and any system package) updates through the package manager.
87 if app_base::kvt_feed::package_managed() {
88 return false;
89 }
86 #[cfg(target_os = "linux")]
90 #[cfg(target_os = "linux")]
87 {
91 {
88 let flatpak = std::env::var_os("FLATPAK_ID");
92 let flatpak = std::env::var_os("FLATPAK_ID");
crates/kvt-update/Cargo.toml added +11 −0
@@ -0,0 +1,11 @@
1 [package]
2 name = "kvt-update"
3 description = "KVT fork: release feed of git.kvt.nl for the self-updater, without GPUI."
4 edition.workspace = true
5 version.workspace = true
6 license.workspace = true
7 publish.workspace = true
8
9 [dependencies]
10 serde.workspace = true
11 serde_json.workspace = true
@@ -0,0 +1,11 @@
1[package]
2name = "kvt-update"
3description = "KVT fork: release feed of git.kvt.nl for the self-updater, without GPUI."
4edition.workspace = true
5version.workspace = true
6license.workspace = true
7publish.workspace = true
8
9[dependencies]
10serde.workspace = true
11serde_json.workspace = true
crates/kvt-update/src/lib.rs added +327 −0
@@ -0,0 +1,327 @@
1 //! KVT fork only: the release feed of `ict/rusty-teams` on git.kvt.nl (BlueGit).
2 //!
3 //! Upstream's updater (`app-base/src/release_feed.rs`) reads GitHub releases. This
4 //! fork reads BlueGit instead and turns its answer into the GitHub shape that
5 //! `release_feed::Release` already parses, so the download, verification, swap and
6 //! dialogs stay upstream's code. Keeping this in its own crate, without GPUI, keeps
7 //! the weekly upstream merge small and lets CI test it in seconds.
8 //!
9 //! BlueGit lists a release as `{"tag", "name", "assets": [{"name", "size"}]}`. There
10 //! is no download URL and no digest in that list: an asset downloads from
11 //! `/api/v1/projects/<owner>/<repo>/releases/<tag>/assets/<name>`, and the sha256 of
12 //! each file is in the `SHA256SUMS` asset that the release job publishes.
13
14 use std::collections::HashMap;
15 use std::path::Path;
16
17 use serde::{Deserialize, Serialize};
18
19 /// The BlueGit server and project this fork publishes to.
20 pub const SERVER: &str = "https://git.kvt.nl";
21 pub const PROJECT: &str = "ict/rusty-teams";
22 /// The file in every release with `sha256 name` lines.
23 pub const CHECKSUMS_ASSET: &str = "SHA256SUMS";
24 /// Set (to anything but empty or `0`) by a package manager: no update checks at all.
25 pub const PACKAGE_MANAGED_ENV: &str = "RUSTY_TEAMS_PACKAGE_MANAGED";
26 /// Installed by the AUR package `kvt-rusty-teams-bin` (and any other system package).
27 pub const PACKAGE_MANAGED_MARKER: &str = "/usr/lib/rusty-teams/package-managed";
28
29 /// The public JSON list of releases (newest first).
30 pub fn releases_url() -> String {
31 format!("{SERVER}/api/v1/projects/{PROJECT}/releases")
32 }
33
34 /// The page that lists the releases; installs that must not replace themselves open it.
35 pub fn release_page_url(tag: &str) -> String {
36 format!("{SERVER}/{PROJECT}/-/releases#{tag}")
37 }
38
39 /// Download URL of one release asset.
40 pub fn asset_url(tag: &str, name: &str) -> String {
41 format!(
42 "{SERVER}/api/v1/projects/{PROJECT}/releases/{}/assets/{}",
43 encode_segment(tag),
44 encode_segment(name)
45 )
46 }
47
48 /// BlueGit allows `A-Za-z0-9._-` in a tag and a basename for an asset. Anything else
49 /// is percent-encoded so a strange name can never change the path.
50 fn encode_segment(segment: &str) -> String {
51 let mut out = String::with_capacity(segment.len());
52 for byte in segment.bytes() {
53 if byte.is_ascii_alphanumeric() || matches!(byte, b'.' | b'_' | b'-' | b'~') {
54 out.push(byte as char);
55 } else {
56 out.push_str(&format!("%{byte:02X}"));
57 }
58 }
59 out
60 }
61
62 #[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
63 pub struct BlueGitRelease {
64 pub tag: String,
65 #[serde(default)]
66 pub assets: Vec<BlueGitAsset>,
67 }
68
69 #[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
70 pub struct BlueGitAsset {
71 pub name: String,
72 #[serde(default)]
73 pub size: u64,
74 }
75
76 impl BlueGitRelease {
77 pub fn has_checksums(&self) -> bool {
78 self.assets
79 .iter()
80 .any(|asset| asset.name == CHECKSUMS_ASSET)
81 }
82
83 pub fn checksums_url(&self) -> String {
84 asset_url(&self.tag, CHECKSUMS_ASSET)
85 }
86 }
87
88 /// Parses the BlueGit release list.
89 pub fn parse_releases(json: &[u8]) -> Result<Vec<BlueGitRelease>, String> {
90 serde_json::from_slice(json).map_err(|error| format!("release list: {error}"))
91 }
92
93 /// Parses `sha256sum` output: `<64 hex> <name>` (or `<hex> *<name>`) per line.
94 /// Lines that do not look like that are skipped.
95 pub fn parse_checksums(text: &str) -> HashMap<String, String> {
96 text.lines()
97 .filter_map(|line| {
98 let (hash, name) = line.trim().split_once(char::is_whitespace)?;
99 let name = name.trim_start().trim_start_matches('*').trim();
100 let valid = hash.len() == 64 && hash.bytes().all(|byte| byte.is_ascii_hexdigit());
101 (valid && !name.is_empty()).then(|| (name.to_owned(), hash.to_ascii_lowercase()))
102 })
103 .collect()
104 }
105
106 /// One release in the GitHub shape upstream's `release_feed::Release` reads.
107 #[derive(Debug, Clone, PartialEq, Eq, Serialize)]
108 pub struct GitHubRelease {
109 pub tag_name: String,
110 pub draft: bool,
111 pub prerelease: bool,
112 pub assets: Vec<GitHubAsset>,
113 }
114
115 #[derive(Debug, Clone, PartialEq, Eq, Serialize)]
116 pub struct GitHubAsset {
117 pub name: String,
118 pub browser_download_url: String,
119 pub size: u64,
120 /// `sha256:<hex>`, or `None` when the release has no line for this file. Upstream
121 /// refuses to install an asset without a digest, so a missing checksum is safe.
122 pub digest: Option<String>,
123 }
124
125 /// Converts one BlueGit release. `checksums` is the parsed `SHA256SUMS` of this
126 /// release, or empty when it was not fetched.
127 pub fn to_github(release: &BlueGitRelease, checksums: &HashMap<String, String>) -> GitHubRelease {
128 GitHubRelease {
129 tag_name: release.tag.clone(),
130 draft: false,
131 // BlueGit has no pre-release flag. Upstream treats a tag with `-` as a
132 // pre-release by version order already, and offers it only to a build that
133 // runs a pre-release itself (our `-kvt.N` tags do).
134 prerelease: false,
135 assets: release
136 .assets
137 .iter()
138 .filter(|asset| asset.name != CHECKSUMS_ASSET)
139 .map(|asset| GitHubAsset {
140 name: asset.name.clone(),
141 browser_download_url: asset_url(&release.tag, &asset.name),
142 size: asset.size,
143 digest: checksums
144 .get(&asset.name)
145 .map(|hash| format!("sha256:{hash}")),
146 })
147 .collect(),
148 }
149 }
150
151 /// The GitHub-shaped JSON for a list of converted releases.
152 pub fn to_github_json(releases: &[GitHubRelease]) -> Vec<u8> {
153 serde_json::to_vec(releases).unwrap_or_else(|_| b"[]".to_vec())
154 }
155
156 /// Whether a package manager owns this install, so the app must not look for
157 /// updates (not even a notice): the AUR package and any other system package.
158 pub fn package_managed() -> bool {
159 package_managed_from(
160 std::env::var(PACKAGE_MANAGED_ENV).ok().as_deref(),
161 option_env!("RUSTY_TEAMS_PACKAGE_MANAGED"),
162 Path::new(PACKAGE_MANAGED_MARKER).exists(),
163 )
164 }
165
166 fn flag(value: Option<&str>) -> bool {
167 value.is_some_and(|value| {
168 let value = value.trim();
169 !value.is_empty() && value != "0" && !value.eq_ignore_ascii_case("false")
170 })
171 }
172
173 /// `runtime` is the environment, `compile_time` the same variable during the build
174 /// (a source package sets it), `marker_exists` the file the binary package installs.
175 pub fn package_managed_from(
176 runtime: Option<&str>,
177 compile_time: Option<&str>,
178 marker_exists: bool,
179 ) -> bool {
180 flag(runtime) || flag(compile_time) || marker_exists
181 }
182
183 /// The release asset names CI publishes for `version` (the tag without `v`). The
184 /// suffixes must match upstream's `ASSET_SUFFIX` per platform in `release_feed.rs`;
185 /// a test there and one here keep both sides in step.
186 pub fn release_asset_names(version: &str) -> Vec<String> {
187 ["-linux-amd64", "-linux-amd64.tar.gz", "-windows-amd64.exe"]
188 .iter()
189 .map(|suffix| format!("rusty-teams-{version}{suffix}"))
190 .collect()
191 }
192
193 #[cfg(test)]
194 mod tests {
195 use super::*;
196
197 const LIST: &str = r#"[
198 {"assets":[{"name":"SHA256SUMS","size":200},
199 {"name":"rusty-teams-0.6.1-kvt.2-linux-amd64","size":1234},
200 {"name":"rusty-teams-0.6.1-kvt.2-windows-amd64.exe","size":4321}],
201 "body":"Rusty Teams v0.6.1-kvt.2","commit":"0123456789abcdef0123456789abcdef01234567",
202 "created_at":"2026-11-27T11:53:43Z","id":7,"name":"v0.6.1-kvt.2","tag":"v0.6.1-kvt.2"},
203 {"assets":[],"name":"v0.6.1-kvt.1","tag":"v0.6.1-kvt.1"}
204 ]"#;
205
206 fn hex(byte: char) -> String {
207 std::iter::repeat_n(byte, 64).collect()
208 }
209
210 #[test]
211 fn parses_the_bluegit_list_and_ignores_extra_fields() {
212 let releases = parse_releases(LIST.as_bytes()).unwrap();
213 assert_eq!(releases.len(), 2);
214 assert_eq!(releases[0].tag, "v0.6.1-kvt.2");
215 assert_eq!(releases[0].assets.len(), 3);
216 assert!(releases[0].has_checksums());
217 assert!(!releases[1].has_checksums());
218 assert!(parse_releases(b"[]").unwrap().is_empty());
219 assert!(parse_releases(b"<html>").is_err());
220 assert!(parse_releases(b"").is_err());
221 }
222
223 #[test]
224 fn urls_point_at_git_kvt_nl() {
225 assert_eq!(
226 releases_url(),
227 "https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases"
228 );
229 assert_eq!(
230 asset_url("v0.6.1-kvt.2", "rusty-teams-0.6.1-kvt.2-windows-amd64.exe"),
231 "https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases/v0.6.1-kvt.2/assets/rusty-teams-0.6.1-kvt.2-windows-amd64.exe"
232 );
233 assert_eq!(
234 release_page_url("v0.6.1-kvt.2"),
235 "https://git.kvt.nl/ict/rusty-teams/-/releases#v0.6.1-kvt.2"
236 );
237 }
238
239 #[test]
240 fn a_strange_name_cannot_escape_the_asset_path() {
241 assert_eq!(
242 asset_url("v1/../x", "a b?c#d"),
243 "https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases/v1%2F..%2Fx/assets/a%20b%3Fc%23d"
244 );
245 }
246
247 #[test]
248 fn checksums_parse_like_sha256sum_output() {
249 let text = format!(
250 "{} rusty-teams-0.6.1-linux-amd64\n{} *rusty-teams-0.6.1-windows-amd64.exe\r\nnot a line\n{} short\n\n",
251 hex('a'),
252 hex('B'),
253 "abc"
254 );
255 let sums = parse_checksums(&text);
256 assert_eq!(sums.len(), 2);
257 assert_eq!(sums["rusty-teams-0.6.1-linux-amd64"], hex('a'));
258 assert_eq!(sums["rusty-teams-0.6.1-windows-amd64.exe"], hex('b'));
259 }
260
261 #[test]
262 fn conversion_fills_url_size_and_digest_and_drops_the_checksum_file() {
263 let releases = parse_releases(LIST.as_bytes()).unwrap();
264 let mut sums = HashMap::new();
265 sums.insert("rusty-teams-0.6.1-kvt.2-linux-amd64".to_owned(), hex('c'));
266 let converted = to_github(&releases[0], &sums);
267 assert_eq!(converted.tag_name, "v0.6.1-kvt.2");
268 assert!(!converted.draft && !converted.prerelease);
269 assert_eq!(converted.assets.len(), 2);
270 let linux = &converted.assets[0];
271 assert_eq!(linux.size, 1234);
272 assert_eq!(
273 linux.digest.as_deref(),
274 Some(format!("sha256:{}", hex('c')).as_str())
275 );
276 assert!(
277 linux
278 .browser_download_url
279 .ends_with("/assets/rusty-teams-0.6.1-kvt.2-linux-amd64")
280 );
281 // No checksum line: no digest, and upstream then refuses the download.
282 assert_eq!(converted.assets[1].digest, None);
283 }
284
285 #[test]
286 fn the_json_reads_back_in_the_github_shape() {
287 let releases = parse_releases(LIST.as_bytes()).unwrap();
288 let converted: Vec<_> = releases
289 .iter()
290 .map(|r| to_github(r, &HashMap::new()))
291 .collect();
292 let value: serde_json::Value = serde_json::from_slice(&to_github_json(&converted)).unwrap();
293 assert_eq!(value[0]["tag_name"], "v0.6.1-kvt.2");
294 assert!(
295 !value[0]["assets"][0]["browser_download_url"]
296 .as_str()
297 .unwrap()
298 .is_empty()
299 );
300 assert_eq!(value[0]["assets"][0]["size"], 1234);
301 assert!(value[0]["assets"][0]["digest"].is_null());
302 assert_eq!(value[1]["assets"].as_array().unwrap().len(), 0);
303 }
304
305 #[test]
306 fn package_managed_installs_never_check() {
307 assert!(!package_managed_from(None, None, false));
308 assert!(!package_managed_from(Some(""), Some("0"), false));
309 assert!(!package_managed_from(Some("false"), None, false));
310 assert!(package_managed_from(Some("1"), None, false));
311 assert!(package_managed_from(None, Some("aur"), false));
312 assert!(package_managed_from(None, None, true));
313 }
314
315 #[test]
316 fn published_names_end_with_the_suffix_each_platform_installs() {
317 let names = release_asset_names("0.6.1-kvt.2");
318 // Upstream release_feed.rs: ASSET_SUFFIX for Linux and Windows x86_64.
319 for suffix in ["-linux-amd64", "-windows-amd64.exe"] {
320 let matching: Vec<_> = names.iter().filter(|name| name.ends_with(suffix)).collect();
321 assert_eq!(matching.len(), 1, "{suffix}");
322 }
323 assert!(names.contains(&"rusty-teams-0.6.1-kvt.2-linux-amd64".to_owned()));
324 // The tarball must not be taken for the bare Linux binary.
325 assert!(!"rusty-teams-0.6.1-kvt.2-linux-amd64.tar.gz".ends_with("-linux-amd64"));
326 }
327 }
@@ -0,0 +1,327 @@
1//! KVT fork only: the release feed of `ict/rusty-teams` on git.kvt.nl (BlueGit).
2//!
3//! Upstream's updater (`app-base/src/release_feed.rs`) reads GitHub releases. This
4//! fork reads BlueGit instead and turns its answer into the GitHub shape that
5//! `release_feed::Release` already parses, so the download, verification, swap and
6//! dialogs stay upstream's code. Keeping this in its own crate, without GPUI, keeps
7//! the weekly upstream merge small and lets CI test it in seconds.
8//!
9//! BlueGit lists a release as `{"tag", "name", "assets": [{"name", "size"}]}`. There
10//! is no download URL and no digest in that list: an asset downloads from
11//! `/api/v1/projects/<owner>/<repo>/releases/<tag>/assets/<name>`, and the sha256 of
12//! each file is in the `SHA256SUMS` asset that the release job publishes.
13
14use std::collections::HashMap;
15use std::path::Path;
16
17use serde::{Deserialize, Serialize};
18
19/// The BlueGit server and project this fork publishes to.
20pub const SERVER: &str = "https://git.kvt.nl";
21pub const PROJECT: &str = "ict/rusty-teams";
22/// The file in every release with `sha256 name` lines.
23pub const CHECKSUMS_ASSET: &str = "SHA256SUMS";
24/// Set (to anything but empty or `0`) by a package manager: no update checks at all.
25pub const PACKAGE_MANAGED_ENV: &str = "RUSTY_TEAMS_PACKAGE_MANAGED";
26/// Installed by the AUR package `kvt-rusty-teams-bin` (and any other system package).
27pub const PACKAGE_MANAGED_MARKER: &str = "/usr/lib/rusty-teams/package-managed";
28
29/// The public JSON list of releases (newest first).
30pub fn releases_url() -> String {
31 format!("{SERVER}/api/v1/projects/{PROJECT}/releases")
32}
33
34/// The page that lists the releases; installs that must not replace themselves open it.
35pub fn release_page_url(tag: &str) -> String {
36 format!("{SERVER}/{PROJECT}/-/releases#{tag}")
37}
38
39/// Download URL of one release asset.
40pub fn asset_url(tag: &str, name: &str) -> String {
41 format!(
42 "{SERVER}/api/v1/projects/{PROJECT}/releases/{}/assets/{}",
43 encode_segment(tag),
44 encode_segment(name)
45 )
46}
47
48/// BlueGit allows `A-Za-z0-9._-` in a tag and a basename for an asset. Anything else
49/// is percent-encoded so a strange name can never change the path.
50fn encode_segment(segment: &str) -> String {
51 let mut out = String::with_capacity(segment.len());
52 for byte in segment.bytes() {
53 if byte.is_ascii_alphanumeric() || matches!(byte, b'.' | b'_' | b'-' | b'~') {
54 out.push(byte as char);
55 } else {
56 out.push_str(&format!("%{byte:02X}"));
57 }
58 }
59 out
60}
61
62#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
63pub struct BlueGitRelease {
64 pub tag: String,
65 #[serde(default)]
66 pub assets: Vec<BlueGitAsset>,
67}
68
69#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
70pub struct BlueGitAsset {
71 pub name: String,
72 #[serde(default)]
73 pub size: u64,
74}
75
76impl BlueGitRelease {
77 pub fn has_checksums(&self) -> bool {
78 self.assets
79 .iter()
80 .any(|asset| asset.name == CHECKSUMS_ASSET)
81 }
82
83 pub fn checksums_url(&self) -> String {
84 asset_url(&self.tag, CHECKSUMS_ASSET)
85 }
86}
87
88/// Parses the BlueGit release list.
89pub fn parse_releases(json: &[u8]) -> Result<Vec<BlueGitRelease>, String> {
90 serde_json::from_slice(json).map_err(|error| format!("release list: {error}"))
91}
92
93/// Parses `sha256sum` output: `<64 hex> <name>` (or `<hex> *<name>`) per line.
94/// Lines that do not look like that are skipped.
95pub fn parse_checksums(text: &str) -> HashMap<String, String> {
96 text.lines()
97 .filter_map(|line| {
98 let (hash, name) = line.trim().split_once(char::is_whitespace)?;
99 let name = name.trim_start().trim_start_matches('*').trim();
100 let valid = hash.len() == 64 && hash.bytes().all(|byte| byte.is_ascii_hexdigit());
101 (valid && !name.is_empty()).then(|| (name.to_owned(), hash.to_ascii_lowercase()))
102 })
103 .collect()
104}
105
106/// One release in the GitHub shape upstream's `release_feed::Release` reads.
107#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
108pub struct GitHubRelease {
109 pub tag_name: String,
110 pub draft: bool,
111 pub prerelease: bool,
112 pub assets: Vec<GitHubAsset>,
113}
114
115#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
116pub struct GitHubAsset {
117 pub name: String,
118 pub browser_download_url: String,
119 pub size: u64,
120 /// `sha256:<hex>`, or `None` when the release has no line for this file. Upstream
121 /// refuses to install an asset without a digest, so a missing checksum is safe.
122 pub digest: Option<String>,
123}
124
125/// Converts one BlueGit release. `checksums` is the parsed `SHA256SUMS` of this
126/// release, or empty when it was not fetched.
127pub fn to_github(release: &BlueGitRelease, checksums: &HashMap<String, String>) -> GitHubRelease {
128 GitHubRelease {
129 tag_name: release.tag.clone(),
130 draft: false,
131 // BlueGit has no pre-release flag. Upstream treats a tag with `-` as a
132 // pre-release by version order already, and offers it only to a build that
133 // runs a pre-release itself (our `-kvt.N` tags do).
134 prerelease: false,
135 assets: release
136 .assets
137 .iter()
138 .filter(|asset| asset.name != CHECKSUMS_ASSET)
139 .map(|asset| GitHubAsset {
140 name: asset.name.clone(),
141 browser_download_url: asset_url(&release.tag, &asset.name),
142 size: asset.size,
143 digest: checksums
144 .get(&asset.name)
145 .map(|hash| format!("sha256:{hash}")),
146 })
147 .collect(),
148 }
149}
150
151/// The GitHub-shaped JSON for a list of converted releases.
152pub fn to_github_json(releases: &[GitHubRelease]) -> Vec<u8> {
153 serde_json::to_vec(releases).unwrap_or_else(|_| b"[]".to_vec())
154}
155
156/// Whether a package manager owns this install, so the app must not look for
157/// updates (not even a notice): the AUR package and any other system package.
158pub fn package_managed() -> bool {
159 package_managed_from(
160 std::env::var(PACKAGE_MANAGED_ENV).ok().as_deref(),
161 option_env!("RUSTY_TEAMS_PACKAGE_MANAGED"),
162 Path::new(PACKAGE_MANAGED_MARKER).exists(),
163 )
164}
165
166fn flag(value: Option<&str>) -> bool {
167 value.is_some_and(|value| {
168 let value = value.trim();
169 !value.is_empty() && value != "0" && !value.eq_ignore_ascii_case("false")
170 })
171}
172
173/// `runtime` is the environment, `compile_time` the same variable during the build
174/// (a source package sets it), `marker_exists` the file the binary package installs.
175pub fn package_managed_from(
176 runtime: Option<&str>,
177 compile_time: Option<&str>,
178 marker_exists: bool,
179) -> bool {
180 flag(runtime) || flag(compile_time) || marker_exists
181}
182
183/// The release asset names CI publishes for `version` (the tag without `v`). The
184/// suffixes must match upstream's `ASSET_SUFFIX` per platform in `release_feed.rs`;
185/// a test there and one here keep both sides in step.
186pub fn release_asset_names(version: &str) -> Vec<String> {
187 ["-linux-amd64", "-linux-amd64.tar.gz", "-windows-amd64.exe"]
188 .iter()
189 .map(|suffix| format!("rusty-teams-{version}{suffix}"))
190 .collect()
191}
192
193#[cfg(test)]
194mod tests {
195 use super::*;
196
197 const LIST: &str = r#"[
198 {"assets":[{"name":"SHA256SUMS","size":200},
199 {"name":"rusty-teams-0.6.1-kvt.2-linux-amd64","size":1234},
200 {"name":"rusty-teams-0.6.1-kvt.2-windows-amd64.exe","size":4321}],
201 "body":"Rusty Teams v0.6.1-kvt.2","commit":"0123456789abcdef0123456789abcdef01234567",
202 "created_at":"2026-11-27T11:53:43Z","id":7,"name":"v0.6.1-kvt.2","tag":"v0.6.1-kvt.2"},
203 {"assets":[],"name":"v0.6.1-kvt.1","tag":"v0.6.1-kvt.1"}
204 ]"#;
205
206 fn hex(byte: char) -> String {
207 std::iter::repeat_n(byte, 64).collect()
208 }
209
210 #[test]
211 fn parses_the_bluegit_list_and_ignores_extra_fields() {
212 let releases = parse_releases(LIST.as_bytes()).unwrap();
213 assert_eq!(releases.len(), 2);
214 assert_eq!(releases[0].tag, "v0.6.1-kvt.2");
215 assert_eq!(releases[0].assets.len(), 3);
216 assert!(releases[0].has_checksums());
217 assert!(!releases[1].has_checksums());
218 assert!(parse_releases(b"[]").unwrap().is_empty());
219 assert!(parse_releases(b"<html>").is_err());
220 assert!(parse_releases(b"").is_err());
221 }
222
223 #[test]
224 fn urls_point_at_git_kvt_nl() {
225 assert_eq!(
226 releases_url(),
227 "https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases"
228 );
229 assert_eq!(
230 asset_url("v0.6.1-kvt.2", "rusty-teams-0.6.1-kvt.2-windows-amd64.exe"),
231 "https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases/v0.6.1-kvt.2/assets/rusty-teams-0.6.1-kvt.2-windows-amd64.exe"
232 );
233 assert_eq!(
234 release_page_url("v0.6.1-kvt.2"),
235 "https://git.kvt.nl/ict/rusty-teams/-/releases#v0.6.1-kvt.2"
236 );
237 }
238
239 #[test]
240 fn a_strange_name_cannot_escape_the_asset_path() {
241 assert_eq!(
242 asset_url("v1/../x", "a b?c#d"),
243 "https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases/v1%2F..%2Fx/assets/a%20b%3Fc%23d"
244 );
245 }
246
247 #[test]
248 fn checksums_parse_like_sha256sum_output() {
249 let text = format!(
250 "{} rusty-teams-0.6.1-linux-amd64\n{} *rusty-teams-0.6.1-windows-amd64.exe\r\nnot a line\n{} short\n\n",
251 hex('a'),
252 hex('B'),
253 "abc"
254 );
255 let sums = parse_checksums(&text);
256 assert_eq!(sums.len(), 2);
257 assert_eq!(sums["rusty-teams-0.6.1-linux-amd64"], hex('a'));
258 assert_eq!(sums["rusty-teams-0.6.1-windows-amd64.exe"], hex('b'));
259 }
260
261 #[test]
262 fn conversion_fills_url_size_and_digest_and_drops_the_checksum_file() {
263 let releases = parse_releases(LIST.as_bytes()).unwrap();
264 let mut sums = HashMap::new();
265 sums.insert("rusty-teams-0.6.1-kvt.2-linux-amd64".to_owned(), hex('c'));
266 let converted = to_github(&releases[0], &sums);
267 assert_eq!(converted.tag_name, "v0.6.1-kvt.2");
268 assert!(!converted.draft && !converted.prerelease);
269 assert_eq!(converted.assets.len(), 2);
270 let linux = &converted.assets[0];
271 assert_eq!(linux.size, 1234);
272 assert_eq!(
273 linux.digest.as_deref(),
274 Some(format!("sha256:{}", hex('c')).as_str())
275 );
276 assert!(
277 linux
278 .browser_download_url
279 .ends_with("/assets/rusty-teams-0.6.1-kvt.2-linux-amd64")
280 );
281 // No checksum line: no digest, and upstream then refuses the download.
282 assert_eq!(converted.assets[1].digest, None);
283 }
284
285 #[test]
286 fn the_json_reads_back_in_the_github_shape() {
287 let releases = parse_releases(LIST.as_bytes()).unwrap();
288 let converted: Vec<_> = releases
289 .iter()
290 .map(|r| to_github(r, &HashMap::new()))
291 .collect();
292 let value: serde_json::Value = serde_json::from_slice(&to_github_json(&converted)).unwrap();
293 assert_eq!(value[0]["tag_name"], "v0.6.1-kvt.2");
294 assert!(
295 !value[0]["assets"][0]["browser_download_url"]
296 .as_str()
297 .unwrap()
298 .is_empty()
299 );
300 assert_eq!(value[0]["assets"][0]["size"], 1234);
301 assert!(value[0]["assets"][0]["digest"].is_null());
302 assert_eq!(value[1]["assets"].as_array().unwrap().len(), 0);
303 }
304
305 #[test]
306 fn package_managed_installs_never_check() {
307 assert!(!package_managed_from(None, None, false));
308 assert!(!package_managed_from(Some(""), Some("0"), false));
309 assert!(!package_managed_from(Some("false"), None, false));
310 assert!(package_managed_from(Some("1"), None, false));
311 assert!(package_managed_from(None, Some("aur"), false));
312 assert!(package_managed_from(None, None, true));
313 }
314
315 #[test]
316 fn published_names_end_with_the_suffix_each_platform_installs() {
317 let names = release_asset_names("0.6.1-kvt.2");
318 // Upstream release_feed.rs: ASSET_SUFFIX for Linux and Windows x86_64.
319 for suffix in ["-linux-amd64", "-windows-amd64.exe"] {
320 let matching: Vec<_> = names.iter().filter(|name| name.ends_with(suffix)).collect();
321 assert_eq!(matching.len(), 1, "{suffix}");
322 }
323 assert!(names.contains(&"rusty-teams-0.6.1-kvt.2-linux-amd64".to_owned()));
324 // The tarball must not be taken for the bare Linux binary.
325 assert!(!"rusty-teams-0.6.1-kvt.2-linux-amd64.tar.gz".ends_with("-linux-amd64"));
326 }
327}
packaging/kvt/README.md added +79 −0
@@ -0,0 +1,79 @@
1 # KVT-release, AUR en updater
2
3 Alles in deze map, `crates/kvt-update` en `crates/app-base/src/kvt_feed.rs` hoort
4 bij de fork op git.kvt.nl. Upstream heeft dit niet. De wijzigingen in upstream-code
5 zijn bewust klein, zodat de wekelijkse merge van `upstream-master` weinig conflicten
6 geeft:
7
8 | Bestand | Wijziging |
9 | --- | --- |
10 | `crates/app-base/src/release_feed.rs` | releases en releasepagina komen uit `kvt_feed` in plaats van GitHub; `get` en `HttpClient` zijn `pub(crate)`; test voor `-kvt.N`-tags |
11 | `crates/app-base/src/lib.rs`, `Cargo.toml` | module `kvt_feed` en de crate `kvt-update` |
12 | `crates/app/src/linux_update.rs` | geen updatecheck als een pakketbeheerder de app beheert |
13 | `blue-ci-cd.yml` | controle-, release- en AUR-jobs; `sync-upstream` kreeg alleen `rules` |
14
15 ## Een release maken
16
17 1. Zet een tag `v<versie>-kvt.<n>` op master, bijvoorbeeld `v0.6.1-kvt.1`
18 (`<versie>` is `[workspace.package] version` uit `Cargo.toml`). Wie de tag pusht
19 moet maintainer zijn.
20 2. De tag-pipeline bouwt Linux en Windows, maakt `SHA256SUMS`, publiceert de
21 release met de assets en werkt daarna het AUR-pakket bij.
22
23 Assets:
24
25 | Naam | Voor |
26 | --- | --- |
27 | `rusty-teams-<v>-linux-amd64` | zelfupdate van een Linux-installatie onder `~/.local` |
28 | `rusty-teams-<v>-linux-x86_64.tar.gz` | bron van `kvt-rusty-teams-bin` (bin/, share/ met .desktop en iconen) |
29 | `rusty-teams-<v>-windows-amd64.exe` | zelfupdate op Windows |
30 | `SHA256SUMS` | de updater installeert alleen een bestand met een kloppende sha256 |
31
32 ## Updater
33
34 De app gebruikt upstream's updater, maar leest `GET /api/v1/projects/ict/rusty-teams/releases`
35 op git.kvt.nl. De eerste check is een minuut na het opstarten, daarna elke zes uur,
36 op de achtergrond. Zonder netwerk logt hij een waarschuwing en gaat de app gewoon door.
37 Alleen een build van een `v*`-tag zoekt naar updates.
38
39 - **Windows**: downloadt de nieuwe exe stil, controleert grootte, `MZ` en sha256, en
40 zet hem klaar. De titelbalk toont dat de update klaar is; de app wisselt de exe
41 als hij niet in gebruik is (of na een klik) en start opnieuw.
42 - **Linux onder `~/.local/share/rusty-teams`** (de app biedt die installatie zelf aan):
43 een dialoog vraagt of hij moet bijwerken, downloadt, controleert en herstart.
44 - **Linux elders, deb/rpm/AppImage**: alleen een melding met een link naar de releasepagina.
45 - **AUR (`kvt-rusty-teams-bin`), Flatpak**: geen check. Het AUR-pakket installeert
46 `/usr/lib/rusty-teams/package-managed`; de omgevingsvariabele
47 `RUSTY_TEAMS_PACKAGE_MANAGED=1` (bij het bouwen of bij het starten) doet hetzelfde.
48 - Instellingen > Algemeen: automatisch bijwerken aan of uit, en "nu controleren".
49
50 ## AUR
51
52 `publish-aur.sh` volgt BlueGit's `publish_aur` (zelfde geheimen):
53
54 | Geheim | Waarde |
55 | --- | --- |
56 | `AUR_SSH_PRIVATE_KEY` | ruwe OpenSSH-sleutel van het AUR-account, of base64 daarvan |
57 | `AUR_SSH_PRIVATE_KEY_B64` | dezelfde sleutel als één regel base64 (één van de twee is genoeg) |
58 | `AUR_GIT_AUTHOR_NAME`, `AUR_GIT_AUTHOR_EMAIL` | naam en e-mail in de AUR-commit |
59
60 Zet ze beschermd op `ict/rusty-teams` (of de groep `ict`) en bescherm het tagpatroon `v*`.
61 Zonder sleutel slaat de job zich over en blijft hij groen. Met sleutel downloadt hij de
62 tarball van de release, vult `pkgver`, `_tag` en `sha256sums` in `aur/PKGBUILD`, bouwt
63 het pakket één keer met `makepkg`, maakt `.SRCINFO` en pusht naar
64 `ssh://aur@aur.archlinux.org/kvt-rusty-teams-bin.git`. Het AUR-account moet die
65 SSH-sleutel hebben; bestaat het pakket nog niet, dan maakt de eerste push het aan.
66
67 ## Windows-build
68
69 `build-windows.sh` draait upstream's `scripts/build-windows.sh` (cargo-xwin) in een
70 Linux-container. Alleen de shadercompiler is anders: `fxc-wine.sh` draait Microsofts
71 eigen `fxc.exe` en `d3dcompiler_47.dll` uit het NuGet-pakket `Microsoft.Windows.SDK.CPP`
72 (versie en sha256 vast in het script) onder wine.
73
74 ## Lokaal testen
75
76 ```sh
77 cargo test -p kvt-update
78 packaging/kvt/tests.sh
79 ```
@@ -0,0 +1,79 @@
1# KVT-release, AUR en updater
2
3Alles in deze map, `crates/kvt-update` en `crates/app-base/src/kvt_feed.rs` hoort
4bij de fork op git.kvt.nl. Upstream heeft dit niet. De wijzigingen in upstream-code
5zijn bewust klein, zodat de wekelijkse merge van `upstream-master` weinig conflicten
6geeft:
7
8| Bestand | Wijziging |
9| --- | --- |
10| `crates/app-base/src/release_feed.rs` | releases en releasepagina komen uit `kvt_feed` in plaats van GitHub; `get` en `HttpClient` zijn `pub(crate)`; test voor `-kvt.N`-tags |
11| `crates/app-base/src/lib.rs`, `Cargo.toml` | module `kvt_feed` en de crate `kvt-update` |
12| `crates/app/src/linux_update.rs` | geen updatecheck als een pakketbeheerder de app beheert |
13| `blue-ci-cd.yml` | controle-, release- en AUR-jobs; `sync-upstream` kreeg alleen `rules` |
14
15## Een release maken
16
171. Zet een tag `v<versie>-kvt.<n>` op master, bijvoorbeeld `v0.6.1-kvt.1`
18 (`<versie>` is `[workspace.package] version` uit `Cargo.toml`). Wie de tag pusht
19 moet maintainer zijn.
202. De tag-pipeline bouwt Linux en Windows, maakt `SHA256SUMS`, publiceert de
21 release met de assets en werkt daarna het AUR-pakket bij.
22
23Assets:
24
25| Naam | Voor |
26| --- | --- |
27| `rusty-teams-<v>-linux-amd64` | zelfupdate van een Linux-installatie onder `~/.local` |
28| `rusty-teams-<v>-linux-x86_64.tar.gz` | bron van `kvt-rusty-teams-bin` (bin/, share/ met .desktop en iconen) |
29| `rusty-teams-<v>-windows-amd64.exe` | zelfupdate op Windows |
30| `SHA256SUMS` | de updater installeert alleen een bestand met een kloppende sha256 |
31
32## Updater
33
34De app gebruikt upstream's updater, maar leest `GET /api/v1/projects/ict/rusty-teams/releases`
35op git.kvt.nl. De eerste check is een minuut na het opstarten, daarna elke zes uur,
36op de achtergrond. Zonder netwerk logt hij een waarschuwing en gaat de app gewoon door.
37Alleen een build van een `v*`-tag zoekt naar updates.
38
39- **Windows**: downloadt de nieuwe exe stil, controleert grootte, `MZ` en sha256, en
40 zet hem klaar. De titelbalk toont dat de update klaar is; de app wisselt de exe
41 als hij niet in gebruik is (of na een klik) en start opnieuw.
42- **Linux onder `~/.local/share/rusty-teams`** (de app biedt die installatie zelf aan):
43 een dialoog vraagt of hij moet bijwerken, downloadt, controleert en herstart.
44- **Linux elders, deb/rpm/AppImage**: alleen een melding met een link naar de releasepagina.
45- **AUR (`kvt-rusty-teams-bin`), Flatpak**: geen check. Het AUR-pakket installeert
46 `/usr/lib/rusty-teams/package-managed`; de omgevingsvariabele
47 `RUSTY_TEAMS_PACKAGE_MANAGED=1` (bij het bouwen of bij het starten) doet hetzelfde.
48- Instellingen > Algemeen: automatisch bijwerken aan of uit, en "nu controleren".
49
50## AUR
51
52`publish-aur.sh` volgt BlueGit's `publish_aur` (zelfde geheimen):
53
54| Geheim | Waarde |
55| --- | --- |
56| `AUR_SSH_PRIVATE_KEY` | ruwe OpenSSH-sleutel van het AUR-account, of base64 daarvan |
57| `AUR_SSH_PRIVATE_KEY_B64` | dezelfde sleutel als één regel base64 (één van de twee is genoeg) |
58| `AUR_GIT_AUTHOR_NAME`, `AUR_GIT_AUTHOR_EMAIL` | naam en e-mail in de AUR-commit |
59
60Zet ze beschermd op `ict/rusty-teams` (of de groep `ict`) en bescherm het tagpatroon `v*`.
61Zonder sleutel slaat de job zich over en blijft hij groen. Met sleutel downloadt hij de
62tarball van de release, vult `pkgver`, `_tag` en `sha256sums` in `aur/PKGBUILD`, bouwt
63het pakket één keer met `makepkg`, maakt `.SRCINFO` en pusht naar
64`ssh://aur@aur.archlinux.org/kvt-rusty-teams-bin.git`. Het AUR-account moet die
65SSH-sleutel hebben; bestaat het pakket nog niet, dan maakt de eerste push het aan.
66
67## Windows-build
68
69`build-windows.sh` draait upstream's `scripts/build-windows.sh` (cargo-xwin) in een
70Linux-container. Alleen de shadercompiler is anders: `fxc-wine.sh` draait Microsofts
71eigen `fxc.exe` en `d3dcompiler_47.dll` uit het NuGet-pakket `Microsoft.Windows.SDK.CPP`
72(versie en sha256 vast in het script) onder wine.
73
74## Lokaal testen
75
76```sh
77cargo test -p kvt-update
78packaging/kvt/tests.sh
79```
packaging/kvt/aur-ssh-setup.sh added +79 −0
@@ -0,0 +1,79 @@
1 #!/usr/bin/env bash
2 # Copied from BlueGit (scripts/aur-ssh-setup.sh on git.timfalken.com/timfa/bluegit), same secrets.
3 # Write ~/.ssh/id_ed25519 for AUR pushes from CI or local scripts.
4 #
5 # Supported CI variables (pick one):
6 # AUR_SSH_PRIVATE_KEY_B64 — base64 of the private key (Variable type, one line; Masked OK)
7 # or File type whose contents are that base64 string
8 # AUR_SSH_PRIVATE_KEY — raw OpenSSH private key (File type preferred), or raw key text
9 # File contents may also be base64 (auto-detected)
10 #
11 # Always normalizes CRLF → LF (Windows pastes into GitLab often break OpenSSH otherwise).
12 set -euo pipefail
13
14 KEY_PATH="${1:-$HOME/.ssh/id_ed25519}"
15
16 install -d -m 700 "$(dirname "$KEY_PATH")"
17
18 is_raw_ssh_key() {
19 grep -qE 'BEGIN (OPENSSH |RSA |EC )?PRIVATE KEY' "$1" 2>/dev/null
20 }
21
22 normalize_key_file() {
23 local tmp
24 tmp="$(mktemp)"
25 tr -d '\r' < "$KEY_PATH" > "$tmp"
26 if [[ -s "$tmp" ]] && [[ "$(tail -c1 "$tmp" | wc -l)" -eq 0 ]]; then
27 printf '\n' >> "$tmp"
28 fi
29 mv "$tmp" "$KEY_PATH"
30 chmod 600 "$KEY_PATH"
31 }
32
33 decode_b64_to_key() {
34 local src="$1"
35 if [[ -f "$src" ]]; then
36 tr -d '\r\n[:space:]' < "$src" | base64 -d > "$KEY_PATH"
37 else
38 printf '%s' "$src" | tr -d '\r\n[:space:]' | base64 -d > "$KEY_PATH"
39 fi
40 }
41
42 if [[ -n "${AUR_SSH_PRIVATE_KEY_B64:-}" ]]; then
43 decode_b64_to_key "$AUR_SSH_PRIVATE_KEY_B64"
44 elif [[ -n "${AUR_SSH_PRIVATE_KEY:-}" && -f "${AUR_SSH_PRIVATE_KEY}" ]]; then
45 if is_raw_ssh_key "$AUR_SSH_PRIVATE_KEY"; then
46 cp "$AUR_SSH_PRIVATE_KEY" "$KEY_PATH"
47 else
48 decode_b64_to_key "$AUR_SSH_PRIVATE_KEY"
49 fi
50 elif [[ -n "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
51 if printf '%s' "$AUR_SSH_PRIVATE_KEY" | grep -qE 'BEGIN (OPENSSH |RSA |EC )?PRIVATE KEY'; then
52 printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$KEY_PATH"
53 else
54 decode_b64_to_key "$AUR_SSH_PRIVATE_KEY"
55 fi
56 elif [[ -f "$HOME/.ssh/id_ed25519" ]]; then
57 cp "$HOME/.ssh/id_ed25519" "$KEY_PATH"
58 else
59 echo "No AUR SSH key found. Set AUR_SSH_PRIVATE_KEY_B64 or AUR_SSH_PRIVATE_KEY." >&2
60 exit 1
61 fi
62
63 normalize_key_file
64
65 if ! is_raw_ssh_key "$KEY_PATH"; then
66 echo "AUR SSH key is not a valid OpenSSH private key after setup." >&2
67 echo "Use either:" >&2
68 echo " - AUR_SSH_PRIVATE_KEY as File with raw key (BEGIN ... PRIVATE KEY)" >&2
69 echo " - AUR_SSH_PRIVATE_KEY_B64 as Variable with one-line base64 of that key" >&2
70 echo 'Tip: base64 of a LF-normalized key: tr -d "\r" < key | base64 -w0' >&2
71 exit 1
72 fi
73
74 if ! ssh-keygen -y -f "$KEY_PATH" >/dev/null 2>&1; then
75 echo "AUR SSH key failed ssh-keygen validation (often CRLF or truncated paste)." >&2
76 exit 1
77 fi
78
79 ssh-keyscan aur.archlinux.org >> "$HOME/.ssh/known_hosts" 2>/dev/null || true
@@ -0,0 +1,79 @@
1#!/usr/bin/env bash
2# Copied from BlueGit (scripts/aur-ssh-setup.sh on git.timfalken.com/timfa/bluegit), same secrets.
3# Write ~/.ssh/id_ed25519 for AUR pushes from CI or local scripts.
4#
5# Supported CI variables (pick one):
6# AUR_SSH_PRIVATE_KEY_B64 — base64 of the private key (Variable type, one line; Masked OK)
7# or File type whose contents are that base64 string
8# AUR_SSH_PRIVATE_KEY — raw OpenSSH private key (File type preferred), or raw key text
9# File contents may also be base64 (auto-detected)
10#
11# Always normalizes CRLF → LF (Windows pastes into GitLab often break OpenSSH otherwise).
12set -euo pipefail
13
14KEY_PATH="${1:-$HOME/.ssh/id_ed25519}"
15
16install -d -m 700 "$(dirname "$KEY_PATH")"
17
18is_raw_ssh_key() {
19 grep -qE 'BEGIN (OPENSSH |RSA |EC )?PRIVATE KEY' "$1" 2>/dev/null
20}
21
22normalize_key_file() {
23 local tmp
24 tmp="$(mktemp)"
25 tr -d '\r' < "$KEY_PATH" > "$tmp"
26 if [[ -s "$tmp" ]] && [[ "$(tail -c1 "$tmp" | wc -l)" -eq 0 ]]; then
27 printf '\n' >> "$tmp"
28 fi
29 mv "$tmp" "$KEY_PATH"
30 chmod 600 "$KEY_PATH"
31}
32
33decode_b64_to_key() {
34 local src="$1"
35 if [[ -f "$src" ]]; then
36 tr -d '\r\n[:space:]' < "$src" | base64 -d > "$KEY_PATH"
37 else
38 printf '%s' "$src" | tr -d '\r\n[:space:]' | base64 -d > "$KEY_PATH"
39 fi
40}
41
42if [[ -n "${AUR_SSH_PRIVATE_KEY_B64:-}" ]]; then
43 decode_b64_to_key "$AUR_SSH_PRIVATE_KEY_B64"
44elif [[ -n "${AUR_SSH_PRIVATE_KEY:-}" && -f "${AUR_SSH_PRIVATE_KEY}" ]]; then
45 if is_raw_ssh_key "$AUR_SSH_PRIVATE_KEY"; then
46 cp "$AUR_SSH_PRIVATE_KEY" "$KEY_PATH"
47 else
48 decode_b64_to_key "$AUR_SSH_PRIVATE_KEY"
49 fi
50elif [[ -n "${AUR_SSH_PRIVATE_KEY:-}" ]]; then
51 if printf '%s' "$AUR_SSH_PRIVATE_KEY" | grep -qE 'BEGIN (OPENSSH |RSA |EC )?PRIVATE KEY'; then
52 printf '%s\n' "$AUR_SSH_PRIVATE_KEY" > "$KEY_PATH"
53 else
54 decode_b64_to_key "$AUR_SSH_PRIVATE_KEY"
55 fi
56elif [[ -f "$HOME/.ssh/id_ed25519" ]]; then
57 cp "$HOME/.ssh/id_ed25519" "$KEY_PATH"
58else
59 echo "No AUR SSH key found. Set AUR_SSH_PRIVATE_KEY_B64 or AUR_SSH_PRIVATE_KEY." >&2
60 exit 1
61fi
62
63normalize_key_file
64
65if ! is_raw_ssh_key "$KEY_PATH"; then
66 echo "AUR SSH key is not a valid OpenSSH private key after setup." >&2
67 echo "Use either:" >&2
68 echo " - AUR_SSH_PRIVATE_KEY as File with raw key (BEGIN ... PRIVATE KEY)" >&2
69 echo " - AUR_SSH_PRIVATE_KEY_B64 as Variable with one-line base64 of that key" >&2
70 echo 'Tip: base64 of a LF-normalized key: tr -d "\r" < key | base64 -w0' >&2
71 exit 1
72fi
73
74if ! ssh-keygen -y -f "$KEY_PATH" >/dev/null 2>&1; then
75 echo "AUR SSH key failed ssh-keygen validation (often CRLF or truncated paste)." >&2
76 exit 1
77fi
78
79ssh-keyscan aur.archlinux.org >> "$HOME/.ssh/known_hosts" 2>/dev/null || true
packaging/kvt/aur/PKGBUILD added +31 −0
@@ -0,0 +1,31 @@
1 # Template for the AUR package kvt-rusty-teams-bin. packaging/kvt/publish-aur.sh
2 # fills pkgver, _tag and sha256sums from the release on git.kvt.nl and pushes it
3 # with a generated .SRCINFO. Do not edit those three lines by hand in the AUR.
4 pkgname=kvt-rusty-teams-bin
5 pkgver=0
6 pkgrel=1
7 _tag=v0
8 pkgdesc='Native Microsoft Teams client in Rust (KVT build)'
9 arch=('x86_64')
10 url='https://git.kvt.nl/ict/rusty-teams'
11 license=('MIT')
12 depends=('glibc' 'gcc-libs' 'fontconfig' 'freetype2' 'libxkbcommon' 'libxkbcommon-x11'
13 'libx11' 'libxcb' 'wayland' 'alsa-lib' 'libpipewire' 'libva' 'glib2' 'hicolor-icon-theme')
14 provides=('rusty-teams')
15 conflicts=('rusty-teams' 'rusty-teams-bin' 'rusty-teams-git')
16 options=('!strip' '!debug')
17 source=("rusty-teams-${_tag#v}-linux-x86_64.tar.gz::https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases/${_tag}/assets/rusty-teams-${_tag#v}-linux-x86_64.tar.gz")
18 sha256sums=('SKIP')
19
20 package() {
21 cd "rusty-teams-${_tag#v}-linux-x86_64"
22 install -Dm755 bin/teams "$pkgdir/usr/bin/teams"
23 install -Dm644 share/applications/rusty-teams.desktop "$pkgdir/usr/share/applications/rusty-teams.desktop"
24 cp -a share/icons "$pkgdir/usr/share/"
25 if [[ -d share/metainfo ]]; then
26 cp -a share/metainfo "$pkgdir/usr/share/"
27 fi
28 install -Dm644 share/doc/rusty-teams/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
29 # The app never looks for updates when this file exists: pacman updates it.
30 install -Dm644 /dev/null "$pkgdir/usr/lib/rusty-teams/package-managed"
31 }
@@ -0,0 +1,31 @@
1# Template for the AUR package kvt-rusty-teams-bin. packaging/kvt/publish-aur.sh
2# fills pkgver, _tag and sha256sums from the release on git.kvt.nl and pushes it
3# with a generated .SRCINFO. Do not edit those three lines by hand in the AUR.
4pkgname=kvt-rusty-teams-bin
5pkgver=0
6pkgrel=1
7_tag=v0
8pkgdesc='Native Microsoft Teams client in Rust (KVT build)'
9arch=('x86_64')
10url='https://git.kvt.nl/ict/rusty-teams'
11license=('MIT')
12depends=('glibc' 'gcc-libs' 'fontconfig' 'freetype2' 'libxkbcommon' 'libxkbcommon-x11'
13 'libx11' 'libxcb' 'wayland' 'alsa-lib' 'libpipewire' 'libva' 'glib2' 'hicolor-icon-theme')
14provides=('rusty-teams')
15conflicts=('rusty-teams' 'rusty-teams-bin' 'rusty-teams-git')
16options=('!strip' '!debug')
17source=("rusty-teams-${_tag#v}-linux-x86_64.tar.gz::https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases/${_tag}/assets/rusty-teams-${_tag#v}-linux-x86_64.tar.gz")
18sha256sums=('SKIP')
19
20package() {
21 cd "rusty-teams-${_tag#v}-linux-x86_64"
22 install -Dm755 bin/teams "$pkgdir/usr/bin/teams"
23 install -Dm644 share/applications/rusty-teams.desktop "$pkgdir/usr/share/applications/rusty-teams.desktop"
24 cp -a share/icons "$pkgdir/usr/share/"
25 if [[ -d share/metainfo ]]; then
26 cp -a share/metainfo "$pkgdir/usr/share/"
27 fi
28 install -Dm644 share/doc/rusty-teams/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
29 # The app never looks for updates when this file exists: pacman updates it.
30 install -Dm644 /dev/null "$pkgdir/usr/lib/rusty-teams/package-managed"
31}
packaging/kvt/build-windows.sh added +32 −0
@@ -0,0 +1,32 @@
1 #!/usr/bin/env bash
2 # KVT fork: cross-build target/x86_64-pc-windows-msvc/release/teams.exe in a Linux
3 # CI container. Wraps upstream's scripts/build-windows.sh (cargo-xwin, patched
4 # gpui-pre-windows, embedded onnxruntime.dll) and swaps its WSL fxc for
5 # packaging/kvt/fxc-wine.sh. Keeping upstream's script as is keeps merges small.
6 set -euo pipefail
7 ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
8 # Microsoft.Windows.SDK.CPP from nuget.org carries fxc.exe and d3dcompiler_47.dll.
9 SDK_VERSION="${KVT_WINDOWS_SDK_VERSION:-10.0.28000.2957}"
10 SDK_SHA256="${KVT_WINDOWS_SDK_SHA256:-f0a200dae58858f418b30dc9e2f52b4188f97eb7837bd4f73074652a01937ddd}"
11 export FXC_DIR="${FXC_DIR:-$ROOT/target/kvt-fxc/$SDK_VERSION}"
12 if [[ ! -f "$FXC_DIR/fxc.exe" || ! -f "$FXC_DIR/d3dcompiler_47.dll" ]]; then
13 mkdir -p "$FXC_DIR"
14 nupkg="$FXC_DIR/sdk.nupkg"
15 curl -fsSL --retry 3 -o "$nupkg" \
16 "https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.cpp/$SDK_VERSION/microsoft.windows.sdk.cpp.$SDK_VERSION.nupkg"
17 echo "$SDK_SHA256 $nupkg" | sha256sum -c -
18 unzip -o -q -j "$nupkg" "c/bin/${SDK_VERSION%.*}.0/x64/fxc.exe" "c/bin/${SDK_VERSION%.*}.0/x64/d3dcompiler_47.dll" -d "$FXC_DIR"
19 rm -f "$nupkg"
20 fi
21 script="$(mktemp)"
22 trap 'rm -f "$script"' EXIT
23 sed 's#^export GPUI_FXC_PATH=.*#export GPUI_FXC_PATH="$repoRoot/packaging/kvt/fxc-wine.sh"#' \
24 "$ROOT/scripts/build-windows.sh" > "$script"
25 grep -q 'packaging/kvt/fxc-wine.sh' "$script" || {
26 echo "scripts/build-windows.sh no longer sets GPUI_FXC_PATH; update packaging/kvt/build-windows.sh" >&2
27 exit 1
28 }
29 # The copy lives in /tmp; point its repoRoot at this checkout.
30 sed -i "s#^repoRoot=.*#repoRoot=\"$ROOT\"#" "$script"
31 export CARGO_TARGET_DIR="$ROOT/target"
32 bash "$script" "$ROOT/crates/app" teams
@@ -0,0 +1,32 @@
1#!/usr/bin/env bash
2# KVT fork: cross-build target/x86_64-pc-windows-msvc/release/teams.exe in a Linux
3# CI container. Wraps upstream's scripts/build-windows.sh (cargo-xwin, patched
4# gpui-pre-windows, embedded onnxruntime.dll) and swaps its WSL fxc for
5# packaging/kvt/fxc-wine.sh. Keeping upstream's script as is keeps merges small.
6set -euo pipefail
7ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
8# Microsoft.Windows.SDK.CPP from nuget.org carries fxc.exe and d3dcompiler_47.dll.
9SDK_VERSION="${KVT_WINDOWS_SDK_VERSION:-10.0.28000.2957}"
10SDK_SHA256="${KVT_WINDOWS_SDK_SHA256:-f0a200dae58858f418b30dc9e2f52b4188f97eb7837bd4f73074652a01937ddd}"
11export FXC_DIR="${FXC_DIR:-$ROOT/target/kvt-fxc/$SDK_VERSION}"
12if [[ ! -f "$FXC_DIR/fxc.exe" || ! -f "$FXC_DIR/d3dcompiler_47.dll" ]]; then
13 mkdir -p "$FXC_DIR"
14 nupkg="$FXC_DIR/sdk.nupkg"
15 curl -fsSL --retry 3 -o "$nupkg" \
16 "https://api.nuget.org/v3-flatcontainer/microsoft.windows.sdk.cpp/$SDK_VERSION/microsoft.windows.sdk.cpp.$SDK_VERSION.nupkg"
17 echo "$SDK_SHA256 $nupkg" | sha256sum -c -
18 unzip -o -q -j "$nupkg" "c/bin/${SDK_VERSION%.*}.0/x64/fxc.exe" "c/bin/${SDK_VERSION%.*}.0/x64/d3dcompiler_47.dll" -d "$FXC_DIR"
19 rm -f "$nupkg"
20fi
21script="$(mktemp)"
22trap 'rm -f "$script"' EXIT
23sed 's#^export GPUI_FXC_PATH=.*#export GPUI_FXC_PATH="$repoRoot/packaging/kvt/fxc-wine.sh"#' \
24 "$ROOT/scripts/build-windows.sh" > "$script"
25grep -q 'packaging/kvt/fxc-wine.sh' "$script" || {
26 echo "scripts/build-windows.sh no longer sets GPUI_FXC_PATH; update packaging/kvt/build-windows.sh" >&2
27 exit 1
28}
29# The copy lives in /tmp; point its repoRoot at this checkout.
30sed -i "s#^repoRoot=.*#repoRoot=\"$ROOT\"#" "$script"
31export CARGO_TARGET_DIR="$ROOT/target"
32bash "$script" "$ROOT/crates/app" teams
packaging/kvt/ci-setup.sh added +43 −0
@@ -0,0 +1,43 @@
1 #!/usr/bin/env bash
2 # KVT fork: tools for the BlueGit CI jobs in blue-ci-cd.yml, on an Ubuntu image.
3 # ci-setup.sh linux Linux build (as .github/actions/setup-linux): headers, clang 21, mold
4 # ci-setup.sh windows the above plus the cross-build bits: lld/llvm 21, wine, cargo-xwin
5 # Rust comes from rustup (stable) into $CARGO_HOME, which the jobs cache.
6 set -euo pipefail
7 mode="${1:-linux}"
8 export DEBIAN_FRONTEND=noninteractive
9 apt-get update -qq
10 apt-get install -y -qq --no-install-recommends \
11 ca-certificates curl git gnupg lsb-release wget software-properties-common \
12 build-essential binutils file python3 unzip xz-utils patch jq \
13 clang mold pkg-config libclang-dev \
14 libglib2.0-dev libfontconfig-dev libasound2-dev libva-dev \
15 libxkbcommon-dev libxkbcommon-x11-dev \
16 libx11-dev libxcb1-dev libxext-dev libxfixes-dev libxdamage-dev \
17 libxrandr-dev libxcomposite-dev libwayland-dev libpipewire-0.3-dev \
18 desktop-file-utils >/dev/null
19 # webrtc-sys needs clang 21 (check_clang_version in vendor/webrtc-sys/build.rs).
20 curl -fsSL https://apt.llvm.org/llvm.sh -o /tmp/llvm.sh
21 bash /tmp/llvm.sh 21 >/dev/null
22 apt-get install -y -qq --no-install-recommends clang-21 >/dev/null
23 if [[ "$mode" == windows ]]; then
24 apt-get install -y -qq --no-install-recommends lld-21 llvm-21 clang-tools-21 wine64 >/dev/null
25 # cargo-xwin calls the plain names.
26 for tool in clang-cl lld-link llvm-lib llvm-rc llvm-ar llvm-dlltool; do
27 for candidate in "/usr/lib/llvm-21/bin/$tool" "/usr/bin/$tool-21"; do
28 [[ -x "$candidate" ]] && ln -sf "$candidate" "/usr/local/bin/$tool" && break
29 done
30 done
31 fi
32 if ! command -v cargo >/dev/null; then
33 curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable >/dev/null
34 fi
35 # shellcheck disable=SC1091
36 . "${CARGO_HOME:-$HOME/.cargo}/env"
37 rustup toolchain install stable --profile minimal >/dev/null
38 if [[ "$mode" == windows ]]; then
39 rustup target add x86_64-pc-windows-msvc >/dev/null
40 command -v cargo-xwin >/dev/null || cargo install cargo-xwin --locked >/dev/null
41 fi
42 rustc --version
43 clang-21 --version | head -n 1
@@ -0,0 +1,43 @@
1#!/usr/bin/env bash
2# KVT fork: tools for the BlueGit CI jobs in blue-ci-cd.yml, on an Ubuntu image.
3# ci-setup.sh linux Linux build (as .github/actions/setup-linux): headers, clang 21, mold
4# ci-setup.sh windows the above plus the cross-build bits: lld/llvm 21, wine, cargo-xwin
5# Rust comes from rustup (stable) into $CARGO_HOME, which the jobs cache.
6set -euo pipefail
7mode="${1:-linux}"
8export DEBIAN_FRONTEND=noninteractive
9apt-get update -qq
10apt-get install -y -qq --no-install-recommends \
11 ca-certificates curl git gnupg lsb-release wget software-properties-common \
12 build-essential binutils file python3 unzip xz-utils patch jq \
13 clang mold pkg-config libclang-dev \
14 libglib2.0-dev libfontconfig-dev libasound2-dev libva-dev \
15 libxkbcommon-dev libxkbcommon-x11-dev \
16 libx11-dev libxcb1-dev libxext-dev libxfixes-dev libxdamage-dev \
17 libxrandr-dev libxcomposite-dev libwayland-dev libpipewire-0.3-dev \
18 desktop-file-utils >/dev/null
19# webrtc-sys needs clang 21 (check_clang_version in vendor/webrtc-sys/build.rs).
20curl -fsSL https://apt.llvm.org/llvm.sh -o /tmp/llvm.sh
21bash /tmp/llvm.sh 21 >/dev/null
22apt-get install -y -qq --no-install-recommends clang-21 >/dev/null
23if [[ "$mode" == windows ]]; then
24 apt-get install -y -qq --no-install-recommends lld-21 llvm-21 clang-tools-21 wine64 >/dev/null
25 # cargo-xwin calls the plain names.
26 for tool in clang-cl lld-link llvm-lib llvm-rc llvm-ar llvm-dlltool; do
27 for candidate in "/usr/lib/llvm-21/bin/$tool" "/usr/bin/$tool-21"; do
28 [[ -x "$candidate" ]] && ln -sf "$candidate" "/usr/local/bin/$tool" && break
29 done
30 done
31fi
32if ! command -v cargo >/dev/null; then
33 curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable >/dev/null
34fi
35# shellcheck disable=SC1091
36. "${CARGO_HOME:-$HOME/.cargo}/env"
37rustup toolchain install stable --profile minimal >/dev/null
38if [[ "$mode" == windows ]]; then
39 rustup target add x86_64-pc-windows-msvc >/dev/null
40 command -v cargo-xwin >/dev/null || cargo install cargo-xwin --locked >/dev/null
41fi
42rustc --version
43clang-21 --version | head -n 1
packaging/kvt/fxc-wine.sh added +34 −0
@@ -0,0 +1,34 @@
1 #!/usr/bin/env bash
2 # KVT fork: fxc.exe stand-in for a Linux CI container (no Windows, no WSL).
3 # Runs Microsoft's own fxc.exe and d3dcompiler_47.dll from the Windows SDK NuGet
4 # package under wine, so the shaders are byte-for-byte what a Windows build makes.
5 # GPUI's build script calls it with: /T <target> /E <entry> /Fh <out.h> /Vn <name> /O3 <file.hlsl>
6 # Needs FXC_DIR (fxc.exe + d3dcompiler_47.dll, see build-windows.sh) and wine64.
7 set -euo pipefail
8 : "${FXC_DIR:?FXC_DIR must point at the folder with fxc.exe}"
9 wine="$(command -v wine64 || command -v wine || echo /usr/lib/wine/wine64)"
10 export WINEPREFIX="${WINEPREFIX:-$HOME/.wine-fxc}" WINEDEBUG=-all WINEDLLOVERRIDES="d3dcompiler_47=n"
11 winpath() { printf 'Z:%s' "$(realpath -m "$1" | tr / '\\')"; }
12 args=()
13 header=""
14 while (($#)); do
15 case "$1" in
16 /T|/E|/Vn) args+=("$1" "$2"); shift 2 ;;
17 /Fh) header="$2"; args+=("$1" "$(winpath "$2")"); shift 2 ;;
18 /O[0-3d]|/Zi|/WX|/Gec|/Ges) args+=("$1"); shift ;;
19 *) args+=("$(winpath "$1")"); shift ;;
20 esac
21 done
22 [[ -n "$header" ]] && rm -f "$header"
23 # fxc prints warnings and errors on stdout. wine's fxc can crash while exiting after
24 # a good compile, so the exit code alone does not count: the header must be written.
25 log="$(mktemp)"
26 trap 'rm -f "$log"' EXIT
27 status=0
28 "$wine" "$FXC_DIR/fxc.exe" /nologo "${args[@]}" >"$log" 2>&1 || status=$?
29 if [[ -n "$header" ]] && grep -q 'const BYTE' "$header" 2>/dev/null && grep -q 'compilation header save succeeded' "$log"; then
30 exit 0
31 fi
32 cat "$log" >&2
33 echo "fxc-wine: fxc failed (exit $status)" >&2
34 exit 1
@@ -0,0 +1,34 @@
1#!/usr/bin/env bash
2# KVT fork: fxc.exe stand-in for a Linux CI container (no Windows, no WSL).
3# Runs Microsoft's own fxc.exe and d3dcompiler_47.dll from the Windows SDK NuGet
4# package under wine, so the shaders are byte-for-byte what a Windows build makes.
5# GPUI's build script calls it with: /T <target> /E <entry> /Fh <out.h> /Vn <name> /O3 <file.hlsl>
6# Needs FXC_DIR (fxc.exe + d3dcompiler_47.dll, see build-windows.sh) and wine64.
7set -euo pipefail
8: "${FXC_DIR:?FXC_DIR must point at the folder with fxc.exe}"
9wine="$(command -v wine64 || command -v wine || echo /usr/lib/wine/wine64)"
10export WINEPREFIX="${WINEPREFIX:-$HOME/.wine-fxc}" WINEDEBUG=-all WINEDLLOVERRIDES="d3dcompiler_47=n"
11winpath() { printf 'Z:%s' "$(realpath -m "$1" | tr / '\\')"; }
12args=()
13header=""
14while (($#)); do
15 case "$1" in
16 /T|/E|/Vn) args+=("$1" "$2"); shift 2 ;;
17 /Fh) header="$2"; args+=("$1" "$(winpath "$2")"); shift 2 ;;
18 /O[0-3d]|/Zi|/WX|/Gec|/Ges) args+=("$1"); shift ;;
19 *) args+=("$(winpath "$1")"); shift ;;
20 esac
21done
22[[ -n "$header" ]] && rm -f "$header"
23# fxc prints warnings and errors on stdout. wine's fxc can crash while exiting after
24# a good compile, so the exit code alone does not count: the header must be written.
25log="$(mktemp)"
26trap 'rm -f "$log"' EXIT
27status=0
28"$wine" "$FXC_DIR/fxc.exe" /nologo "${args[@]}" >"$log" 2>&1 || status=$?
29if [[ -n "$header" ]] && grep -q 'const BYTE' "$header" 2>/dev/null && grep -q 'compilation header save succeeded' "$log"; then
30 exit 0
31fi
32cat "$log" >&2
33echo "fxc-wine: fxc failed (exit $status)" >&2
34exit 1
packaging/kvt/publish-aur.sh added +112 −0
@@ -0,0 +1,112 @@
1 #!/usr/bin/env bash
2 # KVT fork: publish the AUR package kvt-rusty-teams-bin for a release tag on git.kvt.nl.
3 #
4 # Same approach and secrets as BlueGit's publish_aur (git.timfalken.com/timfa/bluegit):
5 # AUR_SSH_PRIVATE_KEY or AUR_SSH_PRIVATE_KEY_B64 the AUR account's SSH key
6 # AUR_GIT_AUTHOR_NAME, AUR_GIT_AUTHOR_EMAIL name and e-mail in the AUR commit
7 # Without a key the script says so and exits 0: the release itself is not blocked.
8 #
9 # Usage: packaging/kvt/publish-aur.sh [tag] (default: $CI_COMMIT_TAG)
10 # packaging/kvt/publish-aur.sh --render <tag> <sha256> <out-dir> PKGBUILD only, for tests
11 set -euo pipefail
12
13 HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14 PKG="${AUR_PKG:-kvt-rusty-teams-bin}"
15 RELEASES="https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases"
16
17 # pkgver may not contain '-': v0.6.1-kvt.2 becomes 0.6.1.kvt.2 (vercmp still orders it).
18 pkgver_of_tag() {
19 local version="${1#v}"
20 [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][A-Za-z0-9.]+)?$ ]] || {
21 echo "tag is not v<major>.<minor>.<patch>[-suffix]: $1" >&2
22 return 1
23 }
24 printf '%s\n' "${version//-/.}"
25 }
26
27 render() {
28 local tag="$1" sha="$2" out="$3" pkgver
29 [[ "$sha" =~ ^[0-9a-f]{64}$ ]] || { echo "sha256 must be 64 hex chars" >&2; return 1; }
30 pkgver="$(pkgver_of_tag "$tag")"
31 mkdir -p "$out"
32 sed -e "s/^pkgver=.*/pkgver=${pkgver}/" \
33 -e "s/^pkgrel=.*/pkgrel=1/" \
34 -e "s/^_tag=.*/_tag=${tag}/" \
35 -e "s/^sha256sums=.*/sha256sums=('${sha}')/" \
36 "$HERE/aur/PKGBUILD" > "$out/PKGBUILD"
37 }
38
39 # makepkg refuses to run as root; CI jobs are root.
40 as_builder() {
41 if [[ "$(id -u)" -eq 0 ]]; then
42 id aurbuild >/dev/null 2>&1 || useradd --system --create-home --shell /bin/bash aurbuild
43 chown -R aurbuild:aurbuild "$1"
44 (cd "$1" && runuser -u aurbuild -- "${@:2}")
45 else
46 (cd "$1" && "${@:2}")
47 fi
48 }
49
50 if [[ "${1:-}" == "--render" ]]; then
51 render "${2:?tag}" "${3:?sha256}" "${4:?out-dir}"
52 exit 0
53 fi
54
55 TAG="${1:-${CI_COMMIT_TAG:-}}"
56 [[ -n "$TAG" ]] || { echo "No tag: run this in a tag pipeline or pass the tag." >&2; exit 1; }
57
58 if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" && -z "${AUR_SSH_PRIVATE_KEY_B64:-}" ]]; then
59 echo "AUR: geen AUR_SSH_PRIVATE_KEY of AUR_SSH_PRIVATE_KEY_B64 gezet; $PKG wordt overgeslagen."
60 echo "Zet die (beschermde) geheimen op ict/rusty-teams en bescherm het tagpatroon v*."
61 exit 0
62 fi
63
64 for cmd in git ssh curl sha256sum makepkg sed; do
65 command -v "$cmd" >/dev/null || { echo "Missing command: $cmd" >&2; exit 1; }
66 done
67
68 VERSION="${TAG#v}"
69 TARBALL="rusty-teams-${VERSION}-linux-x86_64.tar.gz"
70 WORKDIR="$(mktemp -d "${TMPDIR:-/tmp}/kvt-aur-XXXXXX")"
71 trap 'rm -rf "$WORKDIR"' EXIT
72 chmod 755 "$WORKDIR"
73
74 echo "Downloading $TARBALL from the $TAG release"
75 curl -fsSL --retry 3 "$RELEASES/$TAG/assets/$TARBALL" -o "$WORKDIR/$TARBALL"
76 SHA="$(sha256sum "$WORKDIR/$TARBALL" | awk '{print $1}')"
77
78 "$HERE/aur-ssh-setup.sh"
79 export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=yes -o BatchMode=yes"
80
81 dest="$WORKDIR/$PKG"
82 remote="ssh://aur@aur.archlinux.org/${PKG}.git"
83 echo "Cloning $remote"
84 if ! git clone -q "$remote" "$dest"; then
85 echo "AUR repo $PKG does not exist yet; it is created on the first push"
86 mkdir -p "$dest"
87 git -C "$dest" init -q
88 git -C "$dest" checkout -q -b master
89 git -C "$dest" remote add origin "$remote"
90 fi
91 git config --global --add safe.directory '*'
92
93 render "$TAG" "$SHA" "$dest"
94
95 # A real makepkg run: downloads the tarball again, checks the sum and packages it.
96 build="$WORKDIR/build"
97 mkdir -p "$build"
98 cp "$dest/PKGBUILD" "$build/"
99 as_builder "$build" makepkg --nodeps --noconfirm --force
100 as_builder "$build" makepkg --printsrcinfo > "$dest/.SRCINFO"
101
102 cd "$dest"
103 git config user.name "${AUR_GIT_AUTHOR_NAME:-KVT release bot}"
104 git config user.email "${AUR_GIT_AUTHOR_EMAIL:-hephaestus@noreply.kvt.nl}"
105 git add PKGBUILD .SRCINFO
106 if git rev-parse --verify -q HEAD >/dev/null && git diff --cached --quiet; then
107 echo "AUR repo already up to date: $PKG $TAG"
108 exit 0
109 fi
110 git commit -q -m "${TAG}"
111 git push -q origin HEAD:master
112 echo "AUR updated: $PKG $(pkgver_of_tag "$TAG")"
@@ -0,0 +1,112 @@
1#!/usr/bin/env bash
2# KVT fork: publish the AUR package kvt-rusty-teams-bin for a release tag on git.kvt.nl.
3#
4# Same approach and secrets as BlueGit's publish_aur (git.timfalken.com/timfa/bluegit):
5# AUR_SSH_PRIVATE_KEY or AUR_SSH_PRIVATE_KEY_B64 the AUR account's SSH key
6# AUR_GIT_AUTHOR_NAME, AUR_GIT_AUTHOR_EMAIL name and e-mail in the AUR commit
7# Without a key the script says so and exits 0: the release itself is not blocked.
8#
9# Usage: packaging/kvt/publish-aur.sh [tag] (default: $CI_COMMIT_TAG)
10# packaging/kvt/publish-aur.sh --render <tag> <sha256> <out-dir> PKGBUILD only, for tests
11set -euo pipefail
12
13HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14PKG="${AUR_PKG:-kvt-rusty-teams-bin}"
15RELEASES="https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases"
16
17# pkgver may not contain '-': v0.6.1-kvt.2 becomes 0.6.1.kvt.2 (vercmp still orders it).
18pkgver_of_tag() {
19 local version="${1#v}"
20 [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][A-Za-z0-9.]+)?$ ]] || {
21 echo "tag is not v<major>.<minor>.<patch>[-suffix]: $1" >&2
22 return 1
23 }
24 printf '%s\n' "${version//-/.}"
25}
26
27render() {
28 local tag="$1" sha="$2" out="$3" pkgver
29 [[ "$sha" =~ ^[0-9a-f]{64}$ ]] || { echo "sha256 must be 64 hex chars" >&2; return 1; }
30 pkgver="$(pkgver_of_tag "$tag")"
31 mkdir -p "$out"
32 sed -e "s/^pkgver=.*/pkgver=${pkgver}/" \
33 -e "s/^pkgrel=.*/pkgrel=1/" \
34 -e "s/^_tag=.*/_tag=${tag}/" \
35 -e "s/^sha256sums=.*/sha256sums=('${sha}')/" \
36 "$HERE/aur/PKGBUILD" > "$out/PKGBUILD"
37}
38
39# makepkg refuses to run as root; CI jobs are root.
40as_builder() {
41 if [[ "$(id -u)" -eq 0 ]]; then
42 id aurbuild >/dev/null 2>&1 || useradd --system --create-home --shell /bin/bash aurbuild
43 chown -R aurbuild:aurbuild "$1"
44 (cd "$1" && runuser -u aurbuild -- "${@:2}")
45 else
46 (cd "$1" && "${@:2}")
47 fi
48}
49
50if [[ "${1:-}" == "--render" ]]; then
51 render "${2:?tag}" "${3:?sha256}" "${4:?out-dir}"
52 exit 0
53fi
54
55TAG="${1:-${CI_COMMIT_TAG:-}}"
56[[ -n "$TAG" ]] || { echo "No tag: run this in a tag pipeline or pass the tag." >&2; exit 1; }
57
58if [[ -z "${AUR_SSH_PRIVATE_KEY:-}" && -z "${AUR_SSH_PRIVATE_KEY_B64:-}" ]]; then
59 echo "AUR: geen AUR_SSH_PRIVATE_KEY of AUR_SSH_PRIVATE_KEY_B64 gezet; $PKG wordt overgeslagen."
60 echo "Zet die (beschermde) geheimen op ict/rusty-teams en bescherm het tagpatroon v*."
61 exit 0
62fi
63
64for cmd in git ssh curl sha256sum makepkg sed; do
65 command -v "$cmd" >/dev/null || { echo "Missing command: $cmd" >&2; exit 1; }
66done
67
68VERSION="${TAG#v}"
69TARBALL="rusty-teams-${VERSION}-linux-x86_64.tar.gz"
70WORKDIR="$(mktemp -d "${TMPDIR:-/tmp}/kvt-aur-XXXXXX")"
71trap 'rm -rf "$WORKDIR"' EXIT
72chmod 755 "$WORKDIR"
73
74echo "Downloading $TARBALL from the $TAG release"
75curl -fsSL --retry 3 "$RELEASES/$TAG/assets/$TARBALL" -o "$WORKDIR/$TARBALL"
76SHA="$(sha256sum "$WORKDIR/$TARBALL" | awk '{print $1}')"
77
78"$HERE/aur-ssh-setup.sh"
79export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=yes -o BatchMode=yes"
80
81dest="$WORKDIR/$PKG"
82remote="ssh://aur@aur.archlinux.org/${PKG}.git"
83echo "Cloning $remote"
84if ! git clone -q "$remote" "$dest"; then
85 echo "AUR repo $PKG does not exist yet; it is created on the first push"
86 mkdir -p "$dest"
87 git -C "$dest" init -q
88 git -C "$dest" checkout -q -b master
89 git -C "$dest" remote add origin "$remote"
90fi
91git config --global --add safe.directory '*'
92
93render "$TAG" "$SHA" "$dest"
94
95# A real makepkg run: downloads the tarball again, checks the sum and packages it.
96build="$WORKDIR/build"
97mkdir -p "$build"
98cp "$dest/PKGBUILD" "$build/"
99as_builder "$build" makepkg --nodeps --noconfirm --force
100as_builder "$build" makepkg --printsrcinfo > "$dest/.SRCINFO"
101
102cd "$dest"
103git config user.name "${AUR_GIT_AUTHOR_NAME:-KVT release bot}"
104git config user.email "${AUR_GIT_AUTHOR_EMAIL:-hephaestus@noreply.kvt.nl}"
105git add PKGBUILD .SRCINFO
106if git rev-parse --verify -q HEAD >/dev/null && git diff --cached --quiet; then
107 echo "AUR repo already up to date: $PKG $TAG"
108 exit 0
109fi
110git commit -q -m "${TAG}"
111git push -q origin HEAD:master
112echo "AUR updated: $PKG $(pkgver_of_tag "$TAG")"
packaging/kvt/release-assets.sh added +55 −0
@@ -0,0 +1,55 @@
1 #!/usr/bin/env bash
2 # KVT fork: the release assets of a tag pipeline on git.kvt.nl.
3 # release-assets.sh sums <tag> writes dist/kvt/SHA256SUMS
4 # release-assets.sh json <tag> <commit> body for POST .../releases/<tag>/assets
5 #
6 # BlueGit artifacts have fixed paths, so the build jobs write fixed names under
7 # dist/kvt and the release gives each file its versioned name. The updater and the
8 # AUR package look for exactly these names:
9 # rusty-teams-<v>-linux-amd64 bare binary, Linux self-update (linux_release)
10 # rusty-teams-<v>-linux-x86_64.tar.gz FHS tree, source of kvt-rusty-teams-bin (linux_release)
11 # rusty-teams-<v>-windows-amd64.exe Windows self-update (windows_release)
12 # SHA256SUMS the updater checks these before it installs (checksums)
13 # The Windows exe is left out when windows_release failed (it has allow_failure).
14 set -euo pipefail
15 DIST="${DIST:-dist/kvt}"
16
17 # job|artifact path|asset suffix
18 TABLE="linux_release|teams-linux-amd64|-linux-amd64
19 linux_release|linux-x86_64.tar.gz|-linux-x86_64.tar.gz
20 windows_release|teams-windows-amd64.exe|-windows-amd64.exe"
21
22 present() {
23 local version="${1#v}" job file suffix
24 while IFS='|' read -r job file suffix; do
25 [[ -f "$DIST/$file" ]] && printf '%s|%s|%s\n' "$job" "$DIST/$file" "rusty-teams-$version$suffix"
26 done <<<"$TABLE"
27 return 0
28 }
29
30 case "${1:-}" in
31 sums)
32 tag="${2:?tag}"
33 for required in teams-linux-amd64 linux-x86_64.tar.gz; do
34 [[ -f "$DIST/$required" ]] || { echo "missing $DIST/$required (job linux_release)" >&2; exit 1; }
35 done
36 [[ -f "$DIST/teams-windows-amd64.exe" ]] ||
37 echo "WARNING: no Windows build in this release (windows_release failed); Windows installs are not offered it." >&2
38 : > "$DIST/SHA256SUMS.tmp"
39 while IFS='|' read -r _job path name; do
40 printf '%s %s\n' "$(sha256sum "$path" | awk '{print $1}')" "$name" >> "$DIST/SHA256SUMS.tmp"
41 done < <(present "$tag")
42 mv "$DIST/SHA256SUMS.tmp" "$DIST/SHA256SUMS"
43 cat "$DIST/SHA256SUMS"
44 ;;
45 json)
46 tag="${2:?tag}" commit="${3:?commit}"
47 [[ "$commit" =~ ^[0-9a-f]{40}$ ]] || { echo "commit must be a full sha" >&2; exit 1; }
48 printf '{"commit":"%s","name":"%s","body":"Rusty Teams (KVT) %s","assets":[' "$commit" "$tag" "$tag"
49 while IFS='|' read -r job path name; do
50 printf '{"job":"%s","path":"%s","name":"%s"},' "$job" "$path" "$name"
51 done < <(present "$tag")
52 printf '{"job":"checksums","path":"%s/SHA256SUMS","name":"SHA256SUMS"}]}\n' "$DIST"
53 ;;
54 *) echo "usage: $0 sums <tag> | json <tag> <commit>" >&2; exit 2 ;;
55 esac
@@ -0,0 +1,55 @@
1#!/usr/bin/env bash
2# KVT fork: the release assets of a tag pipeline on git.kvt.nl.
3# release-assets.sh sums <tag> writes dist/kvt/SHA256SUMS
4# release-assets.sh json <tag> <commit> body for POST .../releases/<tag>/assets
5#
6# BlueGit artifacts have fixed paths, so the build jobs write fixed names under
7# dist/kvt and the release gives each file its versioned name. The updater and the
8# AUR package look for exactly these names:
9# rusty-teams-<v>-linux-amd64 bare binary, Linux self-update (linux_release)
10# rusty-teams-<v>-linux-x86_64.tar.gz FHS tree, source of kvt-rusty-teams-bin (linux_release)
11# rusty-teams-<v>-windows-amd64.exe Windows self-update (windows_release)
12# SHA256SUMS the updater checks these before it installs (checksums)
13# The Windows exe is left out when windows_release failed (it has allow_failure).
14set -euo pipefail
15DIST="${DIST:-dist/kvt}"
16
17# job|artifact path|asset suffix
18TABLE="linux_release|teams-linux-amd64|-linux-amd64
19linux_release|linux-x86_64.tar.gz|-linux-x86_64.tar.gz
20windows_release|teams-windows-amd64.exe|-windows-amd64.exe"
21
22present() {
23 local version="${1#v}" job file suffix
24 while IFS='|' read -r job file suffix; do
25 [[ -f "$DIST/$file" ]] && printf '%s|%s|%s\n' "$job" "$DIST/$file" "rusty-teams-$version$suffix"
26 done <<<"$TABLE"
27 return 0
28}
29
30case "${1:-}" in
31 sums)
32 tag="${2:?tag}"
33 for required in teams-linux-amd64 linux-x86_64.tar.gz; do
34 [[ -f "$DIST/$required" ]] || { echo "missing $DIST/$required (job linux_release)" >&2; exit 1; }
35 done
36 [[ -f "$DIST/teams-windows-amd64.exe" ]] ||
37 echo "WARNING: no Windows build in this release (windows_release failed); Windows installs are not offered it." >&2
38 : > "$DIST/SHA256SUMS.tmp"
39 while IFS='|' read -r _job path name; do
40 printf '%s %s\n' "$(sha256sum "$path" | awk '{print $1}')" "$name" >> "$DIST/SHA256SUMS.tmp"
41 done < <(present "$tag")
42 mv "$DIST/SHA256SUMS.tmp" "$DIST/SHA256SUMS"
43 cat "$DIST/SHA256SUMS"
44 ;;
45 json)
46 tag="${2:?tag}" commit="${3:?commit}"
47 [[ "$commit" =~ ^[0-9a-f]{40}$ ]] || { echo "commit must be a full sha" >&2; exit 1; }
48 printf '{"commit":"%s","name":"%s","body":"Rusty Teams (KVT) %s","assets":[' "$commit" "$tag" "$tag"
49 while IFS='|' read -r job path name; do
50 printf '{"job":"%s","path":"%s","name":"%s"},' "$job" "$path" "$name"
51 done < <(present "$tag")
52 printf '{"job":"checksums","path":"%s/SHA256SUMS","name":"SHA256SUMS"}]}\n' "$DIST"
53 ;;
54 *) echo "usage: $0 sums <tag> | json <tag> <commit>" >&2; exit 2 ;;
55esac
packaging/kvt/tests.sh added +58 −0
@@ -0,0 +1,58 @@
1 #!/usr/bin/env bash
2 # KVT fork: tests for the scripts in packaging/kvt (no network, no secrets).
3 set -euo pipefail
4 HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5 work="$(mktemp -d)"
6 trap 'rm -rf "$work"' EXIT
7 fail() { echo "FAIL: $*" >&2; exit 1; }
8 sha="$(printf 'a%.0s' $(seq 64))"
9 commit="$(printf '0%.0s' $(seq 40))"
10
11 # PKGBUILD: version, tag, checksum, provides/conflicts, marker file.
12 "$HERE/publish-aur.sh" --render v0.6.1-kvt.2 "$sha" "$work/aur"
13 p="$work/aur/PKGBUILD"
14 grep -qx 'pkgver=0.6.1.kvt.2' "$p" || fail "pkgver"
15 grep -qx '_tag=v0.6.1-kvt.2' "$p" || fail "_tag"
16 grep -qx "sha256sums=('$sha')" "$p" || fail "sha256sums"
17 grep -qx "provides=('rusty-teams')" "$p" || fail "provides"
18 grep -q "^conflicts=('rusty-teams'" "$p" || fail "conflicts"
19 grep -q '/usr/lib/rusty-teams/package-managed' "$p" || fail "package-managed marker"
20 grep -q 'rusty-teams.desktop' "$p" || fail "desktop file"
21 # shellcheck disable=SC1090
22 ( source "$p"; [[ "${source[0]}" == "rusty-teams-0.6.1-kvt.2-linux-x86_64.tar.gz::https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases/v0.6.1-kvt.2/assets/rusty-teams-0.6.1-kvt.2-linux-x86_64.tar.gz" ]] ) || fail "source url"
23 ! "$HERE/publish-aur.sh" --render v0.6.1-kvt.2 nothex "$work/x" 2>/dev/null || fail "bad sha accepted"
24 ! "$HERE/publish-aur.sh" --render 0.6 "$sha" "$work/x" 2>/dev/null || fail "bad tag accepted"
25 [[ "$(grep -c '^pkgver=' "$HERE/aur/PKGBUILD")" == 1 ]] || fail "template pkgver"
26
27 # No AUR key: a clear message and exit 0.
28 out="$(env -u AUR_SSH_PRIVATE_KEY -u AUR_SSH_PRIVATE_KEY_B64 "$HERE/publish-aur.sh" v0.6.1-kvt.2)" || fail "skip must exit 0"
29 grep -q 'overgeslagen' <<<"$out" || fail "skip message"
30
31 # Release assets: versioned names, sums, the Windows exe only when it exists.
32 mkdir -p "$work/r/dist/kvt"
33 cd "$work/r"
34 echo linux > dist/kvt/teams-linux-amd64
35 echo tar > dist/kvt/linux-x86_64.tar.gz
36 "$HERE/release-assets.sh" sums v0.6.1-kvt.2 >/dev/null 2>&1
37 [[ "$(wc -l < dist/kvt/SHA256SUMS)" == 2 ]] || fail "sums without windows"
38 grep -q " rusty-teams-0.6.1-kvt.2-linux-amd64$" dist/kvt/SHA256SUMS || fail "linux sum name"
39 echo exe > dist/kvt/teams-windows-amd64.exe
40 "$HERE/release-assets.sh" sums v0.6.1-kvt.2 >/dev/null
41 [[ "$(wc -l < dist/kvt/SHA256SUMS)" == 3 ]] || fail "sums with windows"
42 (cd dist/kvt && cp teams-windows-amd64.exe rusty-teams-0.6.1-kvt.2-windows-amd64.exe &&
43 grep windows SHA256SUMS | sha256sum -c - >/dev/null) || fail "windows sum"
44 json="$("$HERE/release-assets.sh" json v0.6.1-kvt.2 "$commit")"
45 python3 - "$json" <<'PY' || fail "release json"
46 import json, sys
47 body = json.loads(sys.argv[1])
48 names = {a["name"]: (a["job"], a["path"]) for a in body["assets"]}
49 assert body["name"] == "v0.6.1-kvt.2" and len(body["commit"]) == 40
50 assert names["rusty-teams-0.6.1-kvt.2-linux-amd64"] == ("linux_release", "dist/kvt/teams-linux-amd64")
51 assert names["rusty-teams-0.6.1-kvt.2-windows-amd64.exe"][0] == "windows_release"
52 assert names["SHA256SUMS"] == ("checksums", "dist/kvt/SHA256SUMS")
53 assert len(names) == 4
54 PY
55 rm dist/kvt/teams-linux-amd64
56 ! "$HERE/release-assets.sh" sums v0.6.1-kvt.2 2>/dev/null || fail "missing linux binary accepted"
57
58 echo "packaging/kvt tests: ok"
@@ -0,0 +1,58 @@
1#!/usr/bin/env bash
2# KVT fork: tests for the scripts in packaging/kvt (no network, no secrets).
3set -euo pipefail
4HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5work="$(mktemp -d)"
6trap 'rm -rf "$work"' EXIT
7fail() { echo "FAIL: $*" >&2; exit 1; }
8sha="$(printf 'a%.0s' $(seq 64))"
9commit="$(printf '0%.0s' $(seq 40))"
10
11# PKGBUILD: version, tag, checksum, provides/conflicts, marker file.
12"$HERE/publish-aur.sh" --render v0.6.1-kvt.2 "$sha" "$work/aur"
13p="$work/aur/PKGBUILD"
14grep -qx 'pkgver=0.6.1.kvt.2' "$p" || fail "pkgver"
15grep -qx '_tag=v0.6.1-kvt.2' "$p" || fail "_tag"
16grep -qx "sha256sums=('$sha')" "$p" || fail "sha256sums"
17grep -qx "provides=('rusty-teams')" "$p" || fail "provides"
18grep -q "^conflicts=('rusty-teams'" "$p" || fail "conflicts"
19grep -q '/usr/lib/rusty-teams/package-managed' "$p" || fail "package-managed marker"
20grep -q 'rusty-teams.desktop' "$p" || fail "desktop file"
21# shellcheck disable=SC1090
22( source "$p"; [[ "${source[0]}" == "rusty-teams-0.6.1-kvt.2-linux-x86_64.tar.gz::https://git.kvt.nl/api/v1/projects/ict/rusty-teams/releases/v0.6.1-kvt.2/assets/rusty-teams-0.6.1-kvt.2-linux-x86_64.tar.gz" ]] ) || fail "source url"
23! "$HERE/publish-aur.sh" --render v0.6.1-kvt.2 nothex "$work/x" 2>/dev/null || fail "bad sha accepted"
24! "$HERE/publish-aur.sh" --render 0.6 "$sha" "$work/x" 2>/dev/null || fail "bad tag accepted"
25[[ "$(grep -c '^pkgver=' "$HERE/aur/PKGBUILD")" == 1 ]] || fail "template pkgver"
26
27# No AUR key: a clear message and exit 0.
28out="$(env -u AUR_SSH_PRIVATE_KEY -u AUR_SSH_PRIVATE_KEY_B64 "$HERE/publish-aur.sh" v0.6.1-kvt.2)" || fail "skip must exit 0"
29grep -q 'overgeslagen' <<<"$out" || fail "skip message"
30
31# Release assets: versioned names, sums, the Windows exe only when it exists.
32mkdir -p "$work/r/dist/kvt"
33cd "$work/r"
34echo linux > dist/kvt/teams-linux-amd64
35echo tar > dist/kvt/linux-x86_64.tar.gz
36"$HERE/release-assets.sh" sums v0.6.1-kvt.2 >/dev/null 2>&1
37[[ "$(wc -l < dist/kvt/SHA256SUMS)" == 2 ]] || fail "sums without windows"
38grep -q " rusty-teams-0.6.1-kvt.2-linux-amd64$" dist/kvt/SHA256SUMS || fail "linux sum name"
39echo exe > dist/kvt/teams-windows-amd64.exe
40"$HERE/release-assets.sh" sums v0.6.1-kvt.2 >/dev/null
41[[ "$(wc -l < dist/kvt/SHA256SUMS)" == 3 ]] || fail "sums with windows"
42(cd dist/kvt && cp teams-windows-amd64.exe rusty-teams-0.6.1-kvt.2-windows-amd64.exe &&
43 grep windows SHA256SUMS | sha256sum -c - >/dev/null) || fail "windows sum"
44json="$("$HERE/release-assets.sh" json v0.6.1-kvt.2 "$commit")"
45python3 - "$json" <<'PY' || fail "release json"
46import json, sys
47body = json.loads(sys.argv[1])
48names = {a["name"]: (a["job"], a["path"]) for a in body["assets"]}
49assert body["name"] == "v0.6.1-kvt.2" and len(body["commit"]) == 40
50assert names["rusty-teams-0.6.1-kvt.2-linux-amd64"] == ("linux_release", "dist/kvt/teams-linux-amd64")
51assert names["rusty-teams-0.6.1-kvt.2-windows-amd64.exe"][0] == "windows_release"
52assert names["SHA256SUMS"] == ("checksums", "dist/kvt/SHA256SUMS")
53assert len(names) == 4
54PY
55rm dist/kvt/teams-linux-amd64
56! "$HERE/release-assets.sh" sums v0.6.1-kvt.2 2>/dev/null || fail "missing linux binary accepted"
57
58echo "packaging/kvt tests: ok"