forked from JiaY-shi/build-gl.inet
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (78 loc) · 2.67 KB
/
Slate-AXT1800.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
name: Slate-AXT1800
on:
workflow_dispatch:
inputs:
device:
description: '选择设备'
required: false
default: 'target_wlan_ap-gl-axt1800'
type: choice
options:
- target_wlan_ap-gl-ax1800
- target_wlan_ap-gl-axt1800
- target_wlan_ap-gl-ax1800-5-4
- target_wlan_ap-gl-axt1800-5-4
ui:
description: '是否包含官方UI'
required: false
type: boolean
schedule:
- cron: 0 16 * * *
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: update
run: |
sudo apt update
sudo apt upgrade -y
sudo apt install build-essential libncurses5-dev gawk git libssl-dev gettext zlib1g-dev swig unzip time rsync python3 python3-setuptools python3-yaml subversion -y
git config --global user.email "[email protected]"
git config --global user.name "aa"
- name: make
run: |
./build.sh ~ target_wlan_ap-gl-axt1800 ${{ inputs.ui }}
- name: Organize files
id: organize
if: true && !failure() && !cancelled()
run: |
cd ~/gl-infra-builder/wlan-ap/openwrt/bin/targets/*/*
rm -rf packages
echo "FIRMWARE=$PWD" >> $GITHUB_ENV
echo "::set-output name=status::success"
- name: Upload firmware directory
uses: actions/upload-artifact@main
if: steps.organize.outputs.status == 'success' && !cancelled() && !failure()
with:
name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: ${{ env.FIRMWARE }}
- name: Generate release tag
id: tag
if: true && !failure() && !cancelled()
run: |
echo "::set-output name=release_tag::Slate-AXT1800-$(date +"%Y.%m.%d-%H%M")"
touch release.txt
echo "Slate AX(GL-AXT1800)-4.4 Firmware" >> release.txt
echo "::set-output name=status::success"
- name: Upload firmware to release
uses: softprops/action-gh-release@v1
if: steps.tag.outputs.status == 'success' && !cancelled() && !failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
files: ${{ env.FIRMWARE }}/*
- name: Delete workflow runs
uses: GitRML/delete-workflow-runs@main
with:
retain_days: 7
keep_minimum_runs: 7
- name: Remove old Releases
uses: dev-drprasad/[email protected]
if: env.UPLOAD_RELEASE == 'true' && !cancelled()
with:
keep_latest: 1
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}