Релиз из пяти файлов: веб-форма Gitea больше не принимает
- make_release.ps1: образы BL616 (прошивка моста, загрузчик и штатная прошивка Sipeed) и настройки BLFlashCommand с путями к соседним файлам собираются в один архив bl616_bridge_firmware-v<версия>.zip с памяткой bin/release_readme.txt; - make_portable.ps1, make_release.ps1: zip через ZipFile с '/' в путях — Compress-Archive из PowerShell 5.1 пишет '\', и распаковщики кроме Проводника считают его частью имени файла; - make_portable.ps1: без файлов, которые BLFlashCommand оставляет в chips\ после прошивки (img_create\, eflash_loader_cfg.ini); - README, CHANGELOG: новый состав релиза.
This commit is contained in:
@@ -26,6 +26,9 @@ if (Test-Path (Join-Path $cube 'BLFlashCommand.exe')) {
|
||||
New-Item -ItemType Directory -Force $dst | Out-Null
|
||||
Copy-Item (Join-Path $cube 'BLFlashCommand.exe') $dst
|
||||
Copy-Item -Recurse (Join-Path $cube 'chips') $dst
|
||||
# what earlier flashing left in the SDK copy (ignored by its .gitignore)
|
||||
Get-ChildItem (Join-Path $dst 'chips\*\img_create') -Directory -ErrorAction SilentlyContinue | Remove-Item -Recurse -Force
|
||||
Get-ChildItem (Join-Path $dst 'chips\*\eflash_loader\eflash_loader_cfg.ini') -ErrorAction SilentlyContinue | Remove-Item -Force
|
||||
} else {
|
||||
Write-Warning 'Bouffalo SDK is not installed (scripts\setup.ps1): the bridge firmware tab will not work in the copy'
|
||||
}
|
||||
@@ -75,6 +78,11 @@ Copy-Item (Join-Path $root 'gui\portable_readme.txt') (Join-Path $out 'README.tx
|
||||
|
||||
$zip = Join-Path $dist 'TangProgrammer.zip'
|
||||
if (Test-Path $zip) { Remove-Item -Force $zip }
|
||||
Compress-Archive -Path $out -DestinationPath $zip
|
||||
# not Compress-Archive: in Windows PowerShell 5.1 it writes '\' into the entry
|
||||
# names, and unzip tools other than Explorer take them for part of the file
|
||||
# name. ZipFile does the same unless told otherwise (.NET 4.6.1 compat switch).
|
||||
[AppContext]::SetSwitch('Switch.System.IO.Compression.ZipFile.UseBackslash', $false)
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
[IO.Compression.ZipFile]::CreateFromDirectory($out, $zip, [IO.Compression.CompressionLevel]::Optimal, $true)
|
||||
$size = (Get-ChildItem -Recurse $out | Measure-Object -Sum Length).Sum
|
||||
Write-Host ("OK: {0} ({1:N1} MB), {2} ({3:N1} MB)" -f $out, ($size / 1MB), $zip, ((Get-Item $zip).Length / 1MB)) -ForegroundColor Green
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
# Collect the files of a release into dist\release\v<version>\:
|
||||
#
|
||||
# TangProgrammer-v<version>-win64.zip portable programmer (make_portable.ps1)
|
||||
# TangProgrammer.exe the program alone
|
||||
# tang25k_debugger_bl616.bin bridge firmware, @0x20000
|
||||
# bl616_bootloader_0x20000_nano20k_signed.bin Sipeed loader, @0x0
|
||||
# bl616_fpga_partner_25kDock.bin original Sipeed firmware, @0x0
|
||||
# fpga_test_bitstreams-GW5A-25.zip fpga_test\*\impl\pnr\*.fs, if built
|
||||
# TangProgrammer-v<version>-win64.zip portable programmer (make_portable.ps1)
|
||||
# TangProgrammer.exe the program alone
|
||||
# bl616_bridge_firmware-v<version>.zip bridge firmware (@0x20000), Sipeed loader
|
||||
# (@0x0), original Sipeed firmware, configs
|
||||
# for BLFlashCommand
|
||||
# fpga_test_bitstreams-GW5A-25.zip fpga_test\*\impl\pnr\*.fs, if built
|
||||
# SHA256SUMS.txt
|
||||
#
|
||||
# Five files at most: the Gitea web form takes no more than that ([attachment]
|
||||
# MAX_FILES on gitea.vector.ru), publish_release.ps1 has no such limit.
|
||||
#
|
||||
# .\scripts\build.ps1
|
||||
# .\scripts\make_release.ps1 version from FW_VERSION_STR in src\sys.h
|
||||
param([string]$Version)
|
||||
@@ -35,9 +38,23 @@ New-Item -ItemType Directory -Force $out | Out-Null
|
||||
Copy-Item (Join-Path $root 'dist\TangProgrammer.zip') (Join-Path $out "TangProgrammer-$tag-win64.zip")
|
||||
Copy-Item (Join-Path $root 'dist\TangProgrammer\TangProgrammer.exe') $out
|
||||
|
||||
Copy-Item $bridgeFw $out
|
||||
Copy-Item (Join-Path $root 'bin\bl616_bootloader_0x20000_nano20k_signed.bin') $out
|
||||
Copy-Item (Join-Path $root 'bin\bl616_fpga_partner_25kDock.bin') $out
|
||||
# the bridge images with the flash configs of the project root, pointing next to themselves
|
||||
$fw = Join-Path $out "bl616_bridge_firmware-$tag"
|
||||
New-Item -ItemType Directory -Force $fw | Out-Null
|
||||
Copy-Item $bridgeFw $fw
|
||||
Copy-Item (Join-Path $root 'bin\bl616_bootloader_0x20000_nano20k_signed.bin') $fw
|
||||
Copy-Item (Join-Path $root 'bin\bl616_fpga_partner_25kDock.bin') $fw
|
||||
foreach ($ini in 'flash_prog_cfg.ini', 'restore_prog_cfg.ini') {
|
||||
$text = [IO.File]::ReadAllText((Join-Path $root $ini))
|
||||
$text = $text.Replace('./build/build_out/', './').Replace('./bin/', './').Replace('$(CHIPNAME)', 'bl616')
|
||||
[IO.File]::WriteAllText((Join-Path $fw $ini), $text)
|
||||
}
|
||||
Copy-Item (Join-Path $root 'bin\release_readme.txt') (Join-Path $fw 'README.txt')
|
||||
# not Compress-Archive, see make_portable.ps1
|
||||
[AppContext]::SetSwitch('Switch.System.IO.Compression.ZipFile.UseBackslash', $false)
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
[IO.Compression.ZipFile]::CreateFromDirectory($fw, "$fw.zip", [IO.Compression.CompressionLevel]::Optimal, $true)
|
||||
Remove-Item -Recurse -Force $fw
|
||||
|
||||
$fs = @(Get-ChildItem (Join-Path $root 'fpga_test\*\impl\pnr\*.fs') -ErrorAction SilentlyContinue)
|
||||
if ($fs.Count) {
|
||||
|
||||
Reference in New Issue
Block a user