forked from ophub/amlogic-s9xxx-armbian
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (83 loc) · 3.27 KB
/
rebuild-armbian.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
#==========================================================================
# Description: Build Armbian For Amlogic s9xxx tv box
# Copyright (C) 2021 https://github.com/ophub/amlogic-s9xxx-armbian
#==========================================================================
name: Rebuild armbian
on:
repository_dispatch:
workflow_dispatch:
inputs:
armbian_url:
description: "Input armbian path"
required: false
default: ""
env:
TZ: Asia/Shanghai
jobs:
build:
runs-on: ubuntu-20.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo -E apt-get -qq update
sudo -E apt-get -qq install $(curl -fsSL git.io/ubuntu-2004-server)
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo timedatectl set-timezone "$TZ"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
# Get the url of the rebuild armbian file
armbian_url="${{ github.event.inputs.armbian_url }}"
if [[ -z "${armbian_url}" ]]; then
armbian_site="https://armbian.tnahosting.net/dl/lepotato/archive/"
armbian_name="Armbian.*focal.*.img.xz"
armbian_file=$(curl -s "${armbian_site}" | grep -oE "${armbian_name}" | head -n 1)
if [ -n "${armbian_file}" ]; then
armbian_url="${armbian_site}/${armbian_file}"
else
echo -e "Invalid download path: [ ${armbian_site} ]"
exit 1
fi
fi
echo "ARMBIAN_URL=${armbian_url}" >> $GITHUB_ENV
echo "COMPILE_STARTINGTIME=$(date +"%m.%d.%H%M")" >> $GITHUB_ENV
# Get the release name of the rebuild armbian file
set_release="_"
ARR_RELEASE=("bionic" "focal" "hirsute" "bullseye" "buster" "stretch")
i=1
for r in ${ARR_RELEASE[*]}; do
if [[ "${armbian_url}" == *${r}* ]]; then
set_release="_${r}_"
break
fi
let i++
done
echo "ARMBIAN_RELEASE=${set_release}" >> $GITHUB_ENV
- name: Rebuild Armbian for Amlogic s9xxx
uses: ophub/amlogic-s9xxx-armbian@main
with:
armbian_path: ${{ env.ARMBIAN_URL }}
armbian_soc: s905x3_s905d
armbian_kernel: 5.15.25_5.4.180
- name: Upload Armbian image to Release
id: release
uses: ncipollo/release-action@v1
if: env.PACKAGED_STATUS == 'success' && !cancelled()
with:
tag: Armbian_Aml${{ env.ARMBIAN_RELEASE }}${{ env.PACKAGED_OUTPUTDATE }}
artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/*
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
body: |
This is Armbian image for Amlogic s9xxx tv box
* Firmware information
Default username: root
Default password: 1234
Install to EMMC command: armbian-install
Update command: armbian-update