Skip to content

Commit

Permalink
Reinitialize
Browse files Browse the repository at this point in the history
  • Loading branch information
QiuSimons committed Mar 19, 2021
0 parents commit 02eb390
Show file tree
Hide file tree
Showing 92 changed files with 7,183 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/Cleaning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Cleaning

on:
schedule:
- cron: 1 1 * * 1
watch:
types: started

jobs:

Cleanup-Old-Releases:
runs-on: ubuntu-20.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Delete Older Releases
uses: dev-drprasad/delete-older-releases@master
with:
keep_latest: 9
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cleanup-Old-Artifacts:
runs-on: ubuntu-20.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Cleanup Old Action Artifacts
uses: kolpav/purge-artifacts-action@master
with:
token: ${{ github.token }}
expire-in: 7d

Cleanup-Workflow-Logs:
runs-on: ubuntu-20.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Cleanup Workflow Logs
uses: Mattraks/delete-workflow-runs@main
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 7
145 changes: 145 additions & 0 deletions .github/workflows/R2S-OpenWrt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: R2S-OpenWrt

on:
schedule:
- cron: 5 6 * * 0
watch:
types: started

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: Show system
run: |
echo -e "Total CPU cores\t: $(nproc)"
cat /proc/cpuinfo | grep 'model name'
free -h
uname -a
[ -f /proc/version ] && cat /proc/version
[ -f /etc/issue.net ] && cat /etc/issue.net
[ -f /etc/issue ] && cat /etc/issue
ulimit -a
- name: Free disk space
run: |
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 azure* dotnet* firefox ghc* google* hhvm llvm* mono* mysql* openjdk* php* zulu*
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
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"
df -h
- name: Init build dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E rm -rf /etc/apt/sources.list.d
sudo -E apt-get update -y
sudo -E apt-get install -y build-essential rsync asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core p7zip p7zip-full msmtp libssl-dev texinfo libreadline-dev libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint ccache curl wget vim nano python3 python3-pip python3-ply haveged lrzsz device-tree-compiler scons
wget -qO - https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh | sed 's/python-/python3-/g' | /bin/bash
sudo -E apt-get clean -y
git config --global user.name 'GitHub Actions' && git config --global user.email '[email protected]'
df -h
- name: Prepare Mixedwrt
run: |
sudo chown -R runner:runner /home/runner/work/R2S-R4S-X86-OpenWrt
cp -r ./SCRIPTS/R2S/. ./SCRIPTS/
cp -r ./SCRIPTS/. ./
/bin/bash 01_get_ready.sh
- name: Prepare Package
run: |
cd openwrt
cp -r ../SCRIPTS/. ./
/bin/bash 02_prepare_package.sh
/bin/bash 02_target_only.sh
- name: Convert Translation
run: |
cd openwrt
/bin/bash 03_convert_translation.sh
- name: Add ACL
run: |
cd openwrt
/bin/bash 05_create_acl_for_luci.sh -a
- name: Make Config
run: |
cd openwrt
mv ../SEED/R2S/config.seed .config
make defconfig
- name: Smart chmod
run: |
MY_Filter=$(mktemp)
echo '/\.git' > ${MY_Filter}
echo '/\.svn' >> ${MY_Filter}
find ./ -maxdepth 1 | grep -v '\./$' | grep -v '/\.git' | xargs -s1024 chmod -R u=rwX,og=rX
find ./ -type f | grep -v -f ${MY_Filter} | xargs -s1024 file | grep 'executable\|ELF' | cut -d ':' -f1 | xargs -s1024 chmod 755
rm -f ${MY_Filter}
unset MY_Filter
- name: Make Download
run: |
df -h
cd openwrt
make download -j10
- name: Make Toolchain
run: |
df -h
cd openwrt
let make_process=$(nproc)+1
make toolchain/install -j${make_process} V=s
- name: Compile Openwrt
id: compileopenwrt
continue-on-error: true
run: |
df -h
cd openwrt
let Make_Process=$(nproc)+1
make -j${Make_Process} V=w
echo $?
- name: If Error
if: steps.compileopenwrt.outcome == 'failure'
run: |
cat openwrt/.config
echo '================================================================'
cd openwrt && make -j1 V=s
- name: Print Disk Space After
run: df -h
- name: Organize files
id: organize
run: |
rm -rf ./artifact/
mkdir -p ./artifact/
mv openwrt/bin/targets/rockchip/armv8/*sysupgrade.img* ./artifact/
cd ./artifact/
ls -Ahl
gzip -d *.gz && exit 0
gzip --best *.img
ls -Ahl
sha256sum openwrt*r2s* | tee R2S-GC404-$(date +%Y-%m-%d)-21.02.sha256sum
zip R2S-GC404-$(date +%Y-%m-%d)-21.02-ext4.zip *r2s*ext4*
zip R2S-GC404-$(date +%Y-%m-%d)-21.02-sfs.zip *r2s*squashfs*
ls -Ahl
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: OpenWRT_21.02
path: ./artifact/

- name: Create release
id: create_release
uses: ncipollo/[email protected]
with:
name: OpenWRT-R2S-R4S-X86-21.02
allowUpdates: true
tag: 2102
commit: master
replacesArtifacts: true
token: ${{ secrets.workflow_token }}
artifacts: ./artifact/*.zip
145 changes: 145 additions & 0 deletions .github/workflows/R4S-OpenWrt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: R4S-OpenWrt

on:
schedule:
- cron: 5 6 * * 0
watch:
types: started

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: Show system
run: |
echo -e "Total CPU cores\t: $(nproc)"
cat /proc/cpuinfo | grep 'model name'
free -h
uname -a
[ -f /proc/version ] && cat /proc/version
[ -f /etc/issue.net ] && cat /etc/issue.net
[ -f /etc/issue ] && cat /etc/issue
ulimit -a
- name: Free disk space
run: |
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 azure* dotnet* firefox ghc* google* hhvm llvm* mono* mysql* openjdk* php* zulu*
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
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"
df -h
- name: Init build dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E rm -rf /etc/apt/sources.list.d
sudo -E apt-get update -y
sudo -E apt-get install -y build-essential rsync asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core p7zip p7zip-full msmtp libssl-dev texinfo libreadline-dev libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint ccache curl wget vim nano python3 python3-pip python3-ply haveged lrzsz device-tree-compiler scons
wget -qO - https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh | sed 's/python-/python3-/g' | /bin/bash
sudo -E apt-get clean -y
git config --global user.name 'GitHub Actions' && git config --global user.email '[email protected]'
df -h
- name: Prepare Mixedwrt
run: |
sudo chown -R runner:runner /home/runner/work/R2S-R4S-X86-OpenWrt
cp -r ./SCRIPTS/R4S/. ./SCRIPTS/
cp -r ./SCRIPTS/. ./
/bin/bash 01_get_ready.sh
- name: Prepare Package
run: |
cd openwrt
cp -r ../SCRIPTS/. ./
/bin/bash 02_prepare_package.sh
/bin/bash 02_target_only.sh
- name: Convert Translation
run: |
cd openwrt
/bin/bash 03_convert_translation.sh
- name: Add ACL
run: |
cd openwrt
/bin/bash 05_create_acl_for_luci.sh -a
- name: Make Config
run: |
cd openwrt
mv ../SEED/R4S/config.seed .config
make defconfig
- name: Smart chmod
run: |
MY_Filter=$(mktemp)
echo '/\.git' > ${MY_Filter}
echo '/\.svn' >> ${MY_Filter}
find ./ -maxdepth 1 | grep -v '\./$' | grep -v '/\.git' | xargs -s1024 chmod -R u=rwX,og=rX
find ./ -type f | grep -v -f ${MY_Filter} | xargs -s1024 file | grep 'executable\|ELF' | cut -d ':' -f1 | xargs -s1024 chmod 755
rm -f ${MY_Filter}
unset MY_Filter
- name: Make Download
run: |
df -h
cd openwrt
make download -j10
- name: Make Toolchain
run: |
df -h
cd openwrt
let make_process=$(nproc)+1
make toolchain/install -j${make_process} V=s
- name: Compile Openwrt
id: compileopenwrt
continue-on-error: true
run: |
df -h
cd openwrt
let Make_Process=$(nproc)+1
make -j${Make_Process} V=w
echo $?
- name: If Error
if: steps.compileopenwrt.outcome == 'failure'
run: |
cat openwrt/.config
echo '================================================================'
cd openwrt && make -j1 V=s
- name: Print Disk Space After
run: df -h
- name: Organize files
id: organize
run: |
rm -rf ./artifact/
mkdir -p ./artifact/
mv openwrt/bin/targets/rockchip/armv8/*sysupgrade.img* ./artifact/
cd ./artifact/
ls -Ahl
gzip -d *.gz && exit 0
gzip --best *.img
ls -Ahl
sha256sum openwrt*r4s* | tee R4S-GC404-$(date +%Y-%m-%d)-21.02.sha256sum
zip R4S-GC404-$(date +%Y-%m-%d)-21.02-ext4.zip *r4s*ext4*
zip R4S-GC404-$(date +%Y-%m-%d)-21.02-sfs.zip *r4s*squashfs*
ls -Ahl
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: OpenWRT_21.02
path: ./artifact/

- name: Create release
id: create_release
uses: ncipollo/[email protected]
with:
name: OpenWRT-R2S-R4S-X86-21.02
allowUpdates: true
tag: 2102
commit: master
replacesArtifacts: true
token: ${{ secrets.workflow_token }}
artifacts: ./artifact/*.zip
Loading

0 comments on commit 02eb390

Please sign in to comment.