ЦУП Альтаир v7: рабочий радиоканал 203 кГц и финальная документация #52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ЦУП Альтаир — Windows installer | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-manual: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Compile v7 LaTeX manual | |
| uses: xu-cheng/latex-action@v4 | |
| with: | |
| root_file: docs/CUP_Altair_v7_Manual.tex | |
| latexmk_use_xelatex: true | |
| - name: Upload PDF manual | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: CUP-Altair-v7-Manual | |
| path: docs/CUP_Altair_v7_Manual.pdf | |
| if-no-files-found: error | |
| retention-days: 30 | |
| build-windows: | |
| needs: build-manual | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download compiled PDF manual | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: CUP-Altair-v7-Manual | |
| path: docs | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install PlatformIO | |
| run: python -m pip install --upgrade platformio | |
| - name: Compile ESP32 radio gateway v7 | |
| run: pio run -d firmware/radio_gateway_esp32 | |
| - name: Compile STM32 v7 transmitter reference | |
| run: pio run -d firmware/transmitter_stm32_v7 | |
| - name: Prepare bundled ESP32 firmware | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = "Stop" | |
| $buildDir = "firmware/radio_gateway_esp32/.pio/build/esp32dev" | |
| $sourceCode = Get-Content "firmware/radio_gateway_esp32/src/main_v7.cpp" -Raw | |
| if ($sourceCode -notmatch 'FW_VERSION_V7\[\]\s*=\s*"([^"]+)"') { | |
| throw "Unable to read FW_VERSION_V7 from ESP32 gateway source." | |
| } | |
| $firmwareVersion = $Matches[1] | |
| $bootApp0 = Get-ChildItem "$env:USERPROFILE/.platformio/packages" -Recurse -Filter "boot_app0.bin" | Select-Object -First 1 | |
| if (-not $bootApp0) { throw "boot_app0.bin was not found." } | |
| New-Item -ItemType Directory -Force "bundled_firmware" | Out-Null | |
| $images = @( | |
| @{ Source = "$buildDir/bootloader.bin"; File = "gateway-bootloader.bin"; Label = "Bootloader"; Address = 4096 }, | |
| @{ Source = "$buildDir/partitions.bin"; File = "gateway-partitions.bin"; Label = "Partition table"; Address = 32768 }, | |
| @{ Source = $bootApp0.FullName; File = "gateway-boot_app0.bin"; Label = "boot_app0"; Address = 57344 }, | |
| @{ Source = "$buildDir/firmware.bin"; File = "gateway-firmware.bin"; Label = "Altair v7 radio gateway"; Address = 65536 } | |
| ) | |
| $manifestImages = @() | |
| foreach ($image in $images) { | |
| if (-not (Test-Path $image.Source)) { throw "Firmware image not found: $($image.Source)" } | |
| $target = Join-Path "bundled_firmware" $image.File | |
| Copy-Item $image.Source $target -Force | |
| $fileInfo = Get-Item $target | |
| $md5 = (Get-FileHash -Algorithm MD5 $target).Hash.ToLowerInvariant() | |
| $manifestImages += [ordered]@{ file=$image.File; label=$image.Label; address=$image.Address; size=$fileInfo.Length; md5=$md5 } | |
| } | |
| $appVersion = (Get-Content package.json -Raw | ConvertFrom-Json).version | |
| $manifest = [ordered]@{ | |
| schemaVersion = 1 | |
| targetBoard = "ESP32-WROOM-32 / esp32dev" | |
| targetChip = "ESP32" | |
| firmwareVersion = $firmwareVersion | |
| applicationVersion = $appVersion | |
| buildLabel = "Altair MCC v$appVersion / v7-bw203" | |
| flashMode = "dio" | |
| flashFreq = "40m" | |
| flashSize = "4MB" | |
| eraseAll = $false | |
| images = $manifestImages | |
| } | |
| $manifest | ConvertTo-Json -Depth 6 | Set-Content "bundled_firmware/manifest.json" -Encoding utf8 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Install desktop build dependencies | |
| run: npm install --no-audit --no-fund | |
| - name: Build Windows installer | |
| run: npm run dist:win | |
| - name: Upload Windows installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: CUP-Altair-v7-Windows-Installer | |
| path: | | |
| release/*.exe | |
| release/*.yml | |
| release/*.blockmap | |
| bundled_firmware/*.json | |
| bundled_firmware/*.bin | |
| firmware/radio_gateway_esp32/Altair_Gateway_v7/Altair_Gateway_v7.ino | |
| firmware/transmitter_stm32_v7/Transmit_v7_static/Transmit_v7_static.ino | |
| docs/CUP_Altair_v7_Manual.pdf | |
| docs/CUP_Altair_v7_Manual.tex | |
| docs/RELEASE_V7.md | |
| if-no-files-found: error | |
| retention-days: 30 | |
| - name: Read application version | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| id: app_version | |
| shell: pwsh | |
| run: | | |
| $version = (Get-Content package.json -Raw | ConvertFrom-Json).version | |
| "version=$version" >> $env:GITHUB_OUTPUT | |
| "tag=v$version" >> $env:GITHUB_OUTPUT | |
| - name: Publish GitHub Release when this version is new | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| shell: pwsh | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RELEASE_TAG: ${{ steps.app_version.outputs.tag }} | |
| run: | | |
| gh release view $env:RELEASE_TAG *> $null | |
| if ($LASTEXITCODE -eq 0) { | |
| Write-Host "Release $env:RELEASE_TAG already exists." | |
| exit 0 | |
| } | |
| $installer = Get-ChildItem -Path release -Filter "CUP-Altair-Setup-*.exe" | Select-Object -First 1 | |
| if (-not $installer) { throw "Altair Windows installer was not found in release/." } | |
| gh release create $env:RELEASE_TAG ` | |
| $installer.FullName ` | |
| "firmware/radio_gateway_esp32/Altair_Gateway_v7/Altair_Gateway_v7.ino" ` | |
| "firmware/transmitter_stm32_v7/Transmit_v7_static/Transmit_v7_static.ino" ` | |
| "docs/CUP_Altair_v7_Manual.pdf" ` | |
| "docs/CUP_Altair_v7_Manual.tex" ` | |
| "docs/RELEASE_V7.md" ` | |
| "bundled_firmware/gateway-firmware.bin" ` | |
| "bundled_firmware/manifest.json" ` | |
| --target main ` | |
| --title "ЦУП Альтаир v7 ($env:RELEASE_TAG) — Технопром 2026. Миссия на Луну" ` | |
| --notes-file "docs/RELEASE_V7.md" ` | |
| --latest |