forked from radxa-pkg/radxa-overlays
-
Notifications
You must be signed in to change notification settings - Fork 0
180 lines (178 loc) · 6.33 KB
/
release.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: Build & Release
on:
workflow_dispatch:
merge_group:
pull_request:
push:
permissions: {}
jobs:
build-dtbo:
runs-on: ubuntu-latest
strategy:
matrix:
version: [linux-rockchip, linux-rk356x, linux-stable, linux-rk2312, linux-rk2410]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check if there is missing files
shell: bash
run: |
MISSING=0
for VENDOR in amlogic rockchip
do
OVERLAY_PATH="arch/arm64/boot/dts/$VENDOR/overlays"
for i in "$OVERLAY_PATH"/*.dts
do
OVERLAY_NAME="$(basename "$i")"
OVERLAY_NAME="${OVERLAY_NAME/.dts}.dtbo"
if ! grep "$OVERLAY_NAME" "${OVERLAY_PATH}/Makefile"* >/dev/null 2>/dev/null
then
echo "$OVERLAY_NAME is not included in $VENDOR Makefile!"
MISSING=1
fi
done
done
exit $MISSING
- name: Install dependencies
shell: bash
run: |
sudo apt update
sudo apt install -y --no-install-recommends device-tree-compiler
sudo dpkg --add-architecture arm64
case "${{ matrix.version }}" in
linux-rockchip)
wget https://github.com/radxa-pkg/linux-rockchip/releases/download/5.10.110-38/linux-headers-5.10.110-38-rockchip_5.10.110-38-7a04ba0ad_arm64.deb
sudo apt install ./linux-headers-*.deb
;;
linux-rk356x)
wget https://github.com/radxa-pkg/linux-rk356x/releases/download/5.10.160-37/linux-headers-5.10.160-37-rk356x_5.10.160-37-ff919543b_arm64.deb
sudo apt install ./linux-headers-*.deb
;;
linux-rk2312)
wget https://github.com/radxa-pkg/linux-rk2312/releases/download/6.1.43-15/linux-headers-6.1.43-15-rk2312_6.1.43-15-3176a44da_arm64.deb
sudo apt install ./linux-headers-*.deb
;;
linux-rk2410)
wget https://github.com/radxa-pkg/linux-rk2410/releases/download/6.1.84-1/linux-headers-6.1.84-1-rk2410_6.1.84-1-697921484_arm64.deb
sudo apt install ./linux-headers-*.deb
;;
esac
- name: Build
shell: bash
run: |
case "${{ matrix.version }}" in
linux-stable)
make build-dtbo -j$(nproc)
;;
linux-rockchip)
make build-dtbo -j$(nproc) KERNELRELEASE=5.10.110-38-rockchip CONFIG_ARCH_MESON=n CONFIG_CPU_RK3399=rockchip CONFIG_CPU_RK3588=rockchip
;;
linux-rk356x)
make build-dtbo -j$(nproc) KERNELRELEASE=5.10.160-37-rk356x CONFIG_ARCH_MESON=n CONFIG_CPU_RK3528=rockchip CONFIG_CPU_RK3568=rockchip
;;
linux-rk2312)
make build-dtbo -j$(nproc) KERNELRELEASE=6.1.43-15-rk2312 CONFIG_ARCH_MESON=n CONFIG_CPU_RK3588=rockchip
;;
linux-rk2410)
make build-dtbo -j$(nproc) KERNELRELEASE=6.1.84-1-rk2410 CONFIG_ARCH_MESON=n CONFIG_CPU_RK3588=rockchip CONFIG_CPU_RK3576=rockchip
;;
esac
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.version }}
path: |
arch/**/*.dtbo
build:
runs-on: ubuntu-latest
outputs:
distro: ${{ steps.distro_check.outputs.distro }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Test
run: |
make test
- name: Build
run: |
sudo apt-get update
sudo apt-get build-dep --no-install-recommends -y .
make all deb
- name: Workaround actions/upload-artifact#176
run: |
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}
path: |
${{ env.artifacts_path }}/*.deb
- name: Check if the latest version is releasable
id: distro_check
run: |
version="$(dpkg-parsechangelog -S Version)"
if [[ -n "$(git tag -l "$version")" ]]
then
echo "distro=UNRELEASED" >> "$GITHUB_OUTPUT"
else
echo "distro=$(dpkg-parsechangelog -S Distribution)" >> "$GITHUB_OUTPUT"
fi
release:
runs-on: ubuntu-latest
needs: [build-dtbo, build]
if: github.event_name != 'pull_request' && github.event_name != 'merge_group' && github.ref_name == 'main' && needs.build.outputs.distro != 'UNRELEASED'
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: ${{ github.event.repository.name }}
path: .artifacts
- name: Prepare for release
run: |
version="$(dpkg-parsechangelog -S Version)"
echo "version=$version" >> $GITHUB_ENV
echo "changes<<EOF" >> $GITHUB_ENV
echo '```' >> $GITHUB_ENV
echo "$(dpkg-parsechangelog -S Changes)" >> $GITHUB_ENV
echo '```' >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "$version" > VERSION
if [[ -f pkg.conf.template ]]
then
sed "s/VERSION/$(dpkg-parsechangelog -S Version)/g" pkg.conf.template > pkg.conf
fi
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.version }}
body_path: README.md
token: ${{ secrets.GITHUB_TOKEN }}
target_commitish: ${{ github.ref_name }}
draft: false
fail_on_unmatched_files: false
files: |
.artifacts/**/*.deb
pkg.conf
VERSION
- name: Append changelog
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.version }}
body: |
## Changelog for ${{ env.version }}
${{ env.changes }}
append_body: true
- name: Update Test repos
uses: radxa-repo/update-repo-action@main
with:
test-repo: true
token: ${{ secrets.RADXA_APT_TEST_REPO_TOKEN }}