-
Notifications
You must be signed in to change notification settings - Fork 1.9k
127 lines (112 loc) · 4.3 KB
/
build-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
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
#========================================================================================================================
# Description: Build Armbian For Amlogic S9xxx STB
# Copyright (C) 2021 https://github.com/ophub/amlogic-s9xxx-armbian
#========================================================================================================================
name: Build Armbian For Amlogic
on:
repository_dispatch:
workflow_dispatch:
inputs:
ssh:
description: 'SSH connection to Actions'
required: false
default: 'false'
schedule:
- cron: '0 17 * * 0'
env:
ARMBIAN_BOARD: lepotato
ARMBIAN_HOST: armbian
UPLOAD_FIRMWARE: false
UPLOAD_RELEASE: true
DELETE_RELEASE: true
DELETE_ARTIFACTS: true
KEEP_DAY: 1
KEEP_MININUM_RUNS: 0
KEEP_MININUM_RELEASE: 2
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
- name: Download source code
id: down
run: |
git clone --depth 1 https://github.com/armbian/build.git
- name: SSH connection to Actions @ Ctrl+C to enter, Ctrl+D to exit
uses: P3TERX/ssh2actions@main
if: (github.event.inputs.ssh == 'true' && github.event.inputs.ssh != 'false') || contains(github.event.action, 'ssh')
env:
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
- name: Build Armbian
id: build
run: |
cd build/
sudo chmod +x compile.sh
sudo ./compile.sh BOARD="${{ env.ARMBIAN_BOARD }}" HOST="${{ env.ARMBIAN_HOST }}" BRANCH=current RELEASE=buster \
BUILD_MINIMAL=no BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,img
echo "::set-output name=status::success"
- name: Make Armbian for amlogic s9xxx
id: make
if: steps.build.outputs.status == 'success'
run: |
sudo chmod +x make
sudo ./make s922x_s905x3_s905d
sudo ./make s905x_s905w 5.4.149
cd ./build/output/images && sudo gzip *.img && sync
echo "FILEPATH=$PWD" >> $GITHUB_ENV
echo "FILE_DATE=$(date +"%Y.%m.%d.%H%M")" >> $GITHUB_ENV
echo "::set-output name=status::success"
- name: Upload Armbian image to Actions
uses: kittaakos/upload-artifact-as-is@master
if: steps.build.outputs.status == 'success' && env.UPLOAD_FIRMWARE == 'true' && !cancelled()
with:
path: ${{ env.FILEPATH }}/
- name: Upload Armbian image to Release
id: release
uses: ncipollo/release-action@v1
if: steps.make.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled()
with:
tag: Armbian_Aml_buster_${{ env.FILE_DATE }}
artifacts: ${{ env.FILEPATH }}/*
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
body: |
This is Armbian image for amlogic s9xxx STB
* Firmware information
Default username: root
Default password: 1234
Install to EMMC command: armbian-install
Update command: armbian-update
- name: Delete older releases
uses: dev-drprasad/delete-older-releases@master
if: env.DELETE_RELEASE == 'true'
with:
keep_latest: ${{ env.KEEP_MININUM_RELEASE }}
delete_tags: true
delete_tag_pattern: _
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete older workflow runs and artifacts
uses: Mattraks/delete-workflow-runs@main
if: env.DELETE_ARTIFACTS == 'true'
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
retain_days: ${{ env.KEEP_DAY }}
keep_minimum_runs: ${{ env.KEEP_MININUM_RUNS }}