This repository has been archived by the owner on Jan 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
103 lines (94 loc) · 3.69 KB
/
build-x86_64-generic-minimal-22-03-snapshot.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
name: Build X86_64_Genreic Minimal OpenWrt-22.03-snapshot
on:
repository_dispatch:
types: [openwrt]
workflow_dispatch:
schedule:
- cron: 0 9 * * 1-5
env:
BUILD_CONFIG_FILE: x86_64_generic_22_03_snapshot_minimal
TARGET: x86
SUBTARGET: 64
OPENWRT_VERSION: openwrt-22.03
TYPE: minimal
jobs:
Build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: "main"
fetch-depth: 2
- name: Setup Environment
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/depends-ubuntu-2004) tree
sudo -E apt-get -qq install jq
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
git config --global user.name "I'm a Code Bot"
git config --global user.email "[email protected]"
pip3 install -r requirements.txt
- name: Create
run: |
python3 ./scripts/build.py --config configs/${{ env.BUILD_CONFIG_FILE }} --action create
- name: Feeds
run: |
python3 ./scripts/build.py --config configs/${{ env.BUILD_CONFIG_FILE }} --action feeds
- name: Config
run: |
python3 ./scripts/build.py --config configs/${{ env.BUILD_CONFIG_FILE }} --action config
- name: Download
run: |
python3 ./scripts/build.py --config configs/${{ env.BUILD_CONFIG_FILE }} --action download
- name: Compile
run: |
python3 ./scripts/build.py --config configs/${{ env.BUILD_CONFIG_FILE }} --action compile
- name: Install
run: |
python3 ./scripts/build.py --config configs/${{ env.BUILD_CONFIG_FILE }} --action install
- name: Upload Image
uses: actions/upload-artifact@main
with:
name: ${{ env.BUILD_CONFIG_FILE }}
path: |
./build/${{ env.OPENWRT_VERSION }}/bin/targets/${{ env.TARGET }}/${{ env.SUBTARGET }}/
retention-days: 7
Upload:
needs: [Build]
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: "main"
fetch-depth: 2
- name: Setup Environment
run: |
curl https://rclone.org/install.sh | sudo bash
- name: Download Bin Folder
uses: actions/download-artifact@main
with:
name: ${{ env.BUILD_CONFIG_FILE }}
path: ./build/bin
- name: Upload Image to OneDrive
env:
RCLONE_PACKAGE: ${{ secrets.ONEDRIVE_NAME }}
run: |
mkdir -p ~/.config/rclone/
cat << EOF > /tmp/rclone.de
${{ secrets.ONEDRIVE_CONF }}
EOF
base64 -d /tmp/rclone.de > ~/.config/rclone/rclone.conf
echo "# Rclone Packages Upload Rule" >> /tmp/upload-rule.txt
echo "- openwrt*" >> /tmp/upload-rule.txt
echo "- sha256sums" >> /tmp/upload-rule.txt
echo "- packages-server.zip" >> /tmp/upload-rule.txt
echo "- *.buildinfo" >> /tmp/upload-rule.txt
echo "+ openwrt-keyring*" >> /tmp/upload-rule.txt
rclone mkdir $RCLONE_PACKAGE:Openwrt/${{env.OPENWRT_VERSION}}/$(date +"%Y-%m-%d")/${{ env.TARGET }}/${{ env.SUBTARGET }}/${{ env.TYPE }}
rclone copy ./build/bin $RCLONE_PACKAGE:Openwrt/${{env.OPENWRT_VERSION}}/$(date +"%Y-%m-%d")/${{ env.TARGET }}/${{ env.SUBTARGET }}/${{ env.TYPE }}
echo "::notice file=Firmware-OneDrive::Download Link: https://1drv.ms/u/s!AqG2uRmVUhlSh0NHMLMmQKLyASvi?e=mup3cd"