forked from JiaY-shi/build-gl.inet
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (74 loc) · 2.65 KB
/
build-glinet.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
name: build gl.inet
on:
workflow_dispatch:
inputs:
device:
description: '选择设备'
required: true
default: 'target_wlan_ap-gl-ax1800'
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
- target_ipq40xx_gl-a1300
- target_mt7981_gl-mt2500
- target_mt7981_gl-mt3000
- target_siflower_gl-sf1200
- target_siflower_gl-sft1200
- target_ramips_gl-mt1300
ui:
description: '是否包含官方UI (目前支持IPQ6018系列、mt7981系列和GL-A1300)'
required: false
type: boolean
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 python 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 ~ ${{ inputs.device }} ${{ inputs.ui }}
- name: Organize files
id: organize
if: true && !failure() && !cancelled()
run: |
cd ~/firmware
echo "FIRMWARE=$PWD" >> $GITHUB_ENV
cd ~/packages
echo "PACKAGES=$PWD" >> $GITHUB_ENV
echo "status=success" >> $GITHUB_OUTPUT
- 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: Upload packages directory
uses: actions/upload-artifact@main
if: steps.organize.outputs.status == 'success' && !cancelled() && !failure()
with:
name: OpenWrt_packages${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: ${{ env.PACKAGES }}
- name: Generate release tag
id: tag
if: true && !failure() && !cancelled()
run: |
echo "release_tag=${{inputs.device}}.${{ inputs.ui }}.$(date +"%Y.%m.%d-%H%M")" >> $GITHUB_OUTPUT
echo "status=success" >> $GITHUB_OUTPUT
- 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 }}/*