Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
优化并删除无用代码
Browse files Browse the repository at this point in the history
  • Loading branch information
haiibo committed Aug 28, 2022
1 parent 19f586b commit 77548e3
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@
# https://github.com/P3TERX
#===============================================

name: ARMv8_Mini OpenWrt
name: ARMv8 Mini OpenWrt

on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
- cron: '0 23 * * *'

env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
CONFIG_FILE: configs/armv8_mini.config
CONFIG_FILE: configs/armv8-mini.config
DIY_SCRIPT: diy-mini.sh
UPLOAD_BIN_DIR: false
UPLOAD_FIRMWARE: false
Expand All @@ -39,16 +38,14 @@ jobs:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi $(docker images -q)
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /etc/mysql /etc/php /usr/local/lib/android /opt/ghc
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 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 https://is.gd/depends_ubuntu_2204)
sudo -E apt-get -qq install $(curl -fsSL is.gd/depends_ubuntu_2204)
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo timedatectl set-timezone "$TZ"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
df -Th
- name: Clone source code
working-directory: /workdir
Expand Down Expand Up @@ -96,8 +93,7 @@ jobs:
echo "FILE_DATE=_$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
- name: Check space usage
if: (!cancelled())
run: df -Th
run: df -hT

- name: Upload bin directory
uses: actions/upload-artifact@main
Expand All @@ -108,7 +104,7 @@ jobs:

- name: Organize files
id: organize
if: steps.compile.outputs.status == 'success' && !cancelled()
if: steps.compile.outputs.status == 'success'
run: |
cp openwrt/.config build.config
mkdir -p Packages
Expand All @@ -124,14 +120,14 @@ jobs:
- name: Upload firmware directory
uses: actions/upload-artifact@main
if: steps.organize.outputs.status == 'success' && env.UPLOAD_FIRMWARE == 'true' && !cancelled()
if: steps.organize.outputs.status == 'success' && env.UPLOAD_FIRMWARE == 'true'
with:
name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: ${{ env.FIRMWARE }}

