Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch #13262

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

patch #13262

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: C/C++ CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck
27 changes: 27 additions & 0 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Makefile CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: configure
run: ./configure

- name: Install dependencies
run: make

- name: Run check
run: make check

- name: Run distcheck
run: make distcheck
57 changes: 57 additions & 0 deletions merge-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# This is free software, lisence use MIT.
#
# Copyright (C) 2021 KFERMercer <[email protected]>
#
# <https://github.com/KFERMercer/OpenWrt-CI>
#

name: Merge-upstream

on:
push:
branches:
- master
schedule:
- cron: 30 19 * * *

jobs:

merge:

runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0
lfs: true

- name: Set git config
run : |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git config --global pull.rebase false
git config --global --list

- name: Load upstream commits
run: git pull https://github.com/coolsnowwolf/lede.git --log --no-commit

- name: Apply commit changes
run: |
if [ -f ./.git/MERGE_MSG ]; then
mkdir ./tmp && cp ./.git/MERGE_MSG ./tmp/message
sed -i "1c [bot] AutoMerging: merge all upstream's changes:" ./tmp/message
# sed -i '/^\#.*/d' ./tmp/message
git commit --file="./tmp/message"
else
echo "There is no merge commits."
fi

- name: Push Commits
env:
DOWNSTREAM_BRANCH: master
run: git push origin $DOWNSTREAM_BRANCH
140 changes: 140 additions & 0 deletions openwrt-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
#
# This is free software, lisence use MIT.
#
# Copyright (C) 2019 P3TERX <https://p3terx.com>
# Copyright (C) 2020 KFERMercer <[email protected]>
#
# <https://github.com/KFERMercer/OpenWrt-CI>
#

name: OpenWrt-CI

on:
push:
branches:
- master
# schedule:
# - cron: 0 20 * * *
release:
types: [published]

jobs:

build_openwrt:

name: Build OpenWrt firmware

runs-on: ubuntu-latest

if: github.event.repository.owner.id == github.event.sender.id

steps:

- name: Checkout
uses: actions/checkout@v2
with:
ref: master

- name: Space cleanup
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi `docker images -q`
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d /usr/local/lib/android
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* adoptopenjdk* mysql* php* mongodb* dotnet* moby* snapd* || true
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 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler antlr3 gperf swig libtinfo5
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean

# sudo mkdir -p -m 777 /mnt/openwrt/bin /mnt/openwrt/build_dir/host /mnt/openwrt/build_dir/hostpkg /mnt/openwrt/dl /mnt/openwrt/feeds /mnt/openwrt/staging_dir
# ln -s /mnt/openwrt/bin ./bin
# mkdir -p ./build_dir
# ln -s -f /mnt/openwrt/build_dir/host ./build_dir/host
# ln -s -f /mnt/openwrt/build_dir/hostpkg ./build_dir/hostpkg
# ln -s /mnt/openwrt/dl ./dl
# ln -s /mnt/openwrt/feeds ./feeds
# ln -s /mnt/openwrt/staging_dir ./staging_dir

df -h

- name: Update feeds
run: |
./scripts/feeds update -a
./scripts/feeds install -a

- name: Generate configuration file
run: |
rm -f ./.config*
touch ./.config

#
# 在 cat >> .config <<EOF 到 EOF 之间粘贴你的编译配置, 需注意缩进关系
# 例如:

cat >> .config <<EOF
CONFIG_TARGET_IMAGES_GZIP=y
CONFIG_KERNEL_BUILD_USER="OpenWrt-CI"
CONFIG_KERNEL_BUILD_DOMAIN="Azure"
EOF

#
# ===============================================================
#

sed -i 's/^[ \t]*//g' ./.config
make defconfig

- name: Make download
run: |
make download -j8 || make download -j1 V=s
rm -rf $(find ./dl/ -size -1024c)
df -h

- name: Compile firmware
run: |
make -j$(nproc) || make -j1 V=s
echo "======================="
echo "Space usage:"
echo "======================="
df -h
echo "======================="
du -h ./ --max-depth=1
du -h /mnt/openwrt/ --max-depth=1 || true

- name: Prepare artifact
run: |
mkdir -p ./artifact/firmware
mkdir -p ./artifact/package
mkdir -p ./artifact/buildinfo
rm -rf $(find ./bin/targets/ -type d -name "packages")
cp -rf $(find ./bin/targets/ -type f) ./artifact/firmware/
cp -rf $(find ./bin/packages/ -type f -name "*.ipk") ./artifact/package/
cp -rf $(find ./bin/targets/ -type f -name "*.buildinfo" -o -name "*.manifest") ./artifact/buildinfo/

- name: Deliver buildinfo
uses: actions/upload-artifact@v2
with:
name: OpenWrt_buildinfo
path: ./artifact/buildinfo/

- name: Deliver package
uses: actions/upload-artifact@v2
with:
name: OpenWrt_package
path: ./artifact/package/

- name: Deliver firmware
uses: actions/upload-artifact@v2
with:
name: OpenWrt_firmware
path: ./bin/targets/

- name: Upload release asset
if: github.event == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.YOURTOKEN }}
file: ./artifact/firmware/*
tag: ${{ github.ref }}
file_glob: true