Skip to content

Commit

Permalink
update 4.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminwan committed Jul 6, 2024
1 parent 836a7e1 commit 99aee1e
Show file tree
Hide file tree
Showing 20 changed files with 690 additions and 282 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: android

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
android:
Expand All @@ -14,7 +11,7 @@ jobs:
fail-fast: false
matrix:
ver:
- { cv: 4.8.1, ndk: 25.2.9519653 }
- { cv: 4.9.0, ndk: 25.2.9519653 }

env:
PKG_NAME: opencv-${{ matrix.ver.cv }}-android
Expand Down
25 changes: 15 additions & 10 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: ubuntu

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
ubuntu:
Expand All @@ -15,7 +12,7 @@ jobs:
matrix:
os_name: [ubuntu]
ver:
- { cv: 4.8.1, cmake: 3.28.2, python: 3.8.18, ant: 1.10.14, jdk: openjdk-8-jdk }
- { cv: 4.9.0, cmake: 3.28.6, python: 3.8.19, ant: 1.10.14, jdk: openjdk-8-jdk }
list:
- { os_ver: 14.04, os_id: trusty }
- { os_ver: 16.04, os_id: xenial }
Expand All @@ -24,11 +21,19 @@ jobs:
- { os_ver: 22.04, os_id: jammy }
arch:
[
386,
amd64,
arm,
arm64,
ppc64le,
]
exclude:
- list: { os_ver: 14.04, os_id: trusty }
arch: ppc64le
- list: { os_ver: 20.04, os_id: focal }
arch: 386
- list: { os_ver: 22.04, os_id: jammy }
arch: 386

name: ubuntu-${{ matrix.list.os_ver }}-${{ matrix.arch }}

Expand All @@ -52,8 +57,8 @@ jobs:
# 复制
- name: copy
run: |
cp build-opencv4.sh opencv-${{ matrix.ver.cv }}
cp build-opencv4-java.sh opencv-${{ matrix.ver.cv }}
cp build-opencv4-linux.sh opencv-${{ matrix.ver.cv }}
cp build-opencv4-linux-java.sh opencv-${{ matrix.ver.cv }}
cp opencv4_cmake_options.txt opencv-${{ matrix.ver.cv }}
- name: Host - update
Expand Down Expand Up @@ -109,8 +114,8 @@ jobs:
- name: Docker - build
run: |
docker exec --env-file env.custom -w /root ${{ matrix.os_name }} git config --global --add safe.directory "*"
docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} chmod a+x build-opencv4.sh
docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} ./build-opencv4.sh
docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} chmod a+x build-opencv4-linux.sh
docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} ./build-opencv4-linux.sh "${{ matrix.arch }}"
# install文件夹改名linux,并使用7z压缩
- name: 7zip
Expand All @@ -121,8 +126,8 @@ jobs:
- name: Docker - build
run: |
docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} chmod a+x build-opencv4-java.sh
docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} ./build-opencv4-java.sh
docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} chmod a+x build-opencv4-linux-java.sh
docker exec --env-file env.custom -w /root/opencv-${{ matrix.ver.cv }} ${{ matrix.os_name }} ./build-opencv4-linux-java.sh "${{ matrix.arch }}"
- name: 7zip java
run: |
Expand Down
29 changes: 15 additions & 14 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@ name: macos

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
macos:
strategy:
fail-fast: false
matrix:
ver:
- { cv: 4.8.1, ant: 1.10.14 }
- { cv: 4.9.0, ant: 1.10.14 }
list:
- { os_ver: 11 }
- { os_ver: 12 }
- { os_ver: 13 }
- { os_ver: 14 }
arch:
[
x86_64,
arm64,
]

runs-on: macos-${{ matrix.list.os_ver }}
runs-on: macos-${{ matrix.list.os_ver }}-${{ matrix.arch }}

env:
PKG_NAME: opencv-${{ matrix.ver.cv }}-macos-${{ matrix.list.os_ver }}
JAVA_PKG_NAME: opencv-${{ matrix.ver.cv }}-macos-${{ matrix.list.os_ver }}-java
PKG_NAME: opencv-${{ matrix.ver.cv }}-macos-${{ matrix.list.os_ver }}-${{ matrix.arch }}
JAVA_PKG_NAME: opencv-${{ matrix.ver.cv }}-macos-${{ matrix.list.os_ver }}-${{ matrix.arch }}-java

