forked from buildroot/buildroot
-
Notifications
You must be signed in to change notification settings - Fork 47
163 lines (157 loc) · 5.08 KB
/
main.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: OpenDingux_buildroot
on:
push:
branches:
- opendingux
- opendingux-*
pull_request:
branches:
- opendingux
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-20.04
container:
image: ghcr.io/opendingux/retro-toolchain/buildroot
strategy:
matrix:
target: ['lepus', 'gcw0', 'rs90']
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Blocked invisible-mirror.net workaround
run: echo "1.1.1.1 invisible-mirror.net" | tee -a /etc/hosts
- name: Cache downloads
id: cache-downloads
uses: actions/cache@v3
with:
path: dl
key: downloads
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
file(APPEND $ENV{GITHUB_OUTPUT} "timestamp=${current_date}\n")
- name: ccache cache files
uses: actions/cache@v3
with:
path: output/ccache/${{ matrix.target }}
key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ matrix.config.name }}-ccache-
- name: build
run: ./rebuild.sh
env:
CONFIG: ${{ matrix.target }}
TOP_MAKE_COMMAND: utils/brmake
BR2_JLEVEL: 0
FORCE_UNSAFE_CONFIGURE: 1
- uses: actions/upload-artifact@v3
with:
name: toolchain-${{ matrix.target }}
path: |
output/${{ matrix.target }}/images/*.tar*
- uses: actions/upload-artifact@v3
with:
name: update-${{ matrix.target }}
path: |
output/${{ matrix.target }}/images/*.opk
- uses: actions/upload-artifact@v3
if: always()
with:
name: ${{ matrix.target }}-log
path: |
br.log
- name: Build installer
if: ${{ matrix.target == 'rs90' }}
run: |
echo "BR2_TOOLCHAIN_EXTERNAL_PATH=\"$(pwd)/output/rs90/host\"" >> configs/od_installer_defconfig
echo "BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y" >> configs/od_installer_defconfig
echo "BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=n" >> configs/od_installer_defconfig
sed -i "s/BR2_TOOLCHAIN_EXTERNAL_HEADERS_.*=y/BR2_TOOLCHAIN_EXTERNAL_HEADERS_$(sed -n 's/BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_\(.*\)=y/\1/p' output/rs90/.config)=y/" configs/od_installer_defconfig
sed -i "s/BR2_TOOLCHAIN_EXTERNAL_GCC_.*=y/BR2_TOOLCHAIN_EXTERNAL_GCC_$(sed -n 's/BR2_GCC_VERSION_\(.*\)_X=y/\1/p' output/rs90/.config)=y/" configs/od_installer_defconfig
./rebuild.sh
env:
CONFIG: installer
TOP_MAKE_COMMAND: utils/brmake
BR2_JLEVEL: 0
FORCE_UNSAFE_CONFIGURE: 1
- uses: actions/upload-artifact@v3
if: ${{ matrix.target == 'rs90' }}
with:
name: odboot-client-linux
path: |
output/installer/images/odboot-client
- uses: actions/upload-artifact@v3
if: ${{ matrix.target == 'rs90' }}
with:
name: vmlinuz
path: |
output/installer/images/vmlinuz.bin
- uses: actions/upload-artifact@v3
if: ${{ matrix.target == 'rs90' && always() }}
with:
name: ${{ matrix.target }}-installer-log
path: |
br.log
build-win:
name: Build odbootd (Windows)
runs-on: windows-2019
needs: build
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
update: false
msystem: mingw64
install: >-
base-devel
git
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-cmake
mingw-w64-x86_64-libusb
- uses: actions/checkout@v2
with:
repository: 'pcercuei/libini'
path: 'libini'
- name: Configure, build and install libini
run: |
cmake -Bbuild -G "MSYS Makefiles" -DBUILD_SHARED_LIBS=OFF
cmake --build build --config Release --parallel
cmake --install build --prefix /usr
working-directory: libini
- uses: actions/checkout@v2
with:
repository: 'pcercuei/libopk'
path: 'libopk'
- name: Configure, build and install libopk
run: |
PKG_CONFIG_PATH=/usr/lib/pkgconfig cmake -Bbuild -G "MSYS Makefiles" -DBUILD_SHARED_LIBS=OFF
cmake --build build --config Release --target opk
cmake --install build --prefix /usr
working-directory: libopk
- uses: actions/checkout@v2
with:
repository: 'OpenDingux/odbootd'
path: 'odbootd'
- uses: actions/download-artifact@v2
with:
name: vmlinuz
path: odbootd
- name: Configure, build and package odbootd
run: |
PKG_CONFIG_PATH=/usr/lib/pkgconfig cmake -DWITH_ODBOOTD=OFF -DSTATIC_EXE=ON -DEMBEDDED_INSTALLER=vmlinuz.bin -Bbuild -G "MSYS Makefiles"
cmake --build build --config Release
working-directory: odbootd
- uses: actions/upload-artifact@v3
with:
name: odboot-client-windows
path: |
odbootd/build/odboot-client.exe