Skip to content

Commit

Permalink
Tab
Browse files Browse the repository at this point in the history
  • Loading branch information
FeliciaWen committed Aug 25, 2021
1 parent 90cac67 commit 02d0860
Showing 1 changed file with 117 additions and 117 deletions.
234 changes: 117 additions & 117 deletions .github/workflows/d-team_newifi-d2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,137 +40,137 @@ env:

jobs:
mt76:
runs-on: ubuntu-latest
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@main
steps:
- name: Checkout
uses: actions/checkout@main

- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt-get update
sudo -E apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync
sudo timedatectl set-timezone "Asia/Shanghai"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
echo "Compile_Date=$(date +%Y%m%d%H%M)" > $GITHUB_WORKSPACE/Openwrt.info
echo "Display_Date=$(date +%Y/%m/%d)" >> $GITHUB_WORKSPACE/Openwrt.info
echo "Defined_IP_Address=${{ github.event.inputs.ip_addr }}" >> $GITHUB_WORKSPACE/Openwrt.info
echo "Artifacts_Date=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
touch update_log.txt
- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt-get update
sudo -E apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync
sudo timedatectl set-timezone "Asia/Shanghai"
sudo mkdir -p /workdir
sudo chown $USER:$GROUPS /workdir
echo "Compile_Date=$(date +%Y%m%d%H%M)" > $GITHUB_WORKSPACE/Openwrt.info
echo "Display_Date=$(date +%Y/%m/%d)" >> $GITHUB_WORKSPACE/Openwrt.info
echo "Defined_IP_Address=${{ github.event.inputs.ip_addr }}" >> $GITHUB_WORKSPACE/Openwrt.info
echo "Artifacts_Date=$(date +%Y%m%d%H%M)" >> $GITHUB_ENV
touch update_log.txt
- name: Remove useless files
if: env.REMOVE_USELESS_FILES == 'true' && !cancelled()
run: |
echo "Deleting useless files, please wait ..."
docker rmi `docker images -q`
sudo rm -rf \
/usr/share/dotnet \
/etc/mysql \
/etc/php
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
- name: Remove useless files
if: env.REMOVE_USELESS_FILES == 'true' && !cancelled()
run: |
echo "Deleting useless files, please wait ..."
docker rmi `docker images -q`
sudo rm -rf \
/usr/share/dotnet \
/etc/mysql \
/etc/php
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
- name: Clone source code
run: |
git clone -b $REPO_BRANCH $REPO_URL openwrt
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
[ -f Configs/$CONFIG_MT76 ] && cp Configs/$CONFIG_MT76 openwrt/.config || {
echo "未检测到该设备的 $CONFIG_MT76 配置文件!"
exit 1
}
cd openwrt
sed -i "s/FEATURES:=/FEATURES:=ubifs nand /" target/linux/ramips/Makefile
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
- name: Clone source code
run: |
git clone -b $REPO_BRANCH $REPO_URL openwrt
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt
[ -f Configs/$CONFIG_MT76 ] && cp Configs/$CONFIG_MT76 openwrt/.config || {
echo "未检测到该设备的 $CONFIG_MT76 配置文件!"
exit 1
}
cd openwrt
sed -i "s/FEATURES:=/FEATURES:=ubifs nand /" target/linux/ramips/Makefile
./scripts/feeds update -a
./scripts/feeds install -a
make defconfig
- name: Run Custom Firmware-Diy Scripts
run: |
chmod +x $DIY_SCRIPT
chmod +x $FUNCTION_SCRIPT
cd openwrt
source $GITHUB_WORKSPACE/$DIY_SCRIPT
source $GITHUB_WORKSPACE/$FUNCTION_SCRIPT && Firmware-Diy_Base
Firmware-Diy
- name: Run Custom Firmware-Diy Scripts
run: |
chmod +x $DIY_SCRIPT
chmod +x $FUNCTION_SCRIPT
cd openwrt
source $GITHUB_WORKSPACE/$DIY_SCRIPT
source $GITHUB_WORKSPACE/$FUNCTION_SCRIPT && Firmware-Diy_Base
Firmware-Diy
- name: SSH connection to Actions
uses: P3TERX/[email protected]
if: (github.event.inputs.ssh == 'true' && github.event.inputs.ssh != 'false') || contains(github.event.action, 'ssh')
env:
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
- name: SSH connection to Actions
uses: P3TERX/[email protected]
if: (github.event.inputs.ssh == 'true' && github.event.inputs.ssh != 'false') || contains(github.event.action, 'ssh')
env:
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}

