forked from radxa/armbian-compile-action
-
Notifications
You must be signed in to change notification settings - Fork 21
/
action.yml
118 lines (118 loc) · 4.57 KB
/
action.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
name: 'Armbian/build'
description: 'Armbian Linux build framework'
inputs:
board:
required: true
flavor:
required: true
release-id:
required: false
github-token:
required: false
runs:
using: "composite"
steps:
- name: Get more space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 25600
temp-reserve-mb: 4096
swap-size-mb: 1024
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Checkout
uses: actions/checkout@v3
with:
repository: armbian/build
ref: main
path: build
- name: Set env
shell: bash
run: |
if [ ${{ inputs.flavor }} == "debian" ]
then
echo "release=sid" >> $GITHUB_ENV
echo "build-minimal=no" >> $GITHUB_ENV
echo "build-desktop=yes" >> $GITHUB_ENV
echo "desktop-environment=gnome" >> $GITHUB_ENV
echo "desktop-environment-config-name=config_base" >> $GITHUB_ENV
echo "expert=no" >> $GITHUB_ENV
elif [ ${{ inputs.flavor }} == "ubuntu" ]
then
echo "release=noble" >> $GITHUB_ENV
echo "build-minimal=no" >> $GITHUB_ENV
echo "build-desktop=yes" >> $GITHUB_ENV
echo "desktop-environment=gnome" >> $GITHUB_ENV
echo "desktop-environment-config-name=config_base" >> $GITHUB_ENV
echo "expert=yes" >> $GITHUB_ENV
echo "desktop_appgroups_selected=\"browsers chat desktop_tools editors email internet multimedia office programming remote_desktop\"" >> $GITHUB_ENV
elif [ ${{ inputs.flavor }} == "cli" ]
then
echo "release=noble" >> $GITHUB_ENV
echo "build-minimal=no" >> $GITHUB_ENV
echo "build-desktop=no" >> $GITHUB_ENV
echo "desktop-environment=gnome" >> $GITHUB_ENV
echo "desktop-environment-config-name=config_base" >> $GITHUB_ENV
echo "expert=yes" >> $GITHUB_ENV
echo "desktop_appgroups_selected=\"browsers chat desktop_tools editors email internet multimedia office programming remote_desktop\"" >> $GITHUB_ENV
fi
- name: Build
shell: bash
run: |
cd ./build
touch .ignore_changes
mkdir -p arch/arm64/boot/dts/rockchip/
sed -i "s|() {|() {\ndf -h \&\& du -sh \${SRC}/* \&\& du -sh \${SRC}/cache/* \&\& rm -rf \${SRC}/cache/sources/aptcache/* \${SRC}/cache/sources/linux-kernel-worktree/* \${SRC}/cache/sources/rootfs/*\n|g" extensions/image-output-abl.sh
git status
docker pull ghcr.io/armbian/docker-armbian-build:armbian-ubuntu-jammy-latest
if [ ${{ inputs.flavor }} == "cli" ];then
./compile.sh \
BOARD=${{ inputs.board }} \
BRANCH=${{ inputs.branch }} \
RELEASE=${{ env.release }} \
BUILD_MINIMAL=${{ env.build-minimal }} \
BUILD_DESKTOP=${{ env.build-desktop }} \
KERNEL_CONFIGURE=no \
EXPERT=${{ env.expert }} \
BOARD_FIRMWARE_INSTALL="-full" \
SHARE_LOG=yes \
DEBUG=yes \
COMPRESS_OUTPUTIMAGE=sha,gpg,xz
else
./compile.sh \
BOARD=${{ inputs.board }} \
BRANCH=${{ inputs.branch }} \
RELEASE=${{ env.release }} \
BUILD_MINIMAL=${{ env.build-minimal }} \
BUILD_DESKTOP=${{ env.build-desktop }} \
KERNEL_CONFIGURE=no \
DESKTOP_ENVIRONMENT=${{ env.desktop-environment }} \
DESKTOP_ENVIRONMENT_CONFIG_NAME=${{ env.desktop-environment-config-name }} \
DESKTOP_APPGROUPS_SELECTED=${{ env.desktop_appgroups_selected }} \
EXPERT=${{ env.expert }} \
BOARD_FIRMWARE_INSTALL="-full" \
SHARE_LOG=yes \
DEBUG=yes \
KERNEL_GIT=shallow \
COMPRESS_OUTPUTIMAGE=sha,gpg,xz
fi
- name: Upload
if: inputs.release-id != '' && inputs.github-token != ''
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
with:
release_id: ${{ inputs.release-id }}
file: "./build/output/images/*.img.xz;./build/output/images/*.img.xz.sha;./build/output/debs/linux-*.deb"
draft: false
overwrite: true
- name: Rollback release
if: failure() && inputs.release-id != '' && inputs.github-token != ''
uses: author/action-rollback@stable
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
with:
release_id: ${{ inputs.release-id }}