Update: [Installer] QSVEncC 向け Intel Media Driver のインストールコマンドを最新版に更新 #186
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Installer | |
| # installer/ 以下のファイルに変更があったとき or | |
| # .github/workflows/build_installer.yaml (このファイル) に変更があったとき or 他のワークフローからの呼び出し or 手動実行 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - 'installer/**' | |
| - '.github/workflows/build_installer.yaml' | |
| workflow_call: | |
| workflow_dispatch: | |
| # ジョブの定義 | |
| jobs: | |
| # Windows 向けのインストーラーのビルド | |
| build-windows: | |
| runs-on: windows-2022 | |
| steps: | |
| # KonomiTV のソースコードをチェックアウト | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| # Python 3.11 環境をセットアップ | |
| ## 事前に Runner 自体に入っている Python に Poetry をインストールしておく必要がある | |
| - name: Install Poetry (for Runner) | |
| run: | | |
| python -m pip install poetry | |
| - name: Setup Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| cache: 'poetry' | |
| cache-dependency-path: '${{ github.workspace }}/installer/poetry.lock' | |
| # インストーラーの依存関係をインストール | |
| - name: Install Dependencies | |
| working-directory: installer/ | |
| run: | | |
| pip install poetry | |
| poetry install --no-root | |
| # インストーラーを PyInstaller でビルド | |
| - name: Build Installer with PyInstaller | |
| working-directory: installer/ | |
| run: poetry run task build-windows | |
| # 単一実行ファイルにビルドされたインストーラーを Artifact としてアップロード | |
| - name: Upload Installer Executable as Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: KonomiTV-Installer.exe | |
| path: installer/dist/KonomiTV-Installer.exe | |
| # Linux 向けのインストーラーのビルド | |
| build-linux: | |
| strategy: | |
| fail-fast: false # 一つのビルドが失敗しても他のビルドは継続する | |
| matrix: | |
| include: | |
| # x64 アーキテクチャ向けのビルド設定 | |
| - arch: amd64 | |
| runner: ubuntu-22.04 | |
| artifact_suffix: '' | |
| # arm64 アーキテクチャ向けのビルド設定 | |
| - arch: arm64 | |
| runner: ubuntu-22.04-arm | |
| artifact_suffix: '-ARM' | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| # Docker Buildx のセットアップ | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| # Dockerfile を作成 | |
| - name: Create Dockerfile | |
| run: | | |
| cat <<EOF > Dockerfile | |
| FROM ubuntu:20.04 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends software-properties-common && \ | |
| add-apt-repository -y ppa:deadsnakes/ppa && \ | |
| apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| python3.11 \ | |
| python3.11-dev \ | |
| python3.11-distutils \ | |
| python3.11-venv \ | |
| zlib1g \ | |
| zlib1g-dev | |
| RUN curl https://bootstrap.pypa.io/get-pip.py | python3.11 | |
| RUN python3.11 -m pip install poetry | |
| EOF | |
| # Ubuntu 20.04 の Docker イメージをビルド | |
| - name: Build Docker Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| tags: ubuntu:20.04-custom | |
| cache-from: type=gha,scope=ubuntu:20.04-custom(${{ matrix.arch }}) | |
| cache-to: type=gha,scope=ubuntu:20.04-custom(${{ matrix.arch }}),mode=max | |
| load: true | |
| # Dockerfile を削除 | |
| - name: Remove Dockerfile | |
| run: rm Dockerfile | |
| # KonomiTV のソースコードをチェックアウト | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| # インストーラーを PyInstaller でビルド | |
| # arm64 ビルドではリリースでの区別のため、ファイル名を KonomiTV-Installer-ARM.elf に変更する | |
| - name: Build Installer with PyInstaller | |
| working-directory: installer/ | |
| run: | | |
| docker run --rm -i -v $(pwd):/work -w /work ubuntu:20.04-custom bash -c \ | |
| 'poetry install --no-root && poetry run task build-linux' | |
| if [ "${{ matrix.arch }}" == "arm64" ]; then | |
| echo "Renaming artifact for ARM build..." | |
| sudo mv dist/KonomiTV-Installer.elf dist/KonomiTV-Installer-ARM.elf | |
| fi | |
| # 単一実行ファイルにビルドされたインストーラーを Artifact としてアップロード | |
| # matrix の設定に応じてファイル名とパスを動的に変更 | |
| - name: Upload Installer Executable as Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: KonomiTV-Installer${{ matrix.artifact_suffix }}.elf | |
| path: installer/dist/KonomiTV-Installer${{ matrix.artifact_suffix }}.elf |