steps:
# Setup JDK 8
Expand Down Expand Up @@ -61,32 +62,32 @@ jobs:
# 复制
- name: copy
run: |
cp build-opencv4.sh opencv-${{ matrix.ver.cv }}
cp build-opencv4-java.sh opencv-${{ matrix.ver.cv }}
cp build-opencv4-mac.sh opencv-${{ matrix.ver.cv }}
cp build-opencv4-mac-java.sh opencv-${{ matrix.ver.cv }}
cp opencv4_cmake_options.txt opencv-${{ matrix.ver.cv }}
# 编译
- name: build
run: |
cd opencv-${{ matrix.ver.cv }}
chmod a+x build-opencv4.sh &&./build-opencv4.sh
chmod a+x build-opencv4-mac.sh &&./build-opencv4-mac.sh "${{ matrix.arch }}"
# 7z压缩
- name: 7zip
run: |
cp -r opencv-${{ matrix.ver.cv }}/build-Release/install macos
cp -r opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install macos
7z a ${{ env.PKG_NAME }}.7z macos
# 编译
- name: build java
run: |
cd opencv-${{ matrix.ver.cv }}
chmod a+x build-opencv4-java.sh &&./build-opencv4-java.sh
chmod a+x build-opencv4-mac-java.sh &&./build-opencv4-mac-java.sh "${{ matrix.arch }}"
# 7z压缩
- name: 7zip
run: |
cp -r opencv-${{ matrix.ver.cv }}/build-Release/install/share/java/opencv4 ${{ env.JAVA_PKG_NAME }}
cp -r opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.arch }}/install/share/java/opencv4 ${{ env.JAVA_PKG_NAME }}
7z a ${{ env.JAVA_PKG_NAME }}.7z ${{ env.JAVA_PKG_NAME }}
# 上传artifact
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/musl.yml → .github/workflows/musl-gcc.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: musl
name: musl-gcc

