Skip to content

Commit

Permalink
Merge branch 'release/2024.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Aug 5, 2024
2 parents ef91e8d + eb84651 commit 2042402
Show file tree
Hide file tree
Showing 48 changed files with 2,947 additions and 1,143 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
17 changes: 0 additions & 17 deletions .github/renovate.json

This file was deleted.

199 changes: 108 additions & 91 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,90 +12,92 @@ on:
- cron: "0 5 * * 1-5"

jobs:
# まず pyi を生成する
# クロスコンパイル環境だと pyi が生成できないので、
# 1箇所で pyi を生成してアーティファクトにアップロードして、
# それを各ビルドで利用する形にする。
build_pyi:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- run: |
sudo apt-get -y install libva-dev libdrm-dev libx11-dev
- uses: eifinger/setup-rye@v4
- run: echo "$HOME/.rye/shims" >> $GITHUB_PATH
- run: rye pin 3.12
- run: rye sync
- name: Generate pyi
run: |
rye run python run.py ubuntu-24.04_x86_64
mkdir sora_sdk/
cp src/sora_sdk/py.typed sora_sdk/
cp src/sora_sdk/sora_sdk_ext.pyi sora_sdk/
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: sora_sdk
path: sora_sdk/
build_linux_macos:
strategy:
fail-fast: false
matrix:
platform:
# - name: ubuntu-24.04_x86_64
# target: ubuntu-24.04_x86_64
# runs_on: ubuntu-24.04
# os: ubuntu
- name: ubuntu-22.04_x86_64
target: ubuntu-22.04_x86_64
runs_on: ubuntu-22.04
os: ubuntu
auditwheel_plat: manylinux_2_35_x86_64
- name: ubuntu-20.04_armv8_jetson
runs_on: ubuntu-20.04
os: ubuntu
- name: macos-13_arm64
target: macos_arm64
runs_on: macos-13
os: macos
python_host_platform: "macosx-13.0-arm64"
archflags: "-arch arm64"
- name: macos-14_arm64
target: macos_arm64
runs_on: macos-14
os: macos
python_host_platform: "macosx-14.0-arm64"
archflags: "-arch arm64"
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
# Jetson は Python 3.8 のみ作成する
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.9"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.10"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.11"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.12"
needs: [build_pyi]
runs-on: ${{ matrix.platform.runs_on }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: sora_sdk
path: sora_sdk/
- run: |
cp sora_sdk/py.typed src/sora_sdk/py.typed
cp sora_sdk/sora_sdk_ext.pyi src/sora_sdk/sora_sdk_ext.pyi
# libx11-dev は Ubuntu 24.04 の時に必要になる模様
- run: |
sudo apt-get update
sudo apt-get -y install libva-dev libdrm-dev
sudo apt-get -y install libva-dev libdrm-dev libx11-dev
if: ${{ matrix.platform.os == 'ubuntu' }}
- run: curl -sSf https://rye-up.com/get | RYE_INSTALL_OPTION="--yes" bash
- uses: eifinger/setup-rye@v4
- run: echo "$HOME/.rye/shims" >> $GITHUB_PATH
- run: rye pin cpython@${{ matrix.python_version }}
- run: rye pin ${{ matrix.python_version }}
- run: rye sync

# Jetson 以外の Ubuntu 向け
# Ubuntu 向け
- run: |
rye run python run.py
rye run python run.py ${{ matrix.platform.target }}
rye run python -m build
# # auditwheel を適用する
# rm -rf patchelf
# mkdir -p patchelf
# pushd patchelf
# # Ubuntu 20.04 の patchelf は auditwheel が要求するバージョンを満たしてないので
# # リポジトリから新しいバイナリを取得する
# curl -LO https://github.com/NixOS/patchelf/releases/download/0.14.3/patchelf-0.14.3-x86_64.tar.gz
# tar -xf patchelf-0.14.3-x86_64.tar.gz
# popd
# # 共有ライブラリを除ける
# ./scripts/fix_shared_lib.sh src/sora_sdk/*.so > excludes
# PATH=`pwd`/patchelf/bin:$PATH rye run python -m auditwheel repair --plat ${{ matrix.platform.auditwheel_plat }} dist/*.whl `cat excludes`
if: ${{ matrix.platform.os == 'ubuntu' && matrix.platform.name != 'ubuntu-20.04_armv8_jetson' }}
# Jetson 向け
- name: Set up QEMU
if: ${{ matrix.platform.name == 'ubuntu-20.04_armv8_jetson' }}
uses: docker/setup-qemu-action@v3
- run: |
sudo apt-get install -y multistrap binutils-aarch64-linux-gnu
# multistrap に insecure なリポジトリからの取得を許可する設定を入れる
sudo sed -e 's/Apt::Get::AllowUnauthenticated=true/Apt::Get::AllowUnauthenticated=true";\n$config_str .= " -o Acquire::AllowInsecureRepositories=true/' -i /usr/sbin/multistrap
rye run python run.py
# auditwheel も適用する
# ./scripts/package.ubuntu-20.04_armv8_jetson.sh --with-auditwheel
./scripts/package.ubuntu-20.04_armv8_jetson.sh
if: ${{ matrix.platform.name == 'ubuntu-20.04_armv8_jetson' }}
env:
SORA_SDK_TARGET: ubuntu-20.04_armv8_jetson
if: ${{ matrix.platform.os == 'ubuntu' }}
# macOS 向け
- run: |
rye run python run.py
rye run python run.py ${{ matrix.platform.target }}
rye run python -m build
if: ${{ matrix.platform.os == 'macos' }}
env:
Expand All @@ -109,33 +111,66 @@ jobs:
path: "dist/"

build_windows:
runs-on: windows-2019
needs: [build_pyi]
runs-on: windows-2022
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/download-artifact@v4
with:
python-version: "${{ matrix.python_version }}"
cache: "pip"
- run: pip install -r requirements-dev.lock
- run: python run.py
- run: python -m build
name: sora_sdk
path: sora_sdk/

- run: |
cp sora_sdk/py.typed src/sora_sdk/py.typed
cp sora_sdk/sora_sdk_ext.pyi src/sora_sdk/sora_sdk_ext.pyi
- uses: eifinger/setup-rye@v4
- run: echo "$HOME/.rye/shims" >> $GITHUB_PATH
- run: rye pin ${{ matrix.python_version }}
- run: rye sync
- run: rye run python run.py windows_x86_64
- run: rye run python -m build

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: windows-2019_python-${{ matrix.python_version }}
name: windows-2022_python-${{ matrix.python_version }}
path: dist/

slack_notify_succeeded:
needs: [build_linux_macos, build_windows]
runs-on: ubuntu-latest
if: success()
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: sora-python-sdk
SLACK_COLOR: good
SLACK_TITLE: SUCCEEDED
SLACK_ICON_EMOJI: ":star-struck:"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
slack_notify_failed:
needs: [build_linux_macos, build_windows]
runs-on: ubuntu-latest
if: failure()
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: sora-python-sdk
SLACK_COLOR: danger
SLACK_TITLE: "FAILED"
SLACK_ICON_EMOJI: ":japanese_ogre:"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

publish_wheel:
if: contains(github.ref, 'tags/202')
needs:
Expand All @@ -145,25 +180,15 @@ jobs:
fail-fast: false
matrix:
platform:
# - name: ubuntu-24.04_x86_64
- name: ubuntu-22.04_x86_64
- name: ubuntu-20.04_armv8_jetson
- name: macos-14_arm64
- name: macos-13_arm64
- name: windows-2019
- name: windows-2022
python_version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.9"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.10"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.11"
- platform: { name: ubuntu-20.04_armv8_jetson }
python_version: "3.12"
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
Expand All @@ -177,7 +202,7 @@ jobs:
fi
# matrix の中で1個だけソースディストリビューション用のデータを残しておく
- run: mv *.tar.gz dist/
if: ${{ matrix.platform.name == 'macos-13_arm64' && matrix.python_version == '3.8' }}
if: ${{ matrix.platform.name == 'macos-14_arm64' && matrix.python_version == '3.10' }}

# テスト用
# - name: Publish package to TestPyPI
Expand Down Expand Up @@ -210,39 +235,30 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/download
with: { "platform": "ubuntu-22.04_x86_64", "python_version": "3.8" }
- uses: ./.github/actions/download
with: { "platform": "ubuntu-22.04_x86_64", "python_version": "3.9" }
- uses: ./.github/actions/download
with: { "platform": "ubuntu-22.04_x86_64", "python_version": "3.10" }
- uses: ./.github/actions/download
with: { "platform": "ubuntu-22.04_x86_64", "python_version": "3.11" }
- uses: ./.github/actions/download
with: { "platform": "ubuntu-22.04_x86_64", "python_version": "3.12" }
- uses: ./.github/actions/download
with:
{ "platform": "ubuntu-20.04_armv8_jetson", "python_version": "3.8" }
with: { "platform": "macos-14_arm64", "python_version": "3.10" }
- uses: ./.github/actions/download
with: { "platform": "macos-13_arm64", "python_version": "3.8" }
with: { "platform": "macos-14_arm64", "python_version": "3.11" }
- uses: ./.github/actions/download
with: { "platform": "macos-13_arm64", "python_version": "3.9" }
with: { "platform": "macos-14_arm64", "python_version": "3.12" }
- uses: ./.github/actions/download
with: { "platform": "macos-13_arm64", "python_version": "3.10" }
- uses: ./.github/actions/download
with: { "platform": "macos-13_arm64", "python_version": "3.11" }
- uses: ./.github/actions/download
with: { "platform": "macos-13_arm64", "python_version": "3.12" }
- uses: ./.github/actions/download
with: { "platform": "windows-2019", "python_version": "3.8" }
- uses: ./.github/actions/download
with: { "platform": "windows-2019", "python_version": "3.9" }
- uses: ./.github/actions/download
with: { "platform": "windows-2019", "python_version": "3.10" }
with: { "platform": "windows-2022", "python_version": "3.10" }
- uses: ./.github/actions/download
with: { "platform": "windows-2019", "python_version": "3.11" }
with: { "platform": "windows-2022", "python_version": "3.11" }
- uses: ./.github/actions/download
with: { "platform": "windows-2019", "python_version": "3.12" }
with: { "platform": "windows-2022", "python_version": "3.12" }
- name: Env to output
run: |
echo "package_paths<<EOF" >> $GITHUB_OUTPUT
Expand All @@ -260,5 +276,6 @@ jobs:
env:
SLACK_CHANNEL: sora-python-sdk
SLACK_COLOR: danger
SLACK_ICON_EMOJI: ":japanese_ogre:"
SLACK_TITLE: Release failed
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
20 changes: 20 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ build
src/sora_sdk/*.so
src/sora_sdk/*.dll
src/sora_sdk/*.pyd
src/sora_sdk/*.pyi
src/sora_sdk/py.typed

# パッケージ
/dist
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8.18
3.10.13
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"editor.formatOnSave": true
},
"files.associations": {
"*.cs": "csharp",
"CMakeLists.txt": "cmake",
"algorithm": "cpp",
"__bits": "cpp",
"__config": "cpp",
Expand Down Expand Up @@ -119,7 +121,9 @@
"strstream": "cpp",
"typeindex": "cpp",
"source_location": "cpp",
"__memory": "cpp"
"__memory": "cpp",
"compare": "cpp",
"concepts": "cpp"
},
"C_Cpp.errorSquiggles": "disabled",
// nanobind 周りでエラーが消えないので全部消す
Expand Down
Loading

0 comments on commit 2042402

Please sign in to comment.