Build ORGPAL_RADAR REV_A #2
This file contains 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: Build ORGPAL_RADAR REV_A | |
on: | |
workflow_dispatch | |
jobs: | |
build_ORGPAL_RADAR: | |
runs-on: windows-latest | |
env: | |
TARGET_NAME: 'ORGPAL_RADAR_REVA' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: 'orgpal-radar' | |
- uses: actions/checkout@v4 | |
with: | |
repository: 'OrgPal/acconeer_cortex_m7_gcc_a121' | |
ref: 'v1.8.1' | |
token: ${{ secrets.UPTODATE }} | |
path: 'acconeer_cortex_m7_gcc_a121' | |
- name: Fix path with forward slashes | |
run: echo "ACCONNER_PATH=$(echo ${{ github.workspace }}/acconeer_cortex_m7_gcc_a121/cortex_m7_gcc | tr '\\' '/')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | |
- name: Print path for debugging | |
run: echo ${{ env.ACCONNER_PATH }} | |
- uses: lukka/get-cmake@latest | |
- name: Install arm-none-eabi-gcc | |
uses: carlosperate/arm-none-eabi-gcc-action@v1 | |
with: | |
release: '13.3.Rel1' | |
path-env-var: ARM_NONE_EABI_GCC_PATH | |
- name: Tweak GCC path | |
run: | | |
$currentPath = "$env:ARM_NONE_EABI_GCC_PATH" | |
if($currentPath.EndsWith("bin")) | |
{ | |
$fixedPath = $currentPath.Replace("\bin", "") | |
echo "ARM_NONE_EABI_GCC_PATH=$fixedPath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | |
} | |
- name: Install hex2dfu | |
run: ./install-scripts/install-nf-hex2dfu.ps1 | |
- name: Adjust HexDFU path | |
run: | | |
$hex2dfuPath = "$env:RUNNER_TEMP".Replace('\','/') + "/hex2dfu" | |
echo "HEX2DFU_PATH=$hex2dfuPath" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append | |
- name: Set version | |
run: nbgv cloud -a -c | |
- name: Rename CMake presets | |
working-directory: ${{ github.workspace }}/config | |
run: | | |
$file = "user-tools-repos.json" | |
Rename-Item -Path "user-tools-repos.TEMPLATE.json" -NewName $file | |
[regex]$pattern='user-tools-repos-cloud' | |
$pattern.replace([IO.File]::ReadAllText($file), 'user-tools-repos', 1) | Out-File $file -Encoding UTF8 | |
$file = "user-prefs.json" | |
Rename-Item -Path "user-prefs.TEMPLATE.json" -NewName $file | |
$filecontent = Get-Content($file) | |
attrib $file -r | |
$filecontent -replace 'Debug', 'MinSizeRel' | Out-File $file -Encoding UTF8 | |
- name: Add dummy CMake presets | |
working-directory: ${{ github.workspace }}/targets-community | |
run: | | |
New-Item -Path . -Name "CMakePresets.json" -ItemType "file" -Value "{`n""version"": 4,`n""include"": []`n}" | |
- uses: lukka/run-cmake@v10 | |
with: | |
configurePreset: ${{ env.TARGET_NAME }} | |
configurePresetAdditionalArgs: "['-DBUILD_VERSION=${{env.NBGV_VersionMajor}}.${{env.NBGV_VersionMinor}}.${{env.NBGV_BuildNumber}}.${{env.NBGV_VersionHeight}}','-DCMAKE_BUILD_TYPE=MinSizeRel','-DTOOL_HEX2DFU_PREFIX=${{ env.HEX2DFU_PATH }}','-DACCONEER_SOURCE=${{ Env.ACCONNER_PATH }}']" | |
buildPreset: ${{ env.TARGET_NAME }} | |
buildPresetAdditionalArgs: "['--config MinSizeRel']" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: '${{ env.TARGET_NAME }}-v${{env.NBGV_VersionMajor}}.${{env.NBGV_VersionMinor}}.${{env.NBGV_BuildNumber}}.${{env.NBGV_VersionHeight}}' | |
path: | | |
${{ github.workspace }}/build/*.bin | |
${{ github.workspace }}/build/*.hex | |
${{ github.workspace }}/build/*.dfu |