meson8b测试 #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: meson8b测试 | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
# 定时触发编译 | |
schedule: | |
- cron: 1 20 * * 4 | |
# 点赞☆Star触发编译 | |
# watch: | |
# types: [started] | |
jobs: | |
Build_meson8b: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v3 | |
- name: Initialization environment | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo timedatectl set-timezone "Asia/Shanghai" | |
sudo -E swapoff -a | |
sudo -E rm -f /swapfile | |
sudo -E docker image prune -a -f | |
sudo -E snap set system refresh.retain=2 | |
sudo -E apt-get -y purge dotnet* firefox ghc* google* hhvm llvm* mono* mysql* openjdk* php* zulu* | |
sudo -E apt-get -y autoremove --purge | |
sudo -E rm -rf /usr/share/dotnet /usr/local/lib/android/sdk /etc/mysql /etc/php /usr/local/share/boost | |
[ -n "$AGENT_TOOLSDIRECTORY" ] && sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
sudo -E apt-get update -y | |
sudo -E apt-get install -y ack antlr3 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-pyelftools libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev python3-setuptools | |
pip install aligo | |
sudo -E apt-get clean | |
git config --global user.name 'GitHub Actions' && git config --global user.email 'noreply@github.com' | |
df -h | |
- name: Clone source code | |
env: | |
REPO_URL: https://github.com/coolsnowwolf/lede | |
REPO_BRANCH: master | |
run: | | |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt | |
cd openwrt | |
cp -f ../diy/lean1.sh ./ | |
chmod +x ./lean1.sh && ./lean1.sh | |
- name: Update & Install feeds | |
working-directory: ./openwrt | |
run: | | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
cp -f ../diy/lean2.sh ./ | |
chmod +x ./lean2.sh && ./lean2.sh | |
- name: Configuration Customization - meson8b cortex-a5+vfpv4 | |
env: | |
CONFIG_FILE: './configs/arm7.config' | |
run: | | |
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config | |
cd openwrt && make defconfig | |
- name: Download package | |
working-directory: ./openwrt | |
run: | | |
make download -j$(nproc) | |
find dl -size -1024c -exec ls -l {} \; | |
find dl -size -1024c -exec rm -f {} \; | |
- name: Build firmware | |
working-directory: ./openwrt | |
run: | | |
make -j$(nproc) V=s | |
- name: Upload bin directory | |
uses: actions/upload-artifact@main | |
with: | |
name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} | |
path: openwrt/bin | |
- name: Assemble Artifact | |
id: assemble_artifact | |
run: | | |
rm -rf ./ARM_Out | |
mkdir -p ./ARM_Out/ | |
getmd5() | |
{ | |
md5sum=`md5sum $1` | |
md5=`echo ${md5sum% *}` | |
md5=`echo ${md5:0:10}` | |
} | |
rom=openwrt/bin/targets/meson/meson8b/openwrt-*.img.gz | |
getmd5 $rom | |
cp -a $rom ./ARM_Out/openwrt-$(date +%Y%m%d)_${md5}.img.gz | |
- name: Upload Firmwares | |
uses: actions/upload-artifact@main | |
with: | |
name: meson8b | |
path: ARM_Out/*.img.gz | |
- name: Upload config | |
uses: actions/upload-artifact@main | |
with: | |
name: meson8b-config | |
path: openwrt/.config | |
- name: Upload Packages | |
uses: actions/upload-artifact@main | |
with: | |
name: armv7-Packages | |
path: openwrt/bin/packages | |
- name: Generate Tag & Release Name | |
id: generate_name | |
run: | | |
time=$(date +%Y%m%d%H%M%S) | |
release_tag="$time" | |
release_name="meson8b-$(date +%Y%m%d)" | |
echo "release_name=$release_name" >> $GITHUB_OUTPUT | |
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT | |
- name: Create Release & Upload | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: ARM_Out/*.img.gz | |
name: ${{ steps.generate_name.outputs.release_name }} | |
tag: ${{ steps.generate_name.outputs.release_tag }} | |
token: ${{ secrets.GITHUB_TOKEN }} |