1- name : ЦУП Альтаир — Windows installer
1+ name : ЦУП Альтаир v8 — Windows installer
22
33on :
44 push :
@@ -20,19 +20,19 @@ jobs:
2020 - name : Checkout repository
2121 uses : actions/checkout@v4
2222
23- - name : Compile v7 LaTeX manual
23+ - name : Compile v8 LaTeX manual
2424 uses : xu-cheng/latex-action@v4
2525 with :
26- root_file : CUP_Altair_v7_Manual .tex
26+ root_file : CUP_Altair_v8_Manual .tex
2727 working_directory : docs
2828 work_in_root_file_dir : true
2929 latexmk_use_xelatex : true
3030
3131 - name : Upload PDF manual
3232 uses : actions/upload-artifact@v4
3333 with :
34- name : CUP-Altair-v7 -Manual
35- path : docs/CUP_Altair_v7_Manual .pdf
34+ name : CUP-Altair-v8 -Manual
35+ path : docs/CUP_Altair_v8_Manual .pdf
3636 if-no-files-found : error
3737 retention-days : 30
3838
4747 - name : Download compiled PDF manual
4848 uses : actions/download-artifact@v4
4949 with :
50- name : CUP-Altair-v7 -Manual
50+ name : CUP-Altair-v8 -Manual
5151 path : docs
5252
5353 - name : Set up Python
@@ -58,11 +58,11 @@ jobs:
5858 - name : Install PlatformIO
5959 run : python -m pip install --upgrade platformio
6060
61- - name : Verify ESP32 release sources are identical
61+ - name : Verify ESP32 v8 release sources are identical
6262 shell : pwsh
6363 run : |
64- $ino = "firmware/radio_gateway_esp32/Altair_Gateway_v7/Altair_Gateway_v7 .ino"
65- $cpp = "firmware/radio_gateway_esp32/src/main_v7 .cpp"
64+ $ino = "firmware/radio_gateway_esp32/Altair_Gateway_v8/Altair_Gateway_v8 .ino"
65+ $cpp = "firmware/radio_gateway_esp32/src/main_v8 .cpp"
6666 $inoHash = (Get-FileHash -Algorithm SHA256 $ino).Hash
6767 $cppHash = (Get-FileHash -Algorithm SHA256 $cpp).Hash
6868 Write-Host "Arduino sketch SHA256: $inoHash"
@@ -71,21 +71,18 @@ jobs:
7171 throw "ESP32 Arduino sketch and bundled PlatformIO source differ. Release blocked."
7272 }
7373
74- - name : Compile ESP32 radio gateway v7.1
74+ - name : Compile ESP32 radio gateway v8
7575 run : pio run -d firmware/radio_gateway_esp32
7676
77- - name : Compile STM32 v7 transmitter reference
78- run : pio run -d firmware/transmitter_stm32_v7
79-
8077 - name : Prepare bundled ESP32 firmware
8178 shell : pwsh
8279 run : |
8380 $ErrorActionPreference = "Stop"
8481 $buildDir = "firmware/radio_gateway_esp32/.pio/build/esp32dev"
85- $sourceCode = Get-Content "firmware/radio_gateway_esp32/src/main_v7 .cpp" -Raw
82+ $sourceCode = Get-Content "firmware/radio_gateway_esp32/src/main_v8 .cpp" -Raw
8683
87- if ($sourceCode -notmatch 'FW_VERSION_V7 \[\]\s*=\s*"([^"]+)"') {
88- throw "Unable to read FW_VERSION_V7 from ESP32 gateway source."
84+ if ($sourceCode -notmatch 'FW_VERSION \[\]\s*=\s*"([^"]+)"') {
85+ throw "Unable to read FW_VERSION from ESP32 gateway source."
8986 }
9087 $firmwareVersion = $Matches[1]
9188
9794 @{ Source = "$buildDir/bootloader.bin"; File = "gateway-bootloader.bin"; Label = "Bootloader"; Address = 4096 },
9895 @{ Source = "$buildDir/partitions.bin"; File = "gateway-partitions.bin"; Label = "Partition table"; Address = 32768 },
9996 @{ Source = $bootApp0.FullName; File = "gateway-boot_app0.bin"; Label = "boot_app0"; Address = 57344 },
100- @{ Source = "$buildDir/firmware.bin"; File = "gateway-firmware.bin"; Label = "Altair v7.1 radio gateway"; Address = 65536 }
97+ @{ Source = "$buildDir/firmware.bin"; File = "gateway-firmware.bin"; Label = "Altair v8 radio gateway"; Address = 65536 }
10198 )
10299
103100 $manifestImages = @()
@@ -107,7 +104,13 @@ jobs:
107104 Copy-Item $image.Source $target -Force
108105 $fileInfo = Get-Item $target
109106 $md5 = (Get-FileHash -Algorithm MD5 $target).Hash.ToLowerInvariant()
110- $manifestImages += [ordered]@{ file=$image.File; label=$image.Label; address=$image.Address; size=$fileInfo.Length; md5=$md5 }
107+ $manifestImages += [ordered]@{
108+ file=$image.File
109+ label=$image.Label
110+ address=$image.Address
111+ size=$fileInfo.Length
112+ md5=$md5
113+ }
111114 }
112115
113116 $appVersion = (Get-Content package.json -Raw | ConvertFrom-Json).version
@@ -117,7 +120,7 @@ jobs:
117120 targetChip = "ESP32"
118121 firmwareVersion = $firmwareVersion
119122 applicationVersion = $appVersion
120- buildLabel = "Altair MCC v$appVersion / v7.1-proven-rx-bw203 "
123+ buildLabel = "Altair MCC v$appVersion / v8-rx203-xor-bypass-rftx "
121124 flashMode = "dio"
122125 flashFreq = "40m"
123126 flashSize = "4MB"
@@ -137,21 +140,20 @@ jobs:
137140 - name : Build Windows installer
138141 run : npm run dist:win
139142
140- - name : Upload Windows installer artifact
143+ - name : Upload v8 artifact
141144 uses : actions/upload-artifact@v4
142145 with :
143- name : CUP-Altair-v7.1 -Windows-Installer
146+ name : CUP-Altair-v8 -Windows-Installer
144147 path : |
145148 release/*.exe
146149 release/*.yml
147150 release/*.blockmap
148151 bundled_firmware/*.json
149152 bundled_firmware/*.bin
150- firmware/radio_gateway_esp32/Altair_Gateway_v7/Altair_Gateway_v7.ino
151- firmware/transmitter_stm32_v7/Transmit_v7_static/Transmit_v7_static.ino
152- docs/CUP_Altair_v7_Manual.pdf
153- docs/CUP_Altair_v7_Manual.tex
154- docs/RELEASE_V7.md
153+ firmware/radio_gateway_esp32/Altair_Gateway_v8/Altair_Gateway_v8.ino
154+ docs/CUP_Altair_v8_Manual.pdf
155+ docs/CUP_Altair_v8_Manual.tex
156+ docs/RELEASE_V8.md
155157 if-no-files-found : error
156158 retention-days : 30
157159
@@ -164,31 +166,51 @@ jobs:
164166 "version=$version" >> $env:GITHUB_OUTPUT
165167 "tag=v$version" >> $env:GITHUB_OUTPUT
166168
167- - name : Publish GitHub Release when this version is new
169+ - name : Publish GitHub Release v8
168170 if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
169171 shell : pwsh
170172 env :
171173 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
172174 RELEASE_TAG : ${{ steps.app_version.outputs.tag }}
173175 run : |
174176 gh release view $env:RELEASE_TAG *> $null
175- if ($LASTEXITCODE -eq 0) {
177+ if ($LASTEXITCODE -ne 0) {
178+ $installer = Get-ChildItem -Path release -Filter "CUP-Altair-Setup-*.exe" | Select-Object -First 1
179+ if (-not $installer) { throw "Altair Windows installer was not found in release/." }
180+
181+ gh release create $env:RELEASE_TAG `
182+ $installer.FullName `
183+ "firmware/radio_gateway_esp32/Altair_Gateway_v8/Altair_Gateway_v8.ino" `
184+ "docs/CUP_Altair_v8_Manual.pdf" `
185+ "docs/CUP_Altair_v8_Manual.tex" `
186+ "docs/RELEASE_V8.md" `
187+ "bundled_firmware/gateway-firmware.bin" `
188+ "bundled_firmware/manifest.json" `
189+ --target main `
190+ --title "ЦУП Альтаир v8 ($env:RELEASE_TAG) — Миссия на Луну" `
191+ --notes-file "docs/RELEASE_V8.md" `
192+ --latest
193+ if ($LASTEXITCODE -ne 0) { throw "Unable to publish $env:RELEASE_TAG" }
194+ } else {
176195 Write-Host "Release $env:RELEASE_TAG already exists."
177- exit 0
178196 }
179- $installer = Get-ChildItem -Path release -Filter "CUP-Altair-Setup-*.exe" | Select-Object -First 1
180- if (-not $installer) { throw "Altair Windows installer was not found in release/." }
181-
182- gh release create $env:RELEASE_TAG `
183- $installer.FullName `
184- "firmware/radio_gateway_esp32/Altair_Gateway_v7/Altair_Gateway_v7.ino" `
185- "firmware/transmitter_stm32_v7/Transmit_v7_static/Transmit_v7_static.ino" `
186- "docs/CUP_Altair_v7_Manual.pdf" `
187- "docs/CUP_Altair_v7_Manual.tex" `
188- "docs/RELEASE_V7.md" `
189- "bundled_firmware/gateway-firmware.bin" `
190- "bundled_firmware/manifest.json" `
191- --target main `
192- --title "ЦУП Альтаир v7.1 ($env:RELEASE_TAG) — Технопром 2026. Миссия на Луну" `
193- --notes-file "docs/RELEASE_V7.md" `
194- --latest
197+
198+ - name : Remove previous GitHub releases after v8 is published
199+ if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
200+ shell : pwsh
201+ env :
202+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
203+ RELEASE_TAG : ${{ steps.app_version.outputs.tag }}
204+ run : |
205+ $ErrorActionPreference = "Stop"
206+ gh release view $env:RELEASE_TAG *> $null
207+ if ($LASTEXITCODE -ne 0) { throw "Current release $env:RELEASE_TAG is not published; old releases will not be removed." }
208+
209+ $tags = gh release list --limit 100 --json tagName --jq '.[].tagName'
210+ foreach ($tag in $tags) {
211+ if ($tag -and $tag -ne $env:RELEASE_TAG) {
212+ Write-Host "Deleting old release: $tag"
213+ gh release delete $tag --yes --cleanup-tag
214+ if ($LASTEXITCODE -ne 0) { throw "Unable to delete old release $tag" }
215+ }
216+ }
0 commit comments