Skip to content

Commit

Permalink
Bump 4.9.0 (#5)
Browse files Browse the repository at this point in the history
* Remove submodule

* Fix

* Update build.yml

* Fix

* Update build.yml

* Fix

* Fix

* Update Build-Windows.ps1
  • Loading branch information
umireon authored Apr 21, 2024
1 parent d59022a commit 9a336e1
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 29 deletions.
58 changes: 39 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "Build"
---
name: "build"

on:
"on":
push:
branches:
- "main"
Expand All @@ -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:
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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:
Expand Down Expand Up @@ -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 }}"
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build*/
release/
opencv-*/
*.tar.gz
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

4 changes: 2 additions & 2 deletions Build-Windows.ps1
Original file line number Diff line number Diff line change
@@ -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 `
Expand Down
3 changes: 2 additions & 1 deletion build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
7 changes: 4 additions & 3 deletions build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 0 additions & 1 deletion opencv
Submodule opencv deleted from 519985

0 comments on commit 9a336e1

Please sign in to comment.