forked from armbian/build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
211 lines (176 loc) · 5.56 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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: "Rebuild Armbian"
author: "https://github.com/armbian"
description: "Build Armbian Linux"
inputs:
armbian_token:
description: "GitHub installation access token"
required: true
armbian_runner_clean:
description: "Make some space on GH runners"
required: false
default: ""
armbian_artifacts:
descriptions: "Upload PATH"
required: false
default: "build/output/images/"
armbian_target:
description: "Build image or kernel"
required: false
default: "kernel"
armbian_branch:
description: "Choose framework branch"
required: false
default: "main"
armbian_kernel_branch:
description: "Choose kernel branch"
required: false
default: "current"
armbian_release:
description: "Choose userspace release"
required: false
default: "jammy"
armbian_version:
description: "Set different version"
required: false
default: ""
armbian_board:
description: "Select hardware platform"
required: false
default: "uefi-x86"
armbian_ui:
description: "Armbian user interface"
required: false
default: "server"
armbian_compress:
description: "Armbian compress method"
required: false
default: "sha,img,xz"
armbian_extensions:
description: "Armbian lists of extensions"
required: false
default: ""
armbian_userpatches:
description: "Armbian userpatches path"
required: false
default: ""
armbian_pgp_key:
description: "Armbian PGP key"
required: false
default: ""
armbian_pgp_password:
description: "Armbian PGP password"
required: false
default: ""
armbian_release_tittle:
description: "Armbian image"
required: false
default: "Armbian image"
armbian_release_body:
description: "Armbian images"
required: false
default: "Build with [Armbian tools](https://github.com/armbian/build)"
runs:
using: "composite"
steps:
- name: Free Github Runner
if: ${{ inputs.armbian_runner_clean != '' }}
uses: descriptinc/free-disk-space@main
with:
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: "Import GPG key"
if: ${{ inputs.armbian_pgp_key != '' }}
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ inputs.armbian_pgp_key }}
passphrase: ${{ inputs.armbian_pgp_password }}
- name: "Checkout Armbian os"
uses: actions/checkout@v4
with:
repository: armbian/os
fetch-depth: 0
clean: false
path: os
- name: "Checkout Armbian build framework"
uses: actions/checkout@v4
with:
repository: armbian/build
fetch-depth: 0
clean: false
path: build
- name: "Checkout customisations"
uses: actions/checkout@v4
with:
fetch-depth: 0
clean: false
path: custom
- shell: bash
run: |
# read version from upstream Armbian OS
cat os/stable.json | jq '.version' | sed "s/\"//g" | sed 's/^/ARMBIAN_VERSION=/' >> $GITHUB_ENV
[[ "${{ inputs.armbian_version }}" != '' ]] && echo "ARMBIAN_VERSION=${{ inputs.armbian_version }}" >> $GITHUB_ENV
# copy os userpatches and custom
mkdir -pv build/userpatches
rsync -av os/userpatches/. build/userpatches/
[[ -d custom/userpatches ]] && rsync -av custom/userpatches/. build/userpatches/
- shell: bash
run: |
# userspace decode
if [[ "${{ inputs.armbian_ui }}" == minimal ]]; then
BUILD_DESKTOP="no"
BUILD_MINIMAL="yes"
elif [[ "${{ inputs.armbian_ui }}" == server ]]; then
BUILD_DESKTOP="no"
BUILD_MINIMAL="no"
else
BUILD_DESKTOP="yes"
BUILD_MINIMAL="no"
DESKTOP_ENVIRONMENT="${{ inputs.armbian_ui }}"
DESKTOP_APPGROUPS_SELECTED=""
DESKTOP_ENVIRONMENT_CONFIG_NAME="config_base"
fi
# go to build folder and checkout
cd build
git checkout ${{ inputs.armbian_branch }}
# execute build command
./compile.sh "${{ inputs.armbian_target }}" \
REVISION="${{ env.ARMBIAN_VERSION }}" \
BOARD="${{ inputs.armbian_board }}" \
BRANCH="${{ inputs.armbian_kernel_branch }}" \
RELEASE="${{ inputs.armbian_release }}" \
KERNEL_CONFIGURE="no" \
BUILD_DESKTOP="${BUILD_DESKTOP}" \
BUILD_MINIMAL="${BUILD_MINIMAL}" \
DESKTOP_ENVIRONMENT="${DESKTOP_ENVIRONMENT}" \
DESKTOP_APPGROUPS_SELECTED="${DESKTOP_APPGROUPS_SELECTED}" \
DESKTOP_ENVIRONMENT_CONFIG_NAME="${DESKTOP_ENVIRONMENT_CONFIG_NAME}" \
ENABLE_EXTENSIONS="${{ inputs.armbian_extensions }}" \
COMPRESS_OUTPUTIMAGE="${{ inputs.armbian_compress }}" \
SHARE_LOG="yes" \
EXPERT="yes"
- name: Sign
shell: bash
if: ${{ inputs.armbian_pgp_password != '' }}
run: |
echo ${{ inputs.armbian_pgp_password }} | \
gpg --passphrase-fd 0 --armor --detach-sign --pinentry-mode loopback --batch --yes \
build/output/images/*.img*.xz
- uses: ncipollo/release-action@v1
with:
tag: "${{ env.ARMBIAN_VERSION }}"
name: "${{ inputs.armbian_release_tittle }}"
artifacts: "${{ inputs.armbian_artifacts }}*"
allowUpdates: true
removeArtifacts: false
replacesArtifacts: true
makeLatest: true
token: "${{ inputs.armbian_token }}"
body: |
${{ inputs.armbian_release_body }}
branding:
icon: "check"
color: "red"