mt7621_CI #25
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
# This is a basic workflow to help you get started with Actions | |
name: mt7621_CI | |
env: | |
REPO_URL: https://github.com/immortalwrt/immortalwrt.git | |
REPO_BRANCH: openwrt-21.02 | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
# push: | |
# branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
permissions: write-all | |
# The type of runner that the job will run on | |
runs-on: ubuntu-20.04 | |
env: | |
build_variant: ${{ matrix.build_variant }} | |
platform: ${{ matrix.platform }} | |
type: ${{ matrix.type }} | |
strategy: | |
matrix: | |
include: | |
- build_variant: mt7621-mini | |
platform: mt7621 | |
type: mini | |
- build_variant: mt7621-full | |
platform: mt7621 | |
type: full | |
if: github.event.repository.owner.id == github.event.sender.id | |
steps: | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
swap-size-mb: 512 | |
temp-reserve-mb: 128 | |
root-reserve-mb: 3072 | |
remove-dotnet: 'true' | |
remove-android: 'true' | |
remove-haskell: 'true' | |
remove-codeql: 'true' | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Init build dependencies | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo apt update -y | |
sudo apt full-upgrade -y | |
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ | |
bzip2 ccache clang clangd cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext gcc-multilib \ | |
g++-multilib git gperf haveged help2man intltool lib32gcc-s1 libc6-dev-i386 libelf-dev libglib2.0-dev \ | |
libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5 libncursesw5-dev libreadline-dev \ | |
libssl-dev libtool lld lldb lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 \ | |
python3 python3-pip python3-ply python3-docutils qemu-utils re2c rsync scons squashfs-tools subversion swig \ | |
texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev | |
- name: Prepare | |
run: | | |
build_date="$(date +%Y%m%d)" | |
image_prefix=immortalwrt-${build_variant}-scutclient | |
echo "image_name=${image_prefix}-${build_date}" >> $GITHUB_ENV | |
echo "release_tag=immortalwrt-mt762x-scutclient-${build_date}">> $GITHUB_ENV | |
git clone --depth=1 -b $REPO_BRANCH $REPO_URL openwrt | |
cd openwrt | |
sh ../01_prepare.sh | |
#产生config文件,编译所有7621机器 | |
cat ../mt7621_config.seed>.config | |
if [ "$type" == "full" ]; then | |
sh ../02_add_package.sh | |
fi | |
make defconfig | |
- name: Make Download | |
run: | | |
cd openwrt | |
make download -j50 | |
- name: Compile | |
id: compileopenwrt | |
continue-on-error: true | |
run: | | |
cd openwrt | |
make -j$(nproc) || make -j1 V=s | |
- name: Package | |
run: | | |
rm -rf ./artifact/ | |
mkdir -p ./artifact/ | |
if [ "$type" == "full" ]; then | |
mv openwrt/bin/targets/ramips/${platform}/immortalwrt*sysupgrade* ./artifact/ | |
else | |
mv openwrt/bin/targets/ramips/${platform}/immortalwrt* ./artifact/ | |
fi | |
cd artifact | |
7z a -mx=9 ../${{ env.image_name }}.7z . | |
- name: Create release | |
id: create_release | |
uses: ncipollo/release-action@v1.12.0 | |
with: | |
name: ${{ env.release_tag }} | |
allowUpdates: true | |
prerelease: false | |
tag: ${{ env.release_tag }} | |
commit: main | |
replacesArtifacts: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: ${{env.image_name}}.7z | |