Skip to content

mt798x_CI

mt798x_CI #29

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: mt798x_CI
env:
REPO_URL: https://github.com/hanwckf/immortalwrt-mt798x
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 }}
strategy:
matrix:
include:
- build_variant: mt7981-ax3000
platform: mt7981
- build_variant: mt7986-ax4200
platform: mt7986
- build_variant: mt7986-ax6000-256m
platform: mt7986
- build_variant: mt7986-ax6000
platform: mt7986
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-mt798x-scutclient-${build_date}">> $GITHUB_ENV
git clone --depth=1 -b $REPO_BRANCH $REPO_URL openwrt
cd openwrt
bash ../01_prepare.sh
#产生config文件
cat defconfig/${build_variant}.config >.config
bash ../02_add_package.sh
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/
mv openwrt/bin/targets/mediatek/${{env.platform}}/immortalwrt-*squashfs* ./artifact/
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