mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
Openwrt-CI: small cleanup (#10848)
This commit is contained in:
parent
91bc6bfd32
commit
f1cd5542cf
61
.github/workflows/openwrt-ci.yml
vendored
61
.github/workflows/openwrt-ci.yml
vendored
@ -10,9 +10,7 @@ name: OpenWrt-CI
|
|||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: 0 20 * * *
|
- cron: 0 20 * * *
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
@ -20,35 +18,28 @@ jobs:
|
|||||||
|
|
||||||
build_openwrt:
|
build_openwrt:
|
||||||
|
|
||||||
permissions:
|
name: Build OpenWrt Firmware
|
||||||
contents: write # for release creation
|
|
||||||
|
|
||||||
name: Build OpenWrt firmware
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
if: github.event.repository.owner.id == github.event.sender.id || ! github.event.sender.id
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Space cleanup and Initialization environment
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
ref: master
|
|
||||||
|
|
||||||
- name: Space cleanup
|
|
||||||
env:
|
env:
|
||||||
DEBIAN_FRONTEND: noninteractive
|
DEBIAN_FRONTEND: noninteractive
|
||||||
run: |
|
run: |
|
||||||
docker rmi `docker images -q`
|
docker rmi `docker images -q`
|
||||||
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d /usr/local/lib/android
|
sudo -E rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d /usr/local/lib/android
|
||||||
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* adoptopenjdk* mysql* php* mongodb* dotnet* moby* snapd* || true
|
sudo -E apt update
|
||||||
sudo -E apt-get update
|
sudo -E apt -y purge azure-cli* docker* ghc* zulu* llvm* firefox google* dotnet* powershell* openjdk* mysql* php* mongodb* dotnet* moby* snap*
|
||||||
sudo -E apt-get -y install ack antlr3 aria2 asciidoc autoconf automake autopoint binutils bison build-essential bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
|
sudo -E apt -y full-upgrade
|
||||||
sudo -E apt-get -y autoremove --purge
|
sudo -E apt -y install ack antlr3 aria2 asciidoc autoconf automake autopoint binutils bison build-essential bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python3 python3-pip libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev
|
||||||
sudo -E apt-get clean
|
sudo -E systemctl daemon-reload
|
||||||
|
sudo -E apt -y autoremove --purge
|
||||||
|
sudo -E apt clean
|
||||||
|
sudo -E timedatectl set-timezone "Asia/Shanghai"
|
||||||
|
|
||||||
df -h
|
- name: Checkout OpenWrt
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Update feeds
|
- name: Update feeds
|
||||||
run: |
|
run: |
|
||||||
@ -59,10 +50,8 @@ jobs:
|
|||||||
- name: Generate configuration file
|
- name: Generate configuration file
|
||||||
run: make defconfig
|
run: make defconfig
|
||||||
|
|
||||||
- name: Make download
|
- name: Download packages
|
||||||
run: |
|
run: make download -j16
|
||||||
make download -j8
|
|
||||||
find dl -size -1024c -exec rm -f {} \;
|
|
||||||
|
|
||||||
- name: Compile firmware
|
- name: Compile firmware
|
||||||
run: |
|
run: |
|
||||||
@ -78,38 +67,26 @@ jobs:
|
|||||||
|
|
||||||
- name: Prepare artifact
|
- name: Prepare artifact
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ./artifact/firmware
|
|
||||||
mkdir -p ./artifact/package
|
mkdir -p ./artifact/package
|
||||||
mkdir -p ./artifact/buildinfo
|
mkdir -p ./artifact/buildinfo
|
||||||
rm -rf $(find ./bin/targets/ -type d -name "packages")
|
rm -rf $(find ./bin/targets/ -type d -name "packages")
|
||||||
cp -rf $(find ./bin/targets/ -type f) ./artifact/firmware/
|
|
||||||
cp -rf $(find ./bin/packages/ -type f -name "*.ipk") ./artifact/package/
|
cp -rf $(find ./bin/packages/ -type f -name "*.ipk") ./artifact/package/
|
||||||
cp -rf $(find ./bin/targets/ -type f -name "*.buildinfo" -o -name "*.manifest") ./artifact/buildinfo/
|
cp -rf $(find ./bin/targets/ -type f -name "*.buildinfo" -o -name "*.manifest") ./artifact/buildinfo/
|
||||||
|
|
||||||
- name: Deliver buildinfo
|
- name: Upload buildinfo
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: OpenWrt_buildinfo
|
name: OpenWrt_buildinfo
|
||||||
path: ./artifact/buildinfo/
|
path: ./artifact/buildinfo/
|
||||||
|
|
||||||
- name: Deliver package
|
- name: Upload package
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: OpenWrt_package
|
name: OpenWrt_package
|
||||||
path: ./artifact/package/
|
path: ./artifact/package/
|
||||||
|
|
||||||
- name: Deliver firmware
|
- name: Upload firmware
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: OpenWrt_firmware
|
name: OpenWrt_firmware
|
||||||
path: ./bin/targets/
|
path: ./bin/targets/
|
||||||
|
|
||||||
|
|
||||||
- name: Upload release asset
|
|
||||||
if: github.event == 'release'
|
|
||||||
uses: svenstaro/upload-release-action@v2
|
|
||||||
with:
|
|
||||||
repo_token: ${{ secrets.YOURTOKEN }}
|
|
||||||
file: ./artifact/firmware/*
|
|
||||||
tag: ${{ github.ref }}
|
|
||||||
file_glob: true
|
|
||||||
|
Loading…
Reference in New Issue
Block a user