diff --git a/.github/workflows/linux_cpp_build.yml b/.github/workflows/linux_cpp_build.yml index 3c29195..e880f5e 100644 --- a/.github/workflows/linux_cpp_build.yml +++ b/.github/workflows/linux_cpp_build.yml @@ -52,7 +52,7 @@ jobs: - 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 .. diff --git a/.github/workflows/linux_cpp_release.yml b/.github/workflows/linux_cpp_release.yml index c3e9d60..eb3a73a 100644 --- a/.github/workflows/linux_cpp_release.yml +++ b/.github/workflows/linux_cpp_release.yml @@ -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.*.* @@ -56,20 +57,17 @@ 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: lebai-linux-x64-deb + path: build/*.deb + # - name: release # uses: ncipollo/release-action@v1 # with: diff --git a/.github/workflows/linux_dotnet_release.yml b/.github/workflows/linux_dotnet_release.yml index 63c5666..fb8eeaf 100644 --- a/.github/workflows/linux_dotnet_release.yml +++ b/.github/workflows/linux_dotnet_release.yml @@ -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.*.* @@ -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 \ No newline at end of file diff --git a/.github/workflows/linux_python_build.yml b/.github/workflows/linux_python_build.yml index ac31e87..33248b9 100644 --- a/.github/workflows/linux_python_build.yml +++ b/.github/workflows/linux_python_build.yml @@ -33,7 +33,7 @@ jobs: run: ls wheelhouse/* - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 id: artifact with: name: lebai-linux-x64-whl diff --git a/.github/workflows/linux_python_release.yml b/.github/workflows/linux_python_release.yml index e74fce1..9e60b32 100644 --- a/.github/workflows/linux_python_release.yml +++ b/.github/workflows/linux_python_release.yml @@ -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.*.* @@ -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 @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3530b37 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: Release lebai sdk +on: + push: + branches: + - master + +jobs: + linux-cpp-x64: + uses: ./.github/workflows/linux_cpp_release.yml + linux-python-x64: + uses: ./.github/workflows/linux_python_release.yml + linux-dotnet-x64: + uses: ./.github/workflows/linux_dotnet_release.yml + release: + needs: + - linux-cpp-x64 + - linux-python-x64 + - linux-dotnet-x64 + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: lebai-linux-x64-deb + - uses: actions/download-artifact@v4 + with: + name: lebai-linux-x64-nupkg + - uses: actions/download-artifact@v4 + with: + name: lebai-linux-x64-whl + - name: Display structure of downloaded files + run: ls -l + - name: Extract Project Version + id: extract_version + run: | + # Extract the project version from CMakeLists.txt + version=$(awk '/project\s*\(/,/)/' CMakeLists.txt | grep -Po 'VERSION\s*\K[0-9]+\.[0-9]+\.[0-9]+') + echo "version_tag=v$version" >> $GITHUB_ENV + - name: Create release + id: create_release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.extract_version.outputs.version_tag }} + allowUpdates: true + artifacts: | + *.exe, + *.deb diff --git a/.github/workflows/windows_cpp_release.yml b/.github/workflows/windows_cpp_release.yml new file mode 100644 index 0000000..3c05fcb --- /dev/null +++ b/.github/workflows/windows_cpp_release.yml @@ -0,0 +1,36 @@ +name: Windows cpp build +run-name: ${{ github.actor }} Windows cpp build +on: + workflow_dispatch: + workflow_call: + push: + tags: + - v1.*.* +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + pull-requests: read + +jobs: + windows_cpp_build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Check cmake + run: cmake --version + - name: Configure + run: cmake -S. -Bbuild -G "Visual Studio 17 2022" -DBUILD_NSIS=ON -DBUILD_DOCUMENTATION=OFF + - name: Build + run: cmake --build build --config Release + - name: Pack + run: cd build && cpack -C Release && cd .. + - name: Upload nsis package + uses: actions/upload-artifact@v4 + id: artifact + with: + name: lebai-win-x64-exe + path: | + build/*.exe \ No newline at end of file diff --git a/.github/workflows/windows_dotnet_release.yaml b/.github/workflows/windows_dotnet_release.yaml index 56c80a5..7445bb8 100644 --- a/.github/workflows/windows_dotnet_release.yaml +++ b/.github/workflows/windows_dotnet_release.yaml @@ -1,7 +1,8 @@ name: Windows dotnet release run-name: ${{ github.actor }} Windows dotnet release on: - workflow_dispatch: + workflow_dispatch: + workflow_call: push: tags: - v1.*.* diff --git a/.github/workflows/windows_python_build.yml b/.github/workflows/windows_python_build.yml index 9c6a709..531b684 100644 --- a/.github/workflows/windows_python_build.yml +++ b/.github/workflows/windows_python_build.yml @@ -37,5 +37,5 @@ jobs: uses: actions/upload-artifact@v4 id: artifact with: - name: lebai-win-x64-python-whl + name: lebai-win-x64-whl path: build/python/dist/*.whl \ No newline at end of file diff --git a/.github/workflows/windows_python_release.yml b/.github/workflows/windows_python_release.yml index 3678184..f2d02b9 100644 --- a/.github/workflows/windows_python_release.yml +++ b/.github/workflows/windows_python_release.yml @@ -1,7 +1,8 @@ name: Windows python release run-name: ${{ github.actor }} Windows python release on: - workflow_dispatch: + workflow_dispatch: + workflow_call: push: tags: - v1.*.* diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a5a48f..ab323f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ endif() project( lebai - VERSION 1.1.26 + VERSION 1.1.27 LANGUAGES CXX) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") diff --git a/Doxyfile b/Doxyfile index 67a7dc8..e7b5bc7 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "lebai sdk" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.1.26 +PROJECT_NUMBER = 1.1.27 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/doc/changelog.md b/doc/changelog.md index 104683d..c860652 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -1,5 +1,8 @@ # ChangeLog +## 1.1.27 +调整构建。 + ## 1.1.25 优化代码格式和构建。