forked from Sailfish-On-Vince/ci
-
Notifications
You must be signed in to change notification settings - Fork 0
161 lines (137 loc) · 5.71 KB
/
build.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
#=================================================
# Description: Build Android HAL and dhd packages using GitHub Actions
# Lisence: MIT
# Author: 0312birdzhang
#=================================================
name: Build SailfishOS dhd--test mido
on:
release:
types: [published]
push:
branches:
- mido
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-20.04
#if: github.event.repository.owner.id == github.event.sender.id
env:
DEVICE: mido
VENDOR: xiaomi
ANDROID_ROOT: /home/runner/work/sfos-ci/sfos-ci/hadk_14.1/
SAILFISH_SDK_VERSION: 4.5.0.16
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 20480
swap-size-mb: 1024
remove-dotnet: 'true'
remove-haskell: 'true'
remove-android: 'true'
remove-docker-images: 'true'
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: true
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Checkout
uses: actions/checkout@master
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Initialization environment
run: |
sudo apt-get update
sudo apt-get install -y \
openjdk-8-jdk android-tools-adb bc bison \
build-essential curl flex g++-multilib gcc-multilib gnupg gperf \
imagemagick lib32ncurses-dev qemu-user-static \
lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev \
libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev \
qemu-user-static qemu-system-arm e2fsprogs simg2img \
libtinfo5 libncurses5 gzip virtualenv git python2
- name: Download repo bin file
run: |
mkdir -p ~/bin
wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P ~/bin
chmod +x ~/bin/repo
git config --global user.name "gmicroul"
git config --global user.email "[email protected]"
- name: Downloading source code
run: |
source hadk.env
mkdir -p $ANDROID_ROOT
cd $ANDROID_ROOT
repo init -u https://github.com/mer-hybris/android.git -b hybris-14.1 --depth=1
repo sync -j8 -c --no-clone-bundle --no-tags
git clone https://github.com/piggz/android_device_xiaomi_mido.git -b pgz-14.1 $ANDROID_ROOT/device/xiaomi/mido --depth=1
git clone https://gitlab.com/the-muppets/proprietary_vendor_xiaomi.git -b cm-14.1 $ANDROID_ROOT/vendor/xiaomi/tmp --depth=1
mv $ANDROID_ROOT/vendor/xiaomi/tmp/mido $ANDROID_ROOT/vendor/xiaomi/mido
rm -rf $ANDROID_ROOT/vendor/xiaomi/tmp
git clone https://github.com/piggz/android_kernel_xiaomi_msm8953.git -b pgz-14.1-eb8 $ANDROID_ROOT/kernel/xiaomi/msm8953 --depth=1
- name: Clone device spec source
run: |
source hadk.env
cd $ANDROID_ROOT
repo sync -j8 -c --no-clone-bundle --no-tags #rerun once
rm -rf $ANDROID_ROOT/hybris/hybris-boot
git clone https://github.com/Sailfish-On-vince/hybris-boot.git $ANDROID_ROOT/hybris/hybris-boot
git clone https://github.com/Sailfish-On-vince/hybris-installer.git $ANDROID_ROOT/hybris/hybris-installer
git clone --recurse-submodules https://github.com/Sailfish-On-vince/droid-hal-vince.git -b for_mido $ANDROID_ROOT/rpm
git clone --recurse-submodules https://github.com/0312birdzhang/droid-config-mido.git $ANDROID_ROOT/hybris/droid-configs
git clone --recurse-submodules https://github.com/piggz/droid-hal-version-mido.git $ANDROID_ROOT/hybris/droid-hal-version-mido
rm -rf $ANDROID_ROOT/external/droidmedia
git clone https://github.com/sailfishos/droidmedia.git $ANDROID_ROOT/external/droidmedia
- name: Cache build output
uses: actions/cache@v3
id: build-cache
with:
path: ${{env.ANDROID_ROOT}}/out
key: build-hal-${{ hashFiles('kernel/xiaomi/msm8953/arch/arm64/configs/mido_defconfig') }}
restore-keys: |
build-hal-
- name: Build HAL
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
chmod +x build-hal.sh
sudo ln -sf /usr/bin/python2.7 /usr/bin/python
bash build-hal.sh
shell: bash
- name: Build dhd in container
run: |
chmod +x build-rpm.sh
sudo docker pull coderus/sailfishos-platform-sdk:$SAILFISH_SDK_VERSION
sudo docker run --privileged -v /home/runner/work:/home/mersdk/work coderus/sailfishos-platform-sdk:$SAILFISH_SDK_VERSION /bin/sh /home/mersdk/work/sfos-ci/sfos-ci/build-rpm.sh
shell: bash
- name: Check free disk
if: failure()
run: |
df -h
shell: bash
- name: Upload flashable zip
id: upload-action
uses: actions/upload-artifact@master
with:
name: sailfishos.zip
path: ${{env.ANDROID_ROOT}}/SailfishOScommunity-release-*/sailfishos-*-${{env.DEVICE}}*.zip
- name: Upload image to Release
uses: ncipollo/release-action@mido
if: steps.upload-action.outputs.status == 'success' && !cancelled()
with:
tag: sailfishos_for_mido
artifacts: ${{env.ANDROID_ROOT}}/SailfishOScommunity-release-*/sailfishos-*-${{env.DEVICE}}*.zip
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
body: |
This is mido sailfishos 5.0.0.29