Skip to content

Commit

Permalink
Merge pull request #84 from liufang-robot/master
Browse files Browse the repository at this point in the history
fix: 完善构建安装逻辑
  • Loading branch information
liufang-robot authored Jun 16, 2024
2 parents 514b27d + f0af5bc commit db3834c
Show file tree
Hide file tree
Showing 19 changed files with 294 additions and 110 deletions.
70 changes: 35 additions & 35 deletions .github/workflows/linux_cpp_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,59 @@ on:
jobs:
linux_cpp_test:
# needs: linux_cpp_build
runs-on: ubuntu-latest
container: registry.cn-shanghai.aliyuncs.com/lebai/l-master:3.1.6
steps:
- name: start nginx
run: nginx

- name: start daemon
run: |
systemctl start l-master-rc
systemctl start l-master-ds
- name: Checkout
uses: actions/checkout@v3
runs-on: ubuntu-latest
container: registry.cn-shanghai.aliyuncs.com/lebai/l-master:3.1.6
steps:
- name: start nginx
run: nginx
- name: start daemon
run: |
systemctl start l-master-rc
systemctl start l-master-ds
- name: Checkout
uses: actions/checkout@v3

- name: install components
run: apt-get install -y build-essential doxygen graphviz python3-pip python3-dev
- name: install components
run: apt-get install -y build-essential doxygen graphviz python3-pip python3-dev

- name: install dependencies
run: pip3 install -r requirements.txt
- name: install dependencies
run: pip3 install -r requirements.txt

- name: configure
run: cmake -S. -Bbuild -DBUILD_TESTING=ON -DBUILD_DOCUMENTATION=ON
- name: configure
run: cmake -S. -Bbuild -DBUILD_TESTING=ON -DBUILD_DOCUMENTATION=ON

- name: build
run: cmake --build build

- name: test
run: cmake --build build --target test
- name: build
run: cmake --build build
- name: test
run: cmake --build build --target test

linux_cpp_build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: install components
- name: Install dependencies from apt-get
run: sudo apt-get install -y build-essential doxygen graphviz python3-pip python3-dev

- name: install dependencies
- name: Install dependencies from pip
run: |
pip3 install -r requirements.txt
pip3 install clang-format
- name: configure
- name: Configure
run: cmake -S. -Bbuild -DBUILD_DEB=ON -DCLANG_FORMAT_CHECK=ON

- name: build
- name: Build and pack
run: |
cmake --build build
cd build && cpack && cd ..
# - name: Upload deb
# uses: actions/upload-artifact@v4
# id: artifact
# with:
# name: lebai-deb-package
# path: build/*.deb
- name: Upload artifact
uses: actions/upload-artifact@v4
id: artifact
with:
name: lebai-linux-x64-deb
path: build/*.deb
36 changes: 17 additions & 19 deletions .github/workflows/linux_cpp_release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Linux cpp release
run-name: ${{ github.actor }} Linux cpp release
on:
workflow_dispatch:
workflow_dispatch:
workflow_call:
push:
tags:
- v1.*.*
Expand All @@ -24,7 +25,7 @@ jobs:
runs-on: ${{ matrix.os-version }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: check python version
uses: actions/setup-python@v4.3.0
Expand Down Expand Up @@ -56,22 +57,19 @@ jobs:
id: deployment
uses: actions/deploy-pages@v1

# - name: upload .whl
# uses: actions/upload-artifact@v3
# with:
# name: WheelForPython
# path: ./build/python/dist/*.whl

- name: build deb pack
run: cpack --config ./build/CPackConfig.cmake

- name: upload .deb
- name: Build and pack
run: |
cmake --build build
cd build && cpack && cd ..
- name: Upload artifact
uses: actions/upload-artifact@v4
id: artifact
with:
name: DebForCPP
path: ./*.deb
- name: release
uses: ncipollo/release-action@v1
with:
artifacts: DebForCPP
allowUpdates: true
name: lebai-linux-x64-deb
path: build/*.deb

# - name: release
# uses: ncipollo/release-action@v1
# with:
# artifacts: DebForCPP
# allowUpdates: true
13 changes: 10 additions & 3 deletions .github/workflows/linux_dotnet_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v3.0.3
Expand All @@ -21,8 +21,15 @@ jobs:
- name: Check dotnet
run: dotnet --info

- name: configure
- name: Configure
run: cmake -S. -Bbuild -DBUILD_DOTNET=ON

- name: build
- name: Build
run: cmake --build build

- name: Upload artifact
uses: actions/upload-artifact@v4
id: artifact
with:
name: lebai-linux-x64-nupkg
path: build/dotnet/packages/*.nupkg
12 changes: 10 additions & 2 deletions .github/workflows/linux_dotnet_release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Linux dotnet release
run-name: ${{ github.actor }} Linux dotnet release
on:
workflow_dispatch:
workflow_dispatch:
workflow_call:
push:
tags:
- v1.*.*
Expand All @@ -10,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v3.0.3
Expand All @@ -34,3 +35,10 @@ jobs:
cd ./build/dotnet/packages;
dotnet nuget push lebai.runtime.linux-x64.1.*.*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json;
dotnet nuget push lebai.1.*.*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json;

- name: Upload artifact
uses: actions/upload-artifact@v4
id: artifact
with:
name: lebai-linux-x64-nupkg
path: build/dotnet/packages/*.nupkg
2 changes: 1 addition & 1 deletion .github/workflows/linux_java_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4

- uses: actions/setup-java@v1
with:
Expand Down
68 changes: 34 additions & 34 deletions .github/workflows/linux_python_aarch64_build.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
name: Linux python aarch64 build
run-name: ${{ github.actor }} Linux python aarch64 build
on:
workflow_dispatch:
pull_request:
jobs:
linux_python_aarch64_build:
runs-on: [self-hosted, Linux, ARM64]
container: quay.io/pypa/manylinux2014_aarch64
steps:
- name: Checkout
uses: actions/checkout@v1

- run: for PYBIN in /opt/python/*/bin;do "${PYBIN}/pip" install -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt; done;
- run: /opt/python/cp310-cp310/bin/pip install -i https://mirrors.aliyun.com/pypi/simple/ twine==2.0.0 markdown

