From 9a336e12b662e88de2d0625aab922e805e3816ce Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Sun, 21 Apr 2024 19:21:32 +0900 Subject: [PATCH] Bump 4.9.0 (#5) * Remove submodule * Fix * Update build.yml * Fix * Update build.yml * Fix * Fix * Update Build-Windows.ps1 --- .github/workflows/build.yml | 58 +++++++++++++++++++++++++------------ .gitignore | 2 ++ .gitmodules | 3 -- Build-Windows.ps1 | 4 +-- build-linux.sh | 3 +- build-macos.sh | 7 +++-- opencv | 1 - 7 files changed, 49 insertions(+), 29 deletions(-) delete mode 100644 .gitmodules delete mode 160000 opencv diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0cbb143..9bfdba3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,7 @@ -name: "Build" +--- +name: "build" -on: +"on": push: branches: - "main" @@ -10,9 +11,16 @@ on: branches: - "main" +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: "${{ github.ref != 'refs/heads/main' }}" + +env: + OPENCV_VERSION: "4.9.0" + jobs: BuildMac: - runs-on: "macos-13" + runs-on: "macos-14" strategy: matrix: @@ -34,14 +42,18 @@ jobs: printf "version=%s" "$version" > "$GITHUB_OUTPUT" id: "get-version" - - uses: "actions/checkout@v4" - with: - submodules: "recursive" + - name: "Checkout" + uses: "actions/checkout@v4" + + - name: "Download and extract OpenCV" + run: | + curl -fssLO "https://github.com/opencv/opencv/archive/refs/tags/$OPENCV_VERSION.tar.gz" + tar -xf "$OPENCV_VERSION.tar.gz" - name: "Run build-macos.sh" - run: "./build-macos.sh ${{ matrix.config }} ${{ steps.get-version.outputs.version }}" + run: './build-macos.sh ${{ matrix.config }} ${{ steps.get-version.outputs.version }} "opencv-$OPENCV_VERSION"' - - uses: "actions/upload-artifact@v3" + - uses: "actions/upload-artifact@v4" with: name: "opencv-macos-${{ matrix.config }}" path: "release/*.tar.gz" @@ -69,14 +81,18 @@ jobs: printf "version=%s" "$version" > "$GITHUB_OUTPUT" id: "get-version" - - uses: "actions/checkout@v4" - with: - submodules: "recursive" + - name: "Checkout" + uses: "actions/checkout@v4" + + - name: "Download and extract OpenCV" + run: | + curl -fssLO "https://github.com/opencv/opencv/archive/refs/tags/$OPENCV_VERSION.tar.gz" + tar -xf "$OPENCV_VERSION.tar.gz" - name: "Run build-linux.sh" - run: "./build-linux.sh ${{ matrix.config }} ${{ steps.get-version.outputs.version }}" + run: './build-linux.sh ${{ matrix.config }} ${{ steps.get-version.outputs.version }} "opencv-$OPENCV_VERSION"' - - uses: "actions/upload-artifact@v3" + - uses: "actions/upload-artifact@v4" with: name: "opencv-linux-${{ matrix.config }}" path: "release/*.tar.gz" @@ -101,12 +117,16 @@ jobs: printf "version=%s" "$version" > "$GITHUB_OUTPUT" id: "get-version" - - uses: "actions/checkout@v4" - with: - submodules: "recursive" + - name: "Checkout" + uses: "actions/checkout@v4" + + - name: "Download and extract OpenCV" + run: | + Invoke-WebRequest -Uri https://github.com/opencv/opencv/archive/refs/tags/$Env:OPENCV_VERSION.zip -OutFile "$Env:OPENCV_VERSION.zip" + Expand-Archive -Path "$Env:OPENCV_VERSION.zip" -DestinationPath "." - name: "Run Build-Windows.ps1" - run: "./Build-Windows.ps1 -Configuration ${{ matrix.config }} -Version ${{ steps.get-version.outputs.version }}" + run: './Build-Windows.ps1 -Configuration "${{ matrix.config }}" -Version "${{ steps.get-version.outputs.version }}" -OpenCVDirectory "opencv-$Env:OPENCV_VERSION"' - uses: "actions/upload-artifact@v3" with: @@ -142,10 +162,10 @@ jobs: id: "get-version" - name: "Download build artifacts" - uses: "actions/download-artifact@v3" + uses: "actions/download-artifact@v4" - name: "Create Release" - uses: "softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5" + uses: "softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b" with: draft: true tag_name: "${{ steps.get-version.outputs.version }}" diff --git a/.gitignore b/.gitignore index 252fb4f..f7ce21f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ build*/ release/ +opencv-*/ +*.tar.gz diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ae6c2ac..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "opencv"] - path = opencv - url = https://github.com/opencv/opencv.git diff --git a/Build-Windows.ps1 b/Build-Windows.ps1 index 2766c68..f61c84e 100644 --- a/Build-Windows.ps1 +++ b/Build-Windows.ps1 @@ -1,6 +1,6 @@ -Param($Configuration, $Version) +Param($Configuration, $Version, $OpenCVDirectory) -cmake opencv -B build_$Configuration ` +cmake $OpenCVDirectory -B build_$Configuration ` -DOPENCV_FORCE_3RDPARTY_BUILD=ON ` -DBUILD_SHARED_LIBS=OFF ` -DBUILD_opencv_apps=OFF ` diff --git a/build-linux.sh b/build-linux.sh index 729ec87..877f609 100755 --- a/build-linux.sh +++ b/build-linux.sh @@ -3,8 +3,9 @@ set -euo pipefail CONFIG="${1?}" VERSION="${2?}" +OPENCV_DIR="${3?}" -cmake opencv -B "build_$CONFIG" \ +cmake "$OPENCV_DIR" -B "build_$CONFIG" \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DCMAKE_BUILD_TYPE="$CONFIG" \ -DOPENCV_FORCE_3RDPARTY_BUILD=ON \ diff --git a/build-macos.sh b/build-macos.sh index b81165e..158ac7c 100755 --- a/build-macos.sh +++ b/build-macos.sh @@ -3,10 +3,11 @@ set -euo pipefail CONFIG="${1?}" VERSION="${2?}" +OPENCV_DIR="${3?}" + +#git apply macos-4.8.1.patch || true -git apply macos-4.8.1.patch || true - -cmake opencv -B "build_$CONFIG" \ +cmake "$OPENCV_DIR" -B "build_$CONFIG" \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DCMAKE_BUILD_TYPE="$CONFIG" \ -DOPENCV_FORCE_3RDPARTY_BUILD=ON \ diff --git a/opencv b/opencv deleted file mode 160000 index 5199850..0000000 --- a/opencv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5199850039ad23f1f0e6cccea5061a9fea5efca6