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

release方法下载比Artifact更稳定可靠(尤其是国内直连下载) #6

Open
wants to merge 63 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
12c4a9d
由于工件只能被当前用户下载且链接不支持断点续传 又因为国内网络环境不稳定 所以使用容错率更高的release方法提供下载
zhangyiming748 Jul 5, 2024
6f0cdf2
测试
zhangyiming748 Jul 5, 2024
4fcc222
重试
zhangyiming748 Jul 5, 2024
a8572a9
Debian bookworm 的 arm64 配置信息
zhangyiming748 Jul 5, 2024
bc441f5
完全使用workflow实现
zhangyiming748 Jul 5, 2024
1fa4d31
测试openkylin
zhangyiming748 Jul 6, 2024
0d7f7e9
再试
zhangyiming748 Jul 6, 2024
66d13a2
再试
zhangyiming748 Jul 6, 2024
8510cb0
再试
zhangyiming748 Jul 6, 2024
4541b4e
再试
zhangyiming748 Jul 6, 2024
67a77fc
再试
zhangyiming748 Jul 6, 2024
9b509bf
再试
zhangyiming748 Jul 6, 2024
60af575
再试
zhangyiming748 Jul 6, 2024
2b44c8f
再试
zhangyiming748 Jul 6, 2024
419543d
再试
zhangyiming748 Jul 6, 2024
be603e0
再试
zhangyiming748 Jul 6, 2024
dc4ba6c
再试
zhangyiming748 Jul 6, 2024
a6d8a6b
再试
zhangyiming748 Jul 6, 2024
b6fb7db
手动触发
zhangyiming748 Jul 6, 2024
e27a06c
改为仅手动触发
zhangyiming748 Jul 6, 2024
65f11b9
再试
zhangyiming748 Jul 6, 2024
007e2d6
Free Disk Space
zhangyiming748 Jul 6, 2024
500914a
作为环境变量
zhangyiming748 Jul 6, 2024
eb5c64f
再次清理
zhangyiming748 Jul 6, 2024
202c232
解压后删除包 尽可能压缩空间
zhangyiming748 Jul 6, 2024
48c0461
使用全局变量
zhangyiming748 Jul 6, 2024
02fffc8
继续瘦身
zhangyiming748 Jul 6, 2024
e2e5684
尝试参数
zhangyiming748 Jul 6, 2024
73b6ad8
不支持传递?
zhangyiming748 Jul 6, 2024
72dbd3e
测试使用临时文件路径
zhangyiming748 Jul 6, 2024
d70ead1
查看/tmp目录
zhangyiming748 Jul 6, 2024
55ca0b8
查看
zhangyiming748 Jul 6, 2024
d30a76d
继续精简
zhangyiming748 Jul 6, 2024
58ec8c9
手动删除
zhangyiming748 Jul 6, 2024
c051a2d
测试
zhangyiming748 Jul 6, 2024
0f0516d
测试
zhangyiming748 Jul 6, 2024
dc7524b
测试
zhangyiming748 Jul 6, 2024
b91861b
测试
zhangyiming748 Jul 6, 2024
fa56a65
重试
zhangyiming748 Jul 6, 2024
88638e1
重试
zhangyiming748 Jul 6, 2024
8670214
重试
zhangyiming748 Jul 6, 2024
36d7bad
尝试
zhangyiming748 Jul 6, 2024
22c5e66
搭配本地运行器使用
zhangyiming748 Jul 7, 2024
4425bd1
设置apt代理
zhangyiming748 Jul 7, 2024
30b4ccd
设置apt代理
zhangyiming748 Jul 7, 2024
4f6c362
使用清华源 重试50次
zhangyiming748 Jul 7, 2024
e43cdaf
update重试50次
zhangyiming748 Jul 7, 2024
b4a89c5
upgrade重试50次
zhangyiming748 Jul 7, 2024
35759e0
发布kernel
zhangyiming748 Jul 7, 2024
c718011
发布kernel
zhangyiming748 Jul 7, 2024
ab2cf4a
build-dep
zhangyiming748 Jul 7, 2024
d9925b7
build-dep
zhangyiming748 Jul 7, 2024
db674b1
保存config文件
zhangyiming748 Jul 8, 2024
8e694e6
再次测试运行
zhangyiming748 Jul 8, 2024
b0c3d5f
再次测试运行2
zhangyiming748 Jul 8, 2024
2f1a7ba
有可能内存耗尽
zhangyiming748 Jul 8, 2024
01b2e4c
取消部分驱动的编译
zhangyiming748 Jul 8, 2024
417139c
再次测试运行3
zhangyiming748 Jul 8, 2024
9fd799a
重试
zhangyiming748 Jul 8, 2024
9184307
重试
zhangyiming748 Jul 8, 2024
da9a2d2
再次测试运行
zhangyiming748 Jul 8, 2024
b25dc7e
再次测试运行2
zhangyiming748 Jul 8, 2024
44ec1d6
再次测试运行3
zhangyiming748 Jul 8, 2024
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
26 changes: 18 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
name: Build kernel deb packages
on: push

name: Build kernel deb packages shell
on:
push:
branches:
- dev
workflow_dispatch:
jobs:
build:
name: Build kernel
name: Build kernel by shell
runs-on: ubuntu-latest
container: debian:buster
container: ubuntu:focal
steps:
- name: Checkout
uses: actions/checkout@v3

uses: actions/checkout@v4
- name: Build
run: bash build_action.sh

- name: Artifact
uses: actions/upload-artifact@v3
with:
name: artifact
path: ${{ github.workspace }}/artifact/
- name: Archive
run: tar acvf artifact.tar ${{ github.workspace }}/artifact
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ github.workspace }}/artifact.tar
tag_name: latest_release
name: kernel
32 changes: 32 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: save space
on:
push:
branches:
- dev
- main
- openkylin
workflow_dispatch:
env:
KERNEL_VERSION: linux-6.9.8
DEBIAN_FRONTEND: noninteractiv
jobs:
build:
name: save space
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 60000
temp-reserve-mb: 50
swap-size-mb: 512
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: saveSpace
run: rm -rf /opt/hostedtoolcache
- name: Optimize apt cache
run: |
df -h
21 changes: 21 additions & 0 deletions .github/workflows/kernel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release kernel package
on:
push:
branches:
- dev
workflow_dispatch:
jobs:
build:
name: release kernel package
runs-on: ubuntu-latest
steps:
- name: wget kernel
run: |
wget http://www.kernel.org/pub/linux/kernel/v6.x/linux-6.9.8.tar.xz
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
linux-6.9.8.tar.xz
tag_name: linux-6.9.8
name: linux-6.9.8
92 changes: 92 additions & 0 deletions .github/workflows/openkylin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Build kernel deb packages for openkylin
on:
push:
branches:
- dev
- master
tags:
- 'kernel*'
workflow_dispatch:
env:
KERNEL_VERSION: linux-6.9.8
DEBIAN_FRONTEND: noninteractiv
jobs:
build:
name: Build kernel for openkylin
runs-on: ubuntu-latest
container:
image: ubuntu:focal
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Generate config
run: |
ls -al
pwd
go run main.go
- name: saveSpace
run: rm -rf /opt/hostedtoolcache
- name: add deb-src to sources.list
run: |
cat /etc/apt/sources.list
sed -i "/deb-src/s/# //g" /etc/apt/sources.list
cat /etc/apt/sources.list
- name: install dep
run: |
df -h
apt update
apt install -y libncurses-dev pkg-config wget git xz-utils make gcc flex bison dpkg-dev bc rsync kmod cpio libssl-dev
apt build-dep -y linux
apt autoremove -y
apt clean -y
- name: Optimize apt cache
run: |
rm -rf /var/lib/apt/lists/*
- name: download kernel source
run: |
wget http://www.kernel.org/pub/linux/kernel/v6.x/${{ env.KERNEL_VERSION }}.tar.xz
tar -xf ${{ env.KERNEL_VERSION }}.tar.xz
rm ${{ env.KERNEL_VERSION }}.tar.xz
- name: copy config file
run: |
pwd
cp smartConfig ${{ env.KERNEL_VERSION }}/.config
- name: make git
run: |
cd ${{ env.KERNEL_VERSION }}
git init
git add .
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git commit -m "1"
- name: build deb packages
run: |
cd ${{ env.KERNEL_VERSION }}
pwd
make olddefconfig
scripts/config --disable DEBUG_INFO
scripts/config --enable MODULE_COMPRESS
make CCACHE_DISABLE=1 deb-pkg -j8
- name: move deb packages to artifact dir
run: |
mkdir ${{ github.workspace }}/artifact
find ${{ github.workspace }} -name "*dbg*.deb" -exec rm -rfv {} \;
find ${{ github.workspace }} -name "*.deb" -exec mv {} ${{ github.workspace }}/artifact \;
tar acvf artifact.tar ${{ github.workspace }}/artifact
- name: Artifact
uses: actions/upload-artifact@v4
with:
name: artifact
files: |
*.deb
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
*.deb
tag_name: openkylin
name: kernel
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
.DS_Store
26 changes: 26 additions & 0 deletions 10proxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Acquire::http::Proxy::dl.google.com "http://192.168.1.20:8889/";
Acquire::https::Proxy::dl.google.com "http://192.168.1.20:8889/";
Acquire::http::Proxy::download.docker.com "http://192.168.1.20:8889/";
Acquire::https::Proxy::download.docker.com "http://192.168.1.20:8889/";
Acquire::http::Proxy::download.sublimetext.com "http://192.168.1.20:8889/";
Acquire::https::Proxy::download.sublimetext.com "http://192.168.1.20:8889/";
Acquire::http::Proxy::mega.nz "http://192.168.1.20:8889/";
Acquire::https::Proxy::mega.nz "http://192.168.1.20:8889/";
Acquire::http::Proxy::packages.microsoft.com "http://192.168.1.20:8889/";
Acquire::https::Proxy::packages.microsoft.com "http://192.168.1.20:8889/";
Acquire::http::Proxy::packagecloud.io "http://192.168.1.20:8889/";
Acquire::https::Proxy::packagecloud.io "http://192.168.1.20:8889/";
Acquire::http::Proxy::ppa.launchpadcontent.net "http://192.168.1.20:8889/";
Acquire::https::Proxy::ppa.launchpadcontent.net "http://192.168.1.20:8889/";
Acquire::http::Proxy::ports.ubuntu.com "http://192.168.1.20:8889/";
Acquire::https::Proxy::ports.ubuntu.com "http://192.168.1.20:8889/";
Acquire::http::Proxy::ppa.launchpadcontent.net "http://192.168.1.20:8889/";
Acquire::https::Proxy::ppa.launchpadcontent.net "http://192.168.1.20:8889/";
Acquire::http::Proxy::archive.ubuntu.com "http://192.168.1.20:8889/";
Acquire::https::Proxy::archive.ubuntu.com "http://192.168.1.20:8889/";
Acquire::http::Proxy::security.ubuntu.com "http://192.168.1.20:8889/";
Acquire::https::Proxy::security.ubuntu.com "http://192.168.1.20:8889/";
Acquire::http::Proxy::archive.canonical.com "http://192.168.1.20:8889/";
Acquire::https::Proxy::archive.canonical.com "http://192.168.1.20:8889/";
Acquire::http::Proxy::security.canonical.com "http://192.168.1.20:8889/";
Acquire::https::Proxy::security.canonical.com "http://192.168.1.20:8889/";
10 changes: 10 additions & 0 deletions build-dep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

RETRIES=50

for i in $(seq 1 $RETRIES); do
apt build-dep -y "$@" && break || {
echo "Failed, retrying... ($i)"
sleep 5
}
done
19 changes: 14 additions & 5 deletions build_action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,40 @@

VERSION=$(grep 'Kernel Configuration' < config | awk '{print $3}')

# get version
echo "$VERSION"

# add deb-src to sources.list
sed -i "/deb-src/s/# //g" /etc/apt/sources.list

# install dep
apt update
apt install -y wget xz-utils make gcc flex bison dpkg-dev bc rsync kmod cpio libssl-dev
apt build-dep -y linux
DEBIAN_FRONTEND=noninteractive apt install -y wget xz-utils make gcc flex bison dpkg-dev bc rsync kmod cpio libssl-dev
DEBIAN_FRONTEND=noninteractive apt build-dep -y linux

# change dir to workplace
cd "${GITHUB_WORKSPACE}" || exit

# download kernel source
wget http://www.kernel.org/pub/linux/kernel/v5.x/linux-"$VERSION".tar.xz
tar -xf linux-"$VERSION".tar.xz
wget http://www.kernel.org/pub/linux/kernel/v6.x/linux-"$VERSION".tar.xz
tar -xvf linux-"$VERSION".tar.xz
cd linux-"$VERSION" || exit

# copy config file
cp ../config .config
# git
git init
git add .
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git commit -m "1"

# disable DEBUG_INFO to speedup build
scripts/config --disable DEBUG_INFO

# apply patches
# shellcheck source=src/util.sh
source ../patch.d/*.sh
# source ../patch.d/*.sh

# build deb packages
CPU_CORES=$(($(grep -c processor < /proc/cpuinfo)*2))
Expand Down
Loading