-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
187 lines (176 loc) · 5.95 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
name: 'Manjaro Image Action'
description: 'Installs prerequisites for building Manjaro libhybris on ubuntu'
inputs:
arm-profiles-repo:
description: 'arm-profiles to clone'
required: false
default: 'https://github.com/manjaro-libhybris/arm-profiles.git'
halium-templates-repo:
description: 'android-recovery-flashing-template to clone'
required: false
default: 'https://github.com/manjaro-libhybris/android-recovery-flashing-template.git'
device:
description: 'name of the device the build is for'
required: true
edition:
description: 'name of the profile to build'
required: true
branch:
description: 'stable (default), testing, unstable'
required: false
default: stable
version:
description: 'image version'
required: false
default: "YY.MM"
outputs:
file-pkg:
description: "compressed files"
value: ${{ steps.build.outputs.file-pkg }}
file-path:
description: "path of the generated image"
value: ${{ steps.build.outputs.file-path }}
runs:
using: "composite"
steps:
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
-
name: show storage
shell: bash
run: |
df -h
-
name: install-build-dependencies
shell: bash
run: |
sudo apt-get update
sudo apt install \
gdisk \
zip \
systemd-container \
bmap-tools asciidoc \
libarchive-tools \
git \
build-essential \
cmake \
libarchive-dev \
pkg-config \
libcurl4-openssl-dev \
libgpgme-dev \
libssl-dev \
fakeroot \
dh-autoreconf \
qemu-utils \
qemu-efi-aarch64 \
qemu-system-arm \
qemu-user-static \
paperkey \
gpg \
ca-certificates \
u-boot-tools
sudo pip3 install meson
sudo pip3 install ninja
- id: install-pacman
shell: bash
env:
PACMAN_VERSION: 6.0.2
run: |
sudo git clone --depth 1 https://gitlab.manjaro.org/packages/core/pacman.git
pushd pacman
sudo wget https://sources.archlinux.org/other/pacman/pacman-${PACMAN_VERSION}.tar.xz
sudo tar -xvf pacman-${PACMAN_VERSION}.tar.xz
pushd pacman-${PACMAN_VERSION}
sudo patch -p1 -i ../pacman-sync-first-option.patch
sudo meson --prefix=/usr \
--buildtype=plain \
-Ddoc=disabled \
-Ddoxygen=enabled \
-Dscriptlet-shell=/usr/bin/bash \
-Dldconfig=/usr/bin/ldconfig \
build
sudo meson compile -C build
sudo meson install -C build
popd
sudo install -m644 pacman.conf /etc/pacman.conf
sudo install -m644 makepkg.conf /etc/
sudo mkdir -p /etc/pacman.d
sudo touch /etc/pacman.d/mirrorlist
popd
-
name: setup-qemu-binfmt
shell: bash
run: |
sudo wget https://raw.githubusercontent.com/manjaro-libhybris/manjaro-arm-tools/master/lib/qemu-static.conf -O /usr/lib/binfmt.d/qemu-static.conf
sudo service systemd-binfmt restart
-
name: install-arch-install-scripts
shell: bash
env:
VERSION: 28
run: |
sudo wget https://github.com/archlinux/arch-install-scripts/archive/refs/tags/v${VERSION}.tar.gz -O arch-install-scripts.tar.gz
sudo tar -xvf arch-install-scripts.tar.gz
sudo make -C arch-install-scripts-${VERSION}
sudo make -C arch-install-scripts-${VERSION} check
sudo make -C arch-install-scripts-${VERSION} PREFIX=/usr install
-
name: install-manjaro-arm-tools
shell: bash
run: |
sudo git clone https://github.com/manjaro-libhybris/manjaro-arm-tools
install_manjaro_arm_tools() {
pkgname=manjaro-arm-tools
sudo install -dm777 /usr/share/$pkgname/lib
sudo install -dm777 /usr/share/$pkgname/profiles
sudo install -d /etc/$pkgname/
sudo install -dm777 /var/lib/$pkgname/{pkg,img,tmp,profiles}
sudo install -dm777 /var/cache/$pkgname/{pkg/pkg-cache,img}
sudo install -Dm755 $pkgname/lib/* /usr/share/$pkgname/lib/
sudo install -Dm755 $pkgname/bin/* /usr/bin/
sudo install -Dm755 $pkgname/lib/manjaro-arm-tools.conf /etc/manjaro-arm-tools/
}
install_manjaro_arm_tools
-
name: checkout-arm-profiles
shell: bash
env:
REPO: ${{ inputs.arm-profiles-repo }}
run: |
sudo git clone --depth 1 ${REPO} arm-profiles
-
name: checkout-halium-templates
shell: bash
env:
REPO: ${{ inputs.halium-templates-repo }}
run: |
sudo git clone --depth 1 ${REPO} android-recovery-flashing-template
-
id: build
shell: bash
env:
DEVICE: ${{ inputs.device }}
EDITION: ${{ inputs.edition }}
BRANCH: ${{ inputs.branch }}
VERSION: ${{ inputs.version }}
run: |
sudo mv -v $GITHUB_WORKSPACE/arm-profiles /usr/share/manjaro-arm-tools/profiles
sudo mv -v $GITHUB_WORKSPACE/android-recovery-flashing-template /usr/share/manjaro-arm-tools/templates
sudo buildhaliumzip -d $DEVICE -e $EDITION -v $VERSION -b $BRANCH
ls -lasih /var/cache/manjaro-arm-tools/img
FILE_PATH=$(find /var/cache/manjaro-arm-tools/img -type f -name "*.zip" -exec stat -c '%Y %n' {} \; | sort -nr | awk 'NR==1 {print $2}')
cp -v $FILE_PATH .
echo "::set-output name=file-path::$(basename $FILE_PATH)"
echo "FILE_PATH=$(basename $FILE_PATH)" >> $GITHUB_ENV
-
name: show storage
shell: bash
run: |
df -h