forked from ubports-on-vince/ubports-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (75 loc) · 3.19 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
#=================================================
# Description: Build ubports using GitHub Actions
# Lisence: MIT
# Author: 0312birdzhang
# Credit: https://github.com/P3TERX/Actions-OpenWrt
#=================================================
name: Build Ubports
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@master
- name: Initialization environment
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
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 \
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
sudo docker rmi `docker images -q`
sudo rm -rf \
/usr/share/dotnet \
/etc/mysql \
/etc/php
mkdir -p ~/bin
wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P ~/bin
chmod +x ~/bin/repo
git config --global user.name "BirdZhang"
git config --global user.email "[email protected]"
source halium.env
export FLASHABLE_DIR=ubports-`date +%Y%m%d-%H%M%S`-devel-$DEVICE
echo $FLASHABLE_DIR > ~/.current_version
echo "::set-env name=VENDOR::$(echo $VENDOR)"
echo "::set-env name=DEVICE::$(echo $DEVICE)"
echo "::set-env name=ANDROID_ROOT::$(echo $ANDROID_ROOT)"
echo "::set-env name=FLASHABLE_DIR::$(echo $FLASHABLE_DIR)"
- name: Downloading source code
run: |
source halium.env
mkdir -p $ANDROID_ROOT
cd $ANDROID_ROOT
repo init -u https://github.com/Halium/android -b halium-7.1 --depth=1
repo sync -j8 -c --no-clone-bundle --no-tags
- name: Clone device spec source
run: |
source halium.env
git clone https://github.com/ubports-on-vince/device_xiaomi_vince.git $ANDROID_ROOT/device/xiaomi/vince --depth=1
git clone https://github.com/ubports-on-vince/vendor_xiaomi_vince.git $ANDROID_ROOT/vendor/xiaomi/vince --depth=1
rm -rf $ANDROID_ROOT/halium/hybris-boot
git clone https://github.com/Sailfish-On-Vince/hybris-boot.git $ANDROID_ROOT/halium/hybris-boot
git clone https://github.com/ubports-on-vince/Xiaomi_Kernel_OpenSource.git -b tiffany-n-oss $ANDROID_ROOT/kernel/xiaomi/msm8953 --depth=1
git clone https://android.googlesource.com/platform/external/curl.git -b android-7.1.2_r37 $ANDROID_ROOT/external/libcurl --depth=1
- name: Build HAL
run: |
chmod +x build-hal.sh
bash -x build-hal.sh
shell: bash
- name: Build Package
run: |
chmod +x package.sh
bash -x package.sh
shell: bash
- name: Upload flashable zip
uses: actions/upload-artifact@master
with:
name: ${{env.FLASHABLE_DIR}}.zip
path: /home/runner/work/${{env.FLASHABLE_DIR}}.zip