forked from nanoframework/nf-interpreter
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (74 loc) · 3.3 KB
/
build_radar.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build ORGPAL_RADAR
on:
workflow_dispatch
jobs:
build_ORGPAL_RADAR:
runs-on: windows-latest
env:
TARGET_NAME: 'ORGPAL_RADAR'
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.7.0'
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 | 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 }}']"
buildPreset: ${{ env.TARGET_NAME }}
buildPresetAdditionalArgs: "['--config MinSizeRel','-DACCONEER_SOURCE=${{ Env.ACCONNER_PATH }}']"
- 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