From 3bf2018a62bc79c521dda6ee0f0e63ebf67b6d64 Mon Sep 17 00:00:00 2001 From: Aleksandr Neychev Date: Tue, 11 Aug 2026 15:56:23 +0500 Subject: [PATCH] fixed release version in pipeline --- .gitea/workflows/release.yml | 20 ++++++++++++-------- README.RU.md | 6 ++++-- README.md | 6 ++++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index e4215da..26fcac1 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -1,5 +1,6 @@ -# The release: a tag of the form v1.2.3.0 builds the solution, runs the tests -# and packs the MSIX with the version taken from the tag. +# The release: a tag of the form v1.2.3 builds the solution, runs the tests and +# packs the MSIX with the version taken from the tag — three numbers of the tag +# and a zero the Store keeps for itself. # # The same requirements to the runner as in pull-request.yml apply: Windows, the # .NET 10 SDK and an interactive desktop session for the tests. makeappx comes @@ -58,20 +59,23 @@ jobs: throw "Git LFS left pointers instead of files: $($pointers -join ', ')." } - # The tag is the only place the version comes from: the Store takes four - # numbers ending in zero, so anything else is stopped here rather than - # halfway through the packaging + # The tag is the only place the version comes from, and it is a plain + # version of three numbers — the same shape the application itself looks + # for in the releases when it checks for an update. A tag of any other + # shape is stopped here rather than halfway through the packaging - name: Read the version from the tag id: version run: | $ErrorActionPreference = 'Stop' $tag = '${{ github.ref_name }}' - if ($tag -notmatch '^v\d+\.\d+\.\d+\.0$') { - throw "The tag '$tag' does not fit: a release is tagged as v1.2.3.0 — four numbers ending in zero." + if ($tag -notmatch '^v\d+\.\d+\.\d+$') { + throw "The tag '$tag' does not fit: a release is tagged as v1.2.3 — three numbers. A fourth one does not belong in the tag: the Store keeps the revision for itself, and the package always gets a zero there." } - "version=$($tag.Substring(1))" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8 + # The package takes four numbers with a zero at the end: the Store + # reserves the last one, so it carries nothing the tag could tell + "version=$($tag.Substring(1)).0" | Out-File $env:GITHUB_OUTPUT -Append -Encoding utf8 - name: Show the toolchain run: dotnet --info diff --git a/README.RU.md b/README.RU.md index 6b62632..d61735a 100644 --- a/README.RU.md +++ b/README.RU.md @@ -138,10 +138,12 @@ dotnet test --collect:"XPlat Code Coverage" --settings CursorLang.Tests\coverage ## Непрерывная сборка Пайплайны лежат в `.gitea/workflows` и работают на Gitea Actions. Запрос -на слияние в `master` собирается и проверяется тестами; по тегу вида `v1.2.3.0` +на слияние в `master` собирается и проверяется тестами; по тегу вида `v1.2.3` проект собирается, проходит тесты, пакуется в MSIX и выкладывается релизом с приложенными пакетами. Номер версии берётся только из тега — тег любого -другого вида останавливает прогон в самом начале. +другого вида останавливает прогон в самом начале. Версия пакета получается +`1.2.3.0`: Store принимает четыре числа и последнее оставляет себе, так что тег +на него не влияет. Обоим пайплайнам нужен runner под Windows с меткой `windows-x64`, на нём — .NET 10 SDK и git-lfs. Выгрузка исходников тянет файлы LFS: без них иконка diff --git a/README.md b/README.md index acd4146..42c057d 100644 --- a/README.md +++ b/README.md @@ -136,10 +136,12 @@ and the composition root in `App.xaml.cs`, which is exercised end-to-end instead ## Continuous integration The pipelines live in `.gitea/workflows` and run on Gitea Actions. A pull -request into `master` is built and tested; a tag of the form `v1.2.3.0` is built, +request into `master` is built and tested; a tag of the form `v1.2.3` is built, tested, packed into an MSIX and published as a release with the packages attached. The version is taken from the tag alone — a tag shaped any other way -stops the run right at the start. +stops the run right at the start. The package version ends up as `1.2.3.0`: the +Store takes four numbers and keeps the last one for itself, so the tag has no +say in it. Both pipelines ask for a Windows runner labelled `windows-x64` with the .NET 10 SDK and git-lfs on it. The checkout pulls LFS files: without them the icon is a