- name: Upload firmware to release
uses: ncipollo/release-action@v1
if: steps.organize.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled()
uses: ncipollo/release-action@main
if: steps.organize.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true'
with:
name: R${{ env.DATE }} for ${{ env.FILE_NAME }}
artifacts: ${{ env.FIRMWARE }}/*
Expand All @@ -147,7 +143,7 @@ jobs:
- name: Package armvirt as openwrt
uses: unifreq/openwrt_packit@master
if: steps.organize.outputs.status == 'success' && !cancelled()
if: steps.organize.outputs.status == 'success'
env:
OPENWRT_ARMVIRT: lean/*/*/*rootfs.tar.gz
PACKAGE_SOC: all
Expand All @@ -156,9 +152,15 @@ jobs:
KERNEL_AUTO_LATEST: true
GZIP_IMGS: .gz

- name: Upload openwrt to actions
uses: kittaakos/upload-artifact-as-is@master
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_FIRMWARE == 'true'
with:
path: ${{ env.PACKAGED_OUTPUTPATH }}

- name: Upload openwrt to release
uses: ncipollo/release-action@v1
if: env.PACKAGED_STATUS == 'success' && !cancelled()
uses: ncipollo/release-action@main
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_RELEASE == 'true'
with:
name: R${{ env.DATE }} for ${{ env.PRODUCT_NAME }}
artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/*
Expand Down
45 changes: 31 additions & 14 deletions .github/workflows/ARMv8-Package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
name: ARMv8 Package

on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: '0 15 * * *'
Expand Down Expand Up @@ -42,7 +41,7 @@ jobs:
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 https://is.gd/depends_ubuntu_2204)
sudo -E apt-get -qq install $(curl -fsSL is.gd/depends_ubuntu_2204)
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo timedatectl set-timezone "$TZ"
Expand All @@ -60,25 +59,34 @@ jobs:
echo "useVersionInfo=$useVersionInfo" >> $GITHUB_ENV
echo "DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
- name: Download armvirt firmware
id: download
run: |
mkdir -p openwrt/bin/targets/armvirt/64
cd openwrt/bin/targets/armvirt/64
wget -q https://github.com/${GITHUB_REPOSITORY}/releases/download/ROOTFS_${{ env.VERSION }}/openwrt-armvirt-64-default-rootfs.tar.gz
echo "::set-output name=status::success"
- name: Package armvirt as openwrt
uses: ophub/flippy-openwrt-actions@main
if: steps.download.outputs.status == 'success'
env:
OPENWRT_ARMVIRT: https://github.com/haiibo/OpenWrt/releases/download/ROOTFS_${{ env.VERSION }}/openwrt-armvirt-64-default-rootfs.tar.gz
OPENWRT_ARMVIRT: openwrt/bin/targets/*/*/*rootfs.tar.gz
PACKAGE_SOC: all
KERNEL_REPO_URL: https://github.com/ophub/kernel/tree/main/pub/stable
KERNEL_VERSION_NAME: 5.15.13_5.19.1
KERNEL_AUTO_LATEST: true
GZIP_IMGS: .gz

- name: Upload artifact to actions
- name: Upload openwrt to actions
uses: kittaakos/upload-artifact-as-is@master
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_FIRMWARE == 'true' && !cancelled()
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_FIRMWARE == 'true'
with:
path: ${{ env.PACKAGED_OUTPUTPATH }}

- name: Upload openwrt to release
uses: ncipollo/release-action@v1
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled()
uses: ncipollo/release-action@main
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_RELEASE == 'true'
with:
name: R${{ env.DATE }} for ARMv8_${{ env.VERSION }}
artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/*
Expand All @@ -96,7 +104,7 @@ jobs:
${{ env.useVersionInfo }}
Package-for-Plus:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
if: github.event.repository.owner.id == github.event.sender.id

env:
Expand All @@ -113,7 +121,7 @@ jobs:
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)
sudo -E apt-get -qq install $(curl -fsSL is.gd/depends_ubuntu_2204)
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo timedatectl set-timezone "$TZ"
Expand All @@ -131,25 +139,34 @@ jobs:
echo "useVersionInfo=$useVersionInfo" >> $GITHUB_ENV
echo "DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV
- name: Download armvirt firmware
id: download
run: |
mkdir -p openwrt/bin/targets/armvirt/64
cd openwrt/bin/targets/armvirt/64
wget -q https://github.com/${GITHUB_REPOSITORY}/releases/download/ROOTFS_${{ env.VERSION }}/openwrt-armvirt-64-default-rootfs.tar.gz
echo "::set-output name=status::success"
- name: Package armvirt as openwrt
uses: ophub/flippy-openwrt-actions@main
if: steps.download.outputs.status == 'success'
env:
OPENWRT_ARMVIRT: https://github.com/haiibo/OpenWrt/releases/download/ROOTFS_${{ env.VERSION }}/openwrt-armvirt-64-default-rootfs.tar.gz
OPENWRT_ARMVIRT: openwrt/bin/targets/*/*/*rootfs.tar.gz
PACKAGE_SOC: all
KERNEL_REPO_URL: https://github.com/ophub/kernel/tree/main/pub/stable
KERNEL_VERSION_NAME: 5.15.13_5.19.1
KERNEL_AUTO_LATEST: true
GZIP_IMGS: .gz

- name: Upload artifact to actions
- name: Upload openwrt to actions
uses: kittaakos/upload-artifact-as-is@master
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_FIRMWARE == 'true' && !cancelled()
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_FIRMWARE == 'true'
with:
path: ${{ env.PACKAGED_OUTPUTPATH }}

- name: Upload openwrt to release
uses: ncipollo/release-action@v1
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled()
uses: ncipollo/release-action@main
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_RELEASE == 'true'
with:
name: R${{ env.DATE }} for ARMv8_${{ env.VERSION }}
artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@
# https://github.com/P3TERX
#===============================================

name: ARMv8_Plus OpenWrt
name: ARMv8 Plus OpenWrt

on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: '0 21 * * *'

env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
CONFIG_FILE: configs/armv8_plus.config
CONFIG_FILE: configs/armv8-plus.config
DIY_SCRIPT: diy-script.sh
UPLOAD_BIN_DIR: false
UPLOAD_FIRMWARE: false
Expand All @@ -39,16 +38,14 @@ jobs:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi $(docker images -q)
sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /etc/mysql /etc/php /usr/local/lib/android /opt/ghc
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 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 https://is.gd/depends_ubuntu_2204)
sudo -E apt-get -qq install $(curl -fsSL is.gd/depends_ubuntu_2204)
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo timedatectl set-timezone "$TZ"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
df -Th
- name: Clone source code
working-directory: /workdir
Expand Down Expand Up @@ -96,8 +93,7 @@ jobs:
echo "FILE_DATE=_$(date +"%Y%m%d%H%M")" >> $GITHUB_ENV
- name: Check space usage
if: (!cancelled())
run: df -Th
run: df -hT

- name: Upload bin directory
uses: actions/upload-artifact@main
Expand All @@ -108,7 +104,7 @@ jobs:

- name: Organize files
id: organize
if: steps.compile.outputs.status == 'success' && !cancelled()
if: steps.compile.outputs.status == 'success'
run: |
cp openwrt/.config build.config
mkdir -p Packages
Expand All @@ -124,14 +120,14 @@ jobs:
- name: Upload firmware directory
uses: actions/upload-artifact@main
if: steps.organize.outputs.status == 'success' && env.UPLOAD_FIRMWARE == 'true' && !cancelled()
if: steps.organize.outputs.status == 'success' && env.UPLOAD_FIRMWARE == 'true'
with:
name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }}
path: ${{ env.FIRMWARE }}

- name: Upload firmware to release
uses: ncipollo/release-action@v1
if: steps.organize.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled()
uses: ncipollo/release-action@main
if: steps.organize.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true'
with:
name: R${{ env.DATE }} for ${{ env.FILE_NAME }}
artifacts: ${{ env.FIRMWARE }}/*
Expand All @@ -147,7 +143,7 @@ jobs:
- name: Package armvirt as openwrt
uses: unifreq/openwrt_packit@master
if: steps.organize.outputs.status == 'success' && !cancelled()
if: steps.organize.outputs.status == 'success'
env:
OPENWRT_ARMVIRT: lean/*/*/*rootfs.tar.gz
PACKAGE_SOC: all
Expand All @@ -156,9 +152,15 @@ jobs:
KERNEL_AUTO_LATEST: true
GZIP_IMGS: .gz

- name: Upload openwrt to actions
uses: kittaakos/upload-artifact-as-is@master
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_FIRMWARE == 'true'
with:
path: ${{ env.PACKAGED_OUTPUTPATH }}

- name: Upload openwrt to release
uses: ncipollo/release-action@v1
if: env.PACKAGED_STATUS == 'success' && !cancelled()
uses: ncipollo/release-action@main
if: env.PACKAGED_STATUS == 'success' && env.UPLOAD_RELEASE == 'true'
with:
name: R${{ env.DATE }} for ${{ env.PRODUCT_NAME }}
artifacts: ${{ env.PACKAGED_OUTPUTPATH }}/*
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/Delete-Older-Artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Delete Older Artifacts
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
- cron: '0 3 * * *'

jobs:
Cleaning:
Expand All @@ -14,7 +14,7 @@ jobs:
uses: GitRML/delete-workflow-runs@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
retain_days: 3
retain_days: 7
keep_minimum_runs: 0

- name: Delete Older Releases
Expand Down
Loading

0 comments on commit 77548e3

Please sign in to comment.