forked from ophub/amlogic-s9xxx-openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
59 lines (57 loc) · 2.22 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
name: 'Use ophub script to package Armvirt as OpenWrt'
author: 'ophub'
description: 'Package Armvirt as OpenWrt. Support Amlogic s9xxx tv box.'
inputs:
mode:
description: 'Choose script.'
required: false
default: 'ophub'
amlogic_openwrt:
description: 'Choose Amlogic SoC.'
required: false
default: 's905d_s905x3'
amlogic_kernel:
description: 'Choose kernel.'
required: false
default: '5.15.25_5.4.180'
auto_kernel:
description: 'Auto use the latest kernel.'
required: false
default: 'true'
amlogic_size:
description: 'Choose rootfs size.'
required: false
default: '1024'
armvirt64_path:
description: 'Choose armvirt64 file path.'
required: false
default: 'openwrt/bin/targets/*/*/*.tar.gz'
runs:
using: "composite"
steps:
- shell: bash
run: |
cd ${GITHUB_ACTION_PATH}
echo -e "ophub package actions path: ${PWD}"
[ -z "${{ inputs.armvirt64_path }}" ] && echo -e "The [ armvirt64_path ] variable must be specified." && exit 1
[ -d openwrt-armvirt ] || sudo mkdir -p openwrt-armvirt
sudo cp -f ${GITHUB_WORKSPACE}/${{ inputs.armvirt64_path }} openwrt-armvirt && sync
make_command=" -d"
[ -n ${{ inputs.amlogic_openwrt }} ] && make_command="${make_command} -b ${{ inputs.amlogic_openwrt }}"
[ -n ${{ inputs.amlogic_kernel }} ] && make_command="${make_command} -k ${{ inputs.amlogic_kernel }}"
[ -n ${{ inputs.auto_kernel }} ] && make_command="${make_command} -a ${{ inputs.auto_kernel }}"
[ -n ${{ inputs.amlogic_size }} ] && make_command="${make_command} -s ${{ inputs.amlogic_size }}"
sudo chmod +x make
sudo ./make ${make_command}
echo -e "Output environment variables."
echo "PACKAGED_OUTPUTPATH=${PWD}/out" >> $GITHUB_ENV
echo "PACKAGED_OUTPUTDATE=$(date +"%Y.%m.%d.%H%M")" >> $GITHUB_ENV
echo "PACKAGED_STATUS=success" >> $GITHUB_ENV
echo -e "PACKAGED_OUTPUTPATH: ${PWD}/out"
echo -e "PACKAGED_OUTPUTDATE: $(date +"%Y.%m.%d.%H%M")"
echo -e "PACKAGED_STATUS: success"
echo -e "PACKAGED_OUTPUTPATH files list:"
echo -e "$(ls ${PWD}/out 2>/dev/null) \n"
branding:
icon: 'terminal'
color: 'gray-dark'