Skip to content

Commit 7d3fbdc

Browse files
authored
[기능] : OpenCV 레이어를 소스 빌드와 GitHub Releases 배포로 전환한다 (#3)
1 parent 0634d2d commit 7d3fbdc

27 files changed

Lines changed: 694 additions & 115 deletions

‎.gitattributes‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*.zip filter=lfs diff=lfs merge=lfs -text
1+
* text=auto eol=lf

‎.github/workflows/build.yml‎

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Build layers
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
env:
10+
NUMPY_VERSION: "2.5.4"
11+
12+
jobs:
13+
# cv2 is built with the Python Limited API, so one build per
14+
# (OpenCV, profile, arch) serves every Python >= 3.12.
15+
opencv:
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
opencv: ["4.14.0", "5.1.0"]
20+
profile: [minimal, standard, dnn]
21+
arch: [x86_64, arm64]
22+
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
- run: ./build.sh 3.12 ${{ matrix.arch }} opencv ${{ matrix.opencv }} ${{ matrix.profile }}
26+
- uses: actions/upload-artifact@v4
27+
with:
28+
name: opencv-${{ matrix.opencv }}-${{ matrix.profile }}-${{ matrix.arch }}
29+
path: artifacts/*.tar.gz
30+
if-no-files-found: error
31+
32+
numpy:
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
python: ["3.12", "3.13", "3.14"]
37+
arch: [x86_64, arm64]
38+
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
39+
steps:
40+
- uses: actions/checkout@v4
41+
- run: ./build.sh ${{ matrix.python }} ${{ matrix.arch }} numpy ${{ env.NUMPY_VERSION }}
42+
- uses: actions/upload-artifact@v4
43+
with:
44+
name: numpy-${{ matrix.python }}-${{ matrix.arch }}
45+
path: artifacts/*.tar.gz
46+
if-no-files-found: error
47+
48+
# Smoke-test and zip inside each target runtime.
49+
package:
50+
needs: [opencv, numpy]
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
python: ["3.12", "3.13", "3.14"]
55+
arch: [x86_64, arm64]
56+
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
57+
steps:
58+
- uses: actions/checkout@v4
59+
- uses: actions/download-artifact@v4
60+
with:
61+
pattern: opencv-*-${{ matrix.arch }}
62+
path: artifacts
63+
merge-multiple: true
64+
- uses: actions/download-artifact@v4
65+
with:
66+
name: numpy-${{ matrix.python }}-${{ matrix.arch }}
67+
path: artifacts
68+
- run: ./build.sh ${{ matrix.python }} ${{ matrix.arch }} package
69+
- uses: actions/upload-artifact@v4
70+
with:
71+
name: layers-${{ matrix.python }}-${{ matrix.arch }}
72+
path: dist/*
73+
if-no-files-found: error
74+
75+
# Single required status check for branch protection. Fails if any job
76+
# failed, was cancelled, or was skipped because an earlier stage failed.
77+
result:
78+
name: CI result
79+
if: always()
80+
needs: [opencv, numpy, package]
81+
runs-on: ubuntu-24.04
82+
steps:
83+
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')
84+
run: exit 1
85+
- run: echo "all jobs passed"
86+
87+
release:
88+
if: startsWith(github.ref, 'refs/tags/v')
89+
needs: package
90+
runs-on: ubuntu-24.04
91+
permissions:
92+
contents: write
93+
steps:
94+
- uses: actions/download-artifact@v4
95+
with:
96+
pattern: layers-*
97+
path: dist
98+
merge-multiple: true
99+
- name: Checksums and release notes
100+
working-directory: dist
101+
run: |
102+
sha256sum *.zip > SHA256SUMS
103+
{
104+
echo "| File | Profile | Python | Arch | OpenCV | NumPy | Unzipped (MB) | Zipped (MB) |"
105+
echo "|---|---|---|---|---|---|---|---|"
106+
jq -rs 'sort_by(.file)[] | "| \(.file) | \(.profile) | \(.python) | \(.arch) | \(.opencv) | \(.numpy) | \(.unzipped_mb) | \(.zipped_mb) |"' *.json
107+
} > ../notes.md
108+
- uses: softprops/action-gh-release@v2
109+
with:
110+
files: |
111+
dist/*.zip
112+
dist/SHA256SUMS
113+
body_path: notes.md

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
artifacts/
2+
dist/
3+
__pycache__/

‎LICENSE‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013-2020 Michael Rose and contributors
3+
Copyright (c) 2022-2026 Daehee Yun
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

‎Python 3.7.10/opencv-python-headless-3.4.17.61.zip‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎Python 3.7.10/opencv-python-headless-4.0.1.24.zip‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎Python 3.7.10/opencv-python-headless-4.1.2.30.zip‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎Python 3.7.10/opencv-python-headless-4.2.0.34.zip‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎Python 3.7.10/opencv-python-headless-4.3.0.38.zip‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎Python 3.7.10/opencv-python-headless-4.4.0.46.zip‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)