- name: Preload and Compile the Openwrt
run: |
cp Configs/$CONFIG_MT76 openwrt/.config
cd openwrt
sed -i "s/beta/beta-mt76/g" package/base-files/files/bin/AutoUpdate.sh
cat .config
./scripts/feeds install -a
make defconfig
make download -j$(nproc)
echo "Start to compile OpenWrt ..."
make -j$(nproc) || make -j1 V=s
- name: Preload and Compile the Openwrt
run: |
cp Configs/$CONFIG_MT76 openwrt/.config
cd openwrt
sed -i "s/beta/beta-mt76/g" package/base-files/files/bin/AutoUpdate.sh
cat .config
./scripts/feeds install -a
make defconfig
make download -j$(nproc)
echo "Start to compile OpenWrt ..."
make -j$(nproc) || make -j1 V=s
- name: Process the AutoBuild Firmware
run: |
cd openwrt
source $GITHUB_WORKSPACE/$DIY_SCRIPT
source $GITHUB_WORKSPACE/$FUNCTION_SCRIPT && PS_Firmware
- name: Process the AutoBuild Firmware
run: |
cd openwrt
source $GITHUB_WORKSPACE/$DIY_SCRIPT
source $GITHUB_WORKSPACE/$FUNCTION_SCRIPT && PS_Firmware
- name: Upload Firmware to Artifacts
uses: actions/upload-artifact@main
if: env.UPLOAD_FIRMWARE == 'true' && !cancelled()
with:
name: OpenWrt_Firmware_${{ env.Artifacts_DATE }}
path: openwrt/bin/Firmware
- name: Upload Firmware to Artifacts
uses: actions/upload-artifact@main
if: env.UPLOAD_FIRMWARE == 'true' && !cancelled()
with:
name: OpenWrt_Firmware_${{ env.Artifacts_DATE }}
path: openwrt/bin/Firmware

- name: Upload bin directory to Artifacts
uses: actions/upload-artifact@main
if: env.UPLOAD_BIN_DIR == 'true' && !cancelled()
with:
name: OpenWrt_bin_${{ env.Artifacts_DATE }}
path: openwrt/bin
- name: Upload bin directory to Artifacts
uses: actions/upload-artifact@main
if: env.UPLOAD_BIN_DIR == 'true' && !cancelled()
with:
name: OpenWrt_bin_${{ env.Artifacts_DATE }}
path: openwrt/bin

- name: Upload Firmware to Historial Release
uses: softprops/action-gh-release@v1
if: env.UPLOAD_RELEASE == 'true' && !cancelled()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: history-mt76
body_path: update_log.txt
files: openwrt/bin/Firmware/*
- name: Upload Firmware to Historial Release
uses: softprops/action-gh-release@v1
if: env.UPLOAD_RELEASE == 'true' && !cancelled()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: history-mt76
body_path: update_log.txt
files: openwrt/bin/Firmware/*

- name: Remove old beta Release
uses: dev-drprasad/[email protected]
if: env.REMOVE_OLD_RELEASE == 'true' && !cancelled()
with:
keep_latest: 0
delete_tag_pattern: beta-mt76
delete_tags: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Remove old beta Release
uses: dev-drprasad/[email protected]
if: env.REMOVE_OLD_RELEASE == 'true' && !cancelled()
with:
keep_latest: 0
delete_tag_pattern: beta-mt76
delete_tags: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Firmware to beta Release
uses: softprops/action-gh-release@v1
if: env.UPLOAD_beta_RELEASE == 'true' && !cancelled()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: beta-mt76
body_path: update_log.txt
files: openwrt/bin/Firmware/*
- name: Upload Firmware to beta Release
uses: softprops/action-gh-release@v1
if: env.UPLOAD_beta_RELEASE == 'true' && !cancelled()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: beta-mt76
body_path: update_log.txt
files: openwrt/bin/Firmware/*

- name: Remove workflow runs
uses: GitRML/delete-workflow-runs@main
if: env.REMOVE_WORKFLOW_RUNS == 'true' && !cancelled()
with:
retain_days: 1
keep_minimum_runs: 3
- name: Remove workflow runs
uses: GitRML/delete-workflow-runs@main
if: env.REMOVE_WORKFLOW_RUNS == 'true' && !cancelled()
with:
retain_days: 1
keep_minimum_runs: 3

mtwifi:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 02d0860

Please sign in to comment.