on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
linux-musl:
Expand All @@ -14,7 +11,7 @@ jobs:
fail-fast: false
matrix:
ver:
- { cv: 4.8.1, musl: 11.3.1 }
- { cv: 4.9.0, musl: 11.3.1 }
arch:
[
aarch64-linux-musl,
Expand Down Expand Up @@ -76,7 +73,7 @@ jobs:
- uses: actions/checkout@v3

# 部署musl
- name: deploy musl
- name: deploy musl toolchain
run: |
wget https://github.com/benjaminwan/musl-cross-builder/releases/download/${{ matrix.ver.musl }}/${{ matrix.arch }}-${{ matrix.ver.musl }}.7z -O ${{ matrix.arch }}.7z
7z x ${{ matrix.arch }}.7z -aoa
Expand Down
148 changes: 148 additions & 0 deletions .github/workflows/musl-zig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
name: musl-zig

on:
workflow_dispatch:

jobs:
linux-musl:
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
ver:
- { cv: 4.9.0, zig: zig-linux-x86_64-0.13.0 }
target:
[
aarch64_be-linux-musl,
aarch64-linux-musl,
arm-linux-musleabi,
arm-linux-musleabihf,
thumb-linux-musleabi,
thumb-linux-musleabihf,
x86-linux-musl,
mips64el-linux-musl,
mips64-linux-musl,
mipsel-linux-musl,
mips-linux-musl,
powerpc64le-linux-musl,
powerpc64-linux-musl,
powerpc-linux-musl,
riscv64-linux-musl,
x86_64-linux-musl,
armeb-linux-musleabi,
armeb-linux-musleabihf,
loongarch64-linux-musl,
m68k-linux-musl,
riscv32-linux-musl,
s390x-linux-musl,
wasm32-freestanding-musl,
wasm32-wasi-musl,
]
exclude:
- target: armeb-linux-musleabi
- target: armeb-linux-musleabihf
- target: loongarch64-linux-musl
- target: m68k-linux-musl
- target: riscv32-linux-musl
- target: s390x-linux-musl
- target: wasm32-wasi-musl

name: opencv-${{ matrix.ver.cv }}-${{ matrix.target }}

env:
PKG_NAME: opencv-${{ matrix.ver.cv }}-${{ matrix.target }}-zig

steps:
# 检出代码
- uses: actions/checkout@v3

# 部署zig
- name: deploy zig
run: |
wget https://ziglang.org/download/0.13.0/${{ matrix.ver.zig }}.tar.xz -O ${{ matrix.ver.zig }}.tar.xz
tar xvf ${{ matrix.ver.zig }}.tar.xz
mv ${{ matrix.ver.zig }}/ /opt/${{ matrix.ver.zig }}/
echo "/opt/${{ matrix.ver.zig }}" >> $GITHUB_PATH
# 检出opencv
- name: checkout opencv
uses: actions/checkout@v3
with:
repository: opencv/opencv
path: opencv-${{ matrix.ver.cv }}
ref: ${{ matrix.ver.cv }}
submodules: recursive

# 复制
- name: copy
run: |
cp build-opencv4-musl-zig.sh opencv-${{ matrix.ver.cv }}
cp opencv4_cmake_options.txt opencv-${{ matrix.ver.cv }}
wget https://github.com/benjaminwan/zig-cmake-musl-toolchain/raw/main/zig-musl.toolchain.cmake -O zig-musl.toolchain.cmake
cp zig-musl.toolchain.cmake opencv-${{ matrix.ver.cv }}
wget https://github.com/benjaminwan/zig-cmake-musl-toolchain/raw/main/zig-ar.sh -O zig-ar.sh
cp zig-ar.sh opencv-${{ matrix.ver.cv }}
wget https://github.com/benjaminwan/zig-cmake-musl-toolchain/raw/main/zig-c++.sh -O zig-c++.sh
cp zig-c++.sh opencv-${{ matrix.ver.cv }}
wget https://github.com/benjaminwan/zig-cmake-musl-toolchain/raw/main/zig-cc.sh -O zig-cc.sh
cp zig-cc.sh opencv-${{ matrix.ver.cv }}
wget https://github.com/benjaminwan/zig-cmake-musl-toolchain/raw/main/zig-ranlib.sh -O zig-ranlib.sh
cp zig-ranlib.sh opencv-${{ matrix.ver.cv }}
# 编译
- name: build opencv
run: |
cd opencv-${{ matrix.ver.cv }}
chmod a+x zig-ar.sh
chmod a+x zig-c++.sh
chmod a+x zig-cc.sh
chmod a+x zig-ranlib.sh
chmod a+x build-opencv4-musl-zig.sh
./build-opencv4-musl-zig.sh "${{ matrix.target }}"
# 7z压缩
- name: 7zip
run: |
cp -r opencv-${{ matrix.ver.cv }}/build-Release-${{ matrix.target }}/install linux
7z a ${{ env.PKG_NAME }}.7z linux
# 上传artifact
- name: upload
uses: actions/upload-artifact@v3
with:
name: ${{ env.PKG_NAME }}
path: ${{ env.PKG_NAME }}.7z

# 获取所有的git log和tag
- name: Unshallow
run: git fetch --prune --unshallow

# 获取git log 从 previousTag 到 lastTag
- name: Get git log
id: git-log
run: |
previousTag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)
lastTag=$(git describe --abbrev=0 --tags)
echo "previousTag:$previousTag ~ lastTag:$lastTag"
log=$(git log $previousTag..$lastTag --pretty=format:'- %cd %an: %s\n' --date=format:'%Y-%m-%d %H:%M:%S')
echo "$log"
echo "log_state="$log"" >> $GITHUB_ENV
# 创建Changelog文件 triggered by git tag push
- name: Generate Changelog
if: startsWith(github.ref, 'refs/tags/')
run: |
echo -e '${{ env.log_state }}' > release.md
# 创建release 上传release
# https://github.com/marketplace/actions/create-release
- name: Create release and upload-archive
uses: ncipollo/release-action@v1
with:
prerelease: false
bodyFile: release.md
artifacts: ${{ env.PKG_NAME }}.7z
allowUpdates: true
artifactContentType: application/x-7z-compressed
token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 99aee1e

Please sign in to comment.