Skip to content

Commit

Permalink
Bump OpenCV to 1.1.8 and include version in the file names
Browse files Browse the repository at this point in the history
  • Loading branch information
umireon committed Dec 31, 2023
1 parent 30153c9 commit 73b5d3c
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 27 deletions.
80 changes: 64 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,31 @@ jobs:
- "Debug"
- "Release"

defaults:
run:
shell: "bash"

steps:
- uses: "actions/checkout@v3"
- name: "Get version"
run: |
if [[ $GITHUB_REF =~ ^refs/tags/ ]]
then version="${GITHUB_REF#refs/tags/}"
else version=main
fi
printf "version=%s" "$version" > "$GITHUB_OUTPUT"
id: "get-version"

- uses: "actions/checkout@v4"
with:
submodules: "recursive"

- name: "Run build-macos.sh"
run: "./build-macos.sh ${{ matrix.config }}"
run: "./build-macos.sh ${{ matrix.config }} ${{ steps.get-version.outputs.version }}"

- uses: "actions/upload-artifact@v3"
with:
name: "opencv-macos-${{ matrix.config }}"
path: "release/opencv-macos-${{ matrix.config }}.tar.gz"
path: "release/*.tar.gz"

BuildLinux:
runs-on: "ubuntu-22.04"
Expand All @@ -42,18 +55,31 @@ jobs:
- "Debug"
- "Release"

defaults:
run:
shell: "bash"

steps:
- uses: "actions/checkout@v3"
- name: "Get version"
run: |
if [[ $GITHUB_REF =~ ^refs/tags/ ]]
then version="${GITHUB_REF#refs/tags/}"
else version=main
fi
printf "version=%s" "$version" > "$GITHUB_OUTPUT"
id: "get-version"

- uses: "actions/checkout@v4"
with:
submodules: "recursive"

- name: "Run build-linux.sh"
run: "./build-linux.sh ${{ matrix.config }}"
run: "./build-linux.sh ${{ matrix.config }} ${{ steps.get-version.outputs.version }}"

- uses: "actions/upload-artifact@v3"
with:
name: "opencv-linux-${{ matrix.config }}"
path: "release/opencv-linux-${{ matrix.config }}.tar.gz"
path: "release/*.tar.gz"

BuildWindows:
runs-on: "windows-2022"
Expand All @@ -65,42 +91,64 @@ jobs:
- "Release"

steps:
- uses: "actions/checkout@v3"
- name: "Get version"
shell: bash
run: |
if [[ $GITHUB_REF =~ ^refs/tags/ ]]
then version="${GITHUB_REF#refs/tags/}"
else version=main
fi
printf "version=%s" "$version" > "$GITHUB_OUTPUT"
id: "get-version"

- uses: "actions/checkout@v4"
with:
submodules: "recursive"

- name: "Run Build-Windows.ps1"
run: "./Build-Windows.ps1 -Configuration ${{ matrix.config }}"
run: "./Build-Windows.ps1 -Configuration ${{ matrix.config }} -Version ${{ steps.get-version.outputs.version }}"

- uses: "actions/upload-artifact@v3"
with:
name: "opencv-windows-${{ matrix.config }}"
path: "release/opencv-windows-${{ matrix.config }}.zip"
path: "release/*.zip"

Release:
runs-on: "ubuntu-22.04"

if: "github.event_name == 'push' && contains(github.ref, 'refs/tags/')"

needs:
- "BuildMac"
- "BuildLinux"
- "BuildWindows"

permissions:
contents: "write"

defaults:
run:
shell: "bash"

steps:
- name: "Get Metadata"
id: "metadata"
- name: "Get version"
run: |
echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
if [[ $GITHUB_REF =~ ^refs/tags/ ]]
then version="${GITHUB_REF#refs/tags/}"
else version=main
fi
printf "version=%s" "$version" > "$GITHUB_OUTPUT"
id: "get-version"

- name: "Download build artifacts"
uses: "actions/download-artifact@v3"

- name: "Create Release"
uses: "softprops/action-gh-release@v1"
uses: "softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5"
with:
draft: true
tag_name: "${{ steps.metadata.outputs.version }}"
name: "${{ steps.metadata.outputs.version }}"
tag_name: "${{ steps.get-version.outputs.version }}"
name: "${{ steps.get-version.outputs.version }}"
files: |
${{ github.workspace }}/**/*.tar.gz
${{ github.workspace }}/**/*.zip
${{ github.workspace }}/**/*.zip
9 changes: 5 additions & 4 deletions Build-Windows.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Param($Configuration)
Param($Configuration, $Version)

cmake opencv -B build_$Configuration `
-DOPENCV_FORCE_3RDPARTY_BUILD=ON `
Expand Down Expand Up @@ -68,6 +68,7 @@ cmake opencv -B build_$Configuration `
-DWITH_OPENCL=OFF `
-DWITH_IPP=OFF

cmake --build build_$Configuration --config $Configuration
cmake --install build_$Configuration --config $Configuration --prefix release/$Configuration
Compress-Archive release\$Configuration\* release\opencv-windows-$Configuration.zip -Verbose
cmake --build build_$Configuration --config $Configuration
cmake --install build_$Configuration --config $Configuration --prefix release/$Configuration
Compress-Archive release\$Configuration\* release\opencv-windows-$Version-$Configuration.zip -Verbose

10 changes: 7 additions & 3 deletions build-linux.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
set -euo pipefail

CONFIG="${1?}"
VERSION="${2?}"

cmake opencv -B build_$1 \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=$1 \
Expand Down Expand Up @@ -71,6 +74,7 @@ cmake opencv -B build_$1 \
-DWITH_OPENCL=OFF \
-DWITH_IPP=OFF

cmake --build build_$1
cmake --install build_$1 --prefix release/$1
tar -C release/$1 -cvf release/opencv-linux-$1.tar.gz .
cmake --build "build_$CONFIG"
cmake --install "build_$CONFIG" --prefix "release/$CONFIG"
tar -C "release/$CONFIG" -cvf "release/opencv-linux-$VERSION-$CONFIG.tar.gz" .

10 changes: 7 additions & 3 deletions build-macos.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
set -euo pipefail

CONFIG="${1?}"
VERSION="${2?}"

cmake opencv -B build_$1 \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=$1 \
Expand Down Expand Up @@ -73,6 +76,7 @@ cmake opencv -B build_$1 \
-DWITH_OPENCL=OFF \
-DWITH_IPP=OFF

cmake --build build_$1
cmake --install build_$1 --prefix release/$1
tar -C release/$1 -cvf release/opencv-macos-$1.tar.gz .
cmake --build "build_$CONFIG"
cmake --install "build_$CONFIG" --prefix "release/$CONFIG"
tar -C "release/$CONFIG" -cvf "release/opencv-macos-$VERSION-$CONFIG.tar.gz" .

2 changes: 1 addition & 1 deletion opencv
Submodule opencv updated 124 files

0 comments on commit 73b5d3c

Please sign in to comment.