- name: create-whl-dir
run: mkdir -p whl

- name: build with python
run: for PY in /opt/python/*;do
rm -rf build;
cmake -S. -Bbuild -DBUILD_TESTING=OFF -DBUILD_PYTHON=ON -DPYTHONPATH=${PY};
cmake --build build;
cp build/python/dist/*.whl whl/;
done;

- name: repair
run: for PYWHL in whl/*.whl;do
auditwheel repair ${PYWHL};
done;

- name: list Pypi
run: ls wheelhouse/*
name: Linux python aarch64 build
run-name: ${{ github.actor }} Linux python aarch64 build
on:
workflow_dispatch:
pull_request:
jobs:
linux_python_aarch64_build:
runs-on: [self-hosted, Linux, ARM64]
container: quay.io/pypa/manylinux2014_aarch64
steps:
- name: Checkout
uses: actions/checkout@v4

- run: for PYBIN in /opt/python/*/bin;do "${PYBIN}/pip" install -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt; done;
- run: /opt/python/cp310-cp310/bin/pip install -i https://mirrors.aliyun.com/pypi/simple/ twine==2.0.0 markdown

- name: create-whl-dir
run: mkdir -p whl

- name: build with python
run: for PY in /opt/python/*;do
rm -rf build;
cmake -S. -Bbuild -DBUILD_TESTING=OFF -DBUILD_PYTHON=ON -DPYTHONPATH=${PY};
cmake --build build;
cp build/python/dist/*.whl whl/;
done;

- name: repair
run: for PYWHL in whl/*.whl;do
auditwheel repair ${PYWHL};
done;

- name: list Pypi
run: ls wheelhouse/*
13 changes: 10 additions & 3 deletions .github/workflows/linux_python_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@ jobs:
- name: create-whl-dir
run: mkdir -p whl

- name: build with python
- name: Build with python
run: for PY in /opt/python/*;do
rm -rf build;
cmake -S. -Bbuild -DBUILD_PYTHON=ON -DPYTHONPATH=${PY};
cmake --build build;
cp build/python/dist/*.whl whl/;
done;

- name: repair
- name: Repair
run: for PYWHL in whl/*.whl;do
auditwheel repair ${PYWHL};
done;

- name: list Pypi
- name: List wheels.
run: ls wheelhouse/*

- name: Upload artifact
uses: actions/upload-artifact@v3
id: artifact
with:
name: lebai-linux-x64-whl
path: wheelhouse/*.whl
20 changes: 14 additions & 6 deletions .github/workflows/linux_python_release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Linux python release
run-name: ${{ github.actor }} Linux python release
on:
workflow_dispatch:
workflow_dispatch:
workflow_call:
push:
tags:
- v1.*.*
Expand All @@ -21,11 +22,11 @@ jobs:
uses: actions/checkout@v1
- run: for PYBIN in /opt/python/*/bin;do "${PYBIN}/pip" install -r requirements.txt; done;
- run: /opt/python/cp310-cp310/bin/pip install twine==2.0 urllib3==1.24. markdown
- name: configure
- name: Configure
run: cmake -S. -Bbuild -DBUILD_PYTHON=ON
- name: build
- name: Build
run: cmake --build build
- name: create-whl-dir
- name: Create-whl-dir
run: mkdir -p whl
- name: build with python
run: for PY in /opt/python/*;do
Expand All @@ -35,10 +36,17 @@ jobs:
cp build/python/dist/*.whl whl/;
done;

- name: repair
- name: Repair
run: for PYWHL in whl/*.whl;do
auditwheel repair ${PYWHL};
done;

- name: upload Pypi
- name: Upload Pypi
run: /opt/python/cp310-cp310/bin/twine upload --verbose --skip-existing -u __token__ -p ${{ secrets.PYLEBAI }} wheelhouse/*.whl

- name: Upload artifact
uses: actions/upload-artifact@v3
id: artifact
with:
name: lebai-linux-x64-whl
path: wheelhouse/*.whl
Loading

0 comments on commit db3834c

Please sign in to comment.