This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
Make Config #22
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: Make Config | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 1 * *' | |
env: | |
REPO_URL: https://github.com/mingxiaoyu/immortalwrt | |
REPO_BRANCH: openwrt-21-r1lts | |
CONFIG_FILE: immortalwrt.config | |
DIY_P1_SH: diy-part1.sh | |
DIY_SH: immortalwrt.sh | |
TZ: Asia/Shanghai | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
if: github.event.repository.owner.id == github.event.sender.id | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Initialization Environment | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
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) tree | |
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 | |
sudo mkdir -p /upload | |
sudo chown $USER:$GROUPS /upload | |
cd /upload | |
echo "UPLOAD=$PWD" >> $GITHUB_ENV | |
- name: Clone source code | |
working-directory: /workdir | |
run: | | |
df -hT $PWD | |
git clone $REPO_URL -b $REPO_BRANCH openwrt | |
ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt | |
- name: Update & Install Feeds | |
run: | | |
chmod +x $DIY_P1_SH | |
cd openwrt | |
$GITHUB_WORKSPACE/$DIY_P1_SH | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
- name: Load Custom Configuration | |
run: | | |
[ -e $CONFIG_FILE ] && cp $CONFIG_FILE openwrt/.config | |
chmod +x $DIY_SH | |
cd openwrt | |
$GITHUB_WORKSPACE/$DIY_SH | |
make defconfig | |
- name: Make Config | |
run: | | |
rm -rf openwrt/.config.old | |
mv -f openwrt/.config openwrt/.config.old | |
mv -f $CONFIG_FILE openwrt/.config | |
cd openwrt | |
ls -a | |
make defconfig | |
cp .config ${UPLOAD}/build.config | |
- name: Upload Config | |
uses: actions/upload-artifact@master | |
with: | |
name: OpenWrt_Config | |
path: ${{env.UPLOAD}} | |