Skip to content

Commit 6fa5981

Browse files
committed
Add default Armbian Github compile action (#6105)
1 parent 0c992ac commit 6fa5981

File tree

2 files changed

+238
-20
lines changed

2 files changed

+238
-20
lines changed

README.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,16 @@
1717

1818
## Getting started
1919

20-
### Requirements
20+
### Requirements for self hosted
2121

2222
- x86_64 / aarch64 machine
2323
- at least 2GB of memory and ~35GB of disk space for VM, container or bare metal installation
24-
- Ubuntu Jammy 22.04.x for native building or any Docker capable Linux for containerised
24+
- [Armbian / Ubuntu Jammy 22.04.x](https://github.com/armbian/sdk) for native building or any Docker capable Linux for containerised
2525
- Windows 10/11 with WSL2 subsystem running Ubuntu Jammy 22.04.x
2626
- Superuser rights (configured sudo or root access).
2727
- Make sure your system is up-to-date! Outdated Docker binaries, for example, can cause trouble.
2828

29-
### Start with the build script
30-
31-
##### Development branch:
29+
For stable branch use `--branch=v23.11`
3230

3331
```bash
3432
apt-get -y install git
@@ -37,16 +35,6 @@ cd build
3735
./compile.sh
3836
```
3937

40-
##### Stable branch:
41-
42-
```bash
43-
apt-get -y install git
44-
git clone --depth=1 --branch=v23.11 https://github.com/armbian/build
45-
cd build
46-
./compile.sh
47-
```
48-
49-
5038
<a href="#how-to-build-an-image-or-a-kernel"><img src=".github/README.gif" alt="Armbian logo" width="100%"></a>
5139

5240
- Interactive graphical interface.
@@ -61,20 +49,38 @@ Show work-in-progress areas in interactive mode:
6149
./compile.sh EXPERT="yes"
6250
```
6351

64-
Build minimal CLI Armbian Jammy for Raspberry Pi 4B with LTS kernel and write image directly to the SD card:
52+
Build minimal CLI Armbian Jammy for Bananapi M5 with LTS kernel:
6553

6654
```bash
6755
./compile.sh \
68-
BOARD=rpi4b \
56+
BOARD=bananapim5 \
6957
BRANCH=current \
7058
RELEASE=jammy \
7159
BUILD_MINIMAL=yes \
7260
BUILD_DESKTOP=no \
73-
KERNEL_CONFIGURE=no \
74-
CARD_DEVICE="/dev/sdX"
61+
KERNEL_CONFIGURE=no
62+
```
63+
64+
Build with GitHub actions: ([advanced version](https://github.com/armbian/os/blob/main/.github/workflows/complete-artifact-one-by-one.yml))
65+
66+
```
67+
name: "Build Armbian"
68+
on:
69+
workflow_dispatch:
70+
jobs:
71+
build-armbian:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: armbian/build@main
75+
with:
76+
armbian_token: "${{ secrets.GITHUB_TOKEN }}" # GitHub token
77+
armbian_release: "jammy" # userspace
78+
armbian_target: "build" # build=image, kernel=kernel
79+
armbian_board: "bananapim5" # build target
7580
```
81+
Generated image will be uploaded to your repository release. Note: GitHub upload file limit is 2Gb.
7682

77-
More information:
83+
## More information:
7884

7985
- [Building Armbian](https://docs.armbian.com/Developer-Guide_Build-Preparation/) (how to start, how to automate)
8086
- [Build options](https://docs.armbian.com/Developer-Guide_Build-Options/) (all build options)

action.yml

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
name: "Rebuild Armbian"
2+
author: "https://github.com/armbian"
3+
description: "Build Armbian Linux"
4+
inputs:
5+
6+
armbian_token:
7+
description: "GitHub installation access token"
8+
required: true
9+
10+
armbian_runner_clean:
11+
description: "Make some space on GH runners"
12+
required: false
13+
default: ""
14+
15+
armbian_artifacts:
16+
descriptions: "Upload PATH"
17+
required: false
18+
default: "build/output/images/"
19+
20+
armbian_target:
21+
description: "Build image or kernel"
22+
required: false
23+
default: "kernel"
24+
25+
armbian_branch:
26+
description: "Choose framework branch"
27+
required: false
28+
default: "main"
29+
30+
armbian_kernel_branch:
31+
description: "Choose kernel branch"
32+
required: false
33+
default: "current"
34+
35+
armbian_release:
36+
description: "Choose userspace release"
37+
required: false
38+
default: "jammy"
39+
40+
armbian_version:
41+
description: "Set different version"
42+
required: false
43+
default: ""
44+
45+
armbian_board:
46+
description: "Select hardware platform"
47+
required: false
48+
default: "uefi-x86"
49+
50+
armbian_ui:
51+
description: "Armbian user interface"
52+
required: false
53+
default: "server"
54+
55+
armbian_compress:
56+
description: "Armbian compress method"
57+
required: false
58+
default: "sha,img,xz"
59+
60+
armbian_extensions:
61+
description: "Armbian lists of extensions"
62+
required: false
63+
default: ""
64+
65+
armbian_userpatches:
66+
description: "Armbian userpatches path"
67+
required: false
68+
default: ""
69+
70+
armbian_pgp_key:
71+
description: "Armbian PGP key"
72+
required: false
73+
default: ""
74+
75+
armbian_pgp_password:
76+
description: "Armbian PGP password"
77+
required: false
78+
default: ""
79+
80+
armbian_release_tittle:
81+
description: "Armbian image"
82+
required: false
83+
default: "Armbian image"
84+
85+
armbian_release_body:
86+
description: "Armbian images"
87+
required: false
88+
default: "Build with [Armbian tools](https://github.com/armbian/build)"
89+
90+
runs:
91+
using: "composite"
92+
93+
steps:
94+
95+
- name: Free Github Runner
96+
if: ${{ inputs.armbian_runner_clean != '' }}
97+
uses: descriptinc/free-disk-space@main
98+
with:
99+
android: true
100+
dotnet: true
101+
haskell: true
102+
large-packages: true
103+
docker-images: true
104+
swap-storage: true
105+
106+
- name: "Import GPG key"
107+
if: ${{ inputs.armbian_pgp_key != '' }}
108+
uses: crazy-max/ghaction-import-gpg@v6
109+
with:
110+
gpg_private_key: ${{ inputs.armbian_pgp_key }}
111+
passphrase: ${{ inputs.armbian_pgp_password }}
112+
113+
- name: "Checkout Armbian os"
114+
uses: actions/checkout@v4
115+
with:
116+
repository: armbian/os
117+
fetch-depth: 0
118+
clean: false
119+
path: os
120+
121+
- name: "Checkout Armbian build framework"
122+
uses: actions/checkout@v4
123+
with:
124+
repository: armbian/build
125+
fetch-depth: 0
126+
clean: false
127+
path: build
128+
129+
- name: "Checkout customisations"
130+
uses: actions/checkout@v4
131+
with:
132+
fetch-depth: 0
133+
clean: false
134+
path: custom
135+
136+
- shell: bash
137+
run: |
138+
139+
# read version from upstream Armbian OS
140+
cat os/stable.json | jq '.version' | sed "s/\"//g" | sed 's/^/ARMBIAN_VERSION=/' >> $GITHUB_ENV
141+
[[ "${{ inputs.armbian_version }}" != '' ]] && echo "ARMBIAN_VERSION=${{ inputs.armbian_version }}" >> $GITHUB_ENV
142+
143+
# copy os userpatches and custom
144+
mkdir -pv build/userpatches
145+
rsync -av os/userpatches/. build/userpatches/
146+
#[[ -d custom/userpatches ]] &&
147+
rsync -av custom/userpatches/. build/userpatches/
148+
149+
- shell: bash
150+
run: |
151+
152+
# userspace decode
153+
if [[ "${{ inputs.armbian_ui }}" == minimal ]]; then
154+
BUILD_DESKTOP="no"
155+
BUILD_MINIMAL="yes"
156+
elif [[ "${{ inputs.armbian_ui }}" == server ]]; then
157+
BUILD_DESKTOP="no"
158+
BUILD_MINIMAL="no"
159+
else
160+
BUILD_DESKTOP="yes"
161+
BUILD_MINIMAL="no"
162+
DESKTOP_ENVIRONMENT="${{ inputs.armbian_ui }}"
163+
DESKTOP_APPGROUPS_SELECTED=""
164+
DESKTOP_ENVIRONMENT_CONFIG_NAME="config_base"
165+
fi
166+
167+
# go to build folder and checkout
168+
cd build
169+
git checkout ${{ inputs.armbian_branch }}
170+
171+
# execute build command
172+
./compile.sh "${{ inputs.armbian_target }}" \
173+
REVISION="${{ env.ARMBIAN_VERSION }}" \
174+
BOARD="${{ inputs.armbian_board }}" \
175+
BRANCH="${{ inputs.armbian_kernel_branch }}" \
176+
RELEASE="${{ inputs.armbian_release }}" \
177+
KERNEL_CONFIGURE="no" \
178+
BUILD_DESKTOP="${BUILD_DESKTOP}" \
179+
BUILD_MINIMAL="${BUILD_MINIMAL}" \
180+
DESKTOP_ENVIRONMENT="${DESKTOP_ENVIRONMENT}" \
181+
DESKTOP_APPGROUPS_SELECTED="${DESKTOP_APPGROUPS_SELECTED}" \
182+
DESKTOP_ENVIRONMENT_CONFIG_NAME="${DESKTOP_ENVIRONMENT_CONFIG_NAME}" \
183+
ENABLE_EXTENSIONS="${{ inputs.armbian_extensions }}" \
184+
COMPRESS_OUTPUTIMAGE="${{ inputs.armbian_compress }}" \
185+
SHARE_LOG="yes" \
186+
EXPERT="yes"
187+
188+
- name: Sign
189+
shell: bash
190+
if: ${{ inputs.armbian_pgp_password != '' }}
191+
run: |
192+
echo ${{ inputs.armbian_pgp_password }} | \
193+
gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes \
194+
build/output/images/*.img*.xz
195+
196+
- uses: ncipollo/release-action@v1
197+
with:
198+
tag: "${{ env.ARMBIAN_VERSION }}"
199+
name: "${{ inputs.armbian_release_tittle }}"
200+
artifacts: "${{ inputs.armbian_artifacts }}*"
201+
allowUpdates: true
202+
removeArtifacts: false
203+
replacesArtifacts: true
204+
makeLatest: true
205+
token: "${{ inputs.armbian_token }}"
206+
body: |
207+
${{ inputs.armbian_release_body }}
208+
209+
branding:
210+
icon: "check"
211+
color: "red"
212+

0 commit comments

Comments
 (0)