download mediainfo lib #104
Workflow file for this run
This file contains 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: Packaging | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
make-outputs: | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.get_version.outputs.VERSION }} | |
steps: | |
- name: Get version | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT | |
release: | |
runs-on: ${{ matrix.os }} | |
needs: [make-outputs] | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
pkg_suffix: win-amd64.zip | |
- os: ubuntu-latest | |
pkg_suffix: linux-x86_64.tar.gz | |
- os: macos-latest | |
pkg_suffix: macos-universal2.dmg | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python (Windows & Linux) | |
if: matrix.os != 'macos-latest' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Set up Python (MacOS Universal2) | |
if: matrix.os == 'macos-latest' | |
run: | | |
curl -L https://www.python.org/ftp/python/3.11.7/python-3.11.7-macos11.pkg --output ~/Downloads/python.pkg | |
sudo installer -pkg ~/Downloads/python.pkg -target / | |
- name: Install OS dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libegl1 | |
- uses: pdm-project/setup-pdm@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies (Windows & Linux) | |
if: matrix.os != 'macos-latest' | |
run: pdm sync -G desktop -G ujson -G packaging --no-editable | |
- name: Install dependencies (MacOS Universal2) | |
if: matrix.os == 'macos-latest' | |
run: | | |
pdm export -G desktop -G ujson -G packaging -o packaging/requirements.txt --without-hashes | |
python -m venv .venv | |
source .venv/bin/activate | |
cd packaging | |
python -m ensurepip --upgrade | |
python -m pip install delocate | |
python universal2_install.py | |
cd .. | |
pdm build --no-sdist | |
python -m pip install dist/*.whl --no-deps | |
- name: Build with cx_freeze (Windows & Linux) | |
if: matrix.os != 'macos-latest' | |
shell: bash -el {0} | |
run: | | |
cd packaging | |
pdm run python setup.py bdist_portable | |
cd .. | |
- name: Build with cx_freeze (MacOS Universal2) | |
if: matrix.os == 'macos-latest' | |
run: | | |
source .venv/bin/activate | |
cd packaging | |
python setup.py bdist_dmg | |
mkdir dist | |
mv build/LibreSVIP.dmg dist/LibreSVIP-${{ needs.make-outputs.outputs.VERSION }}.${{ matrix.pkg_suffix }} | |
cd .. | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libresvip-${{ matrix.pkg_suffix }} | |
path: ./packaging/dist | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
tag_name: v${{ needs.make-outputs.outputs.VERSION }} | |
files: | | |
./packaging/dist/LibreSVIP-${{ needs.make-outputs.outputs.VERSION }}.${{ matrix.pkg_suffix }} | |
release_linux_aarch64: | |
runs-on: ubuntu-latest | |
needs: [make-outputs] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: uraimo/run-on-arch-action@v2 | |
name: Build artifact | |
with: | |
arch: aarch64 | |
distro: ubuntu20.04 | |
dockerRunArgs: --volume "${PWD}:/libresvip" | |
install: | | |
apt-get update | |
apt-get install -y software-properties-common | |
add-apt-repository ppa:deadsnakes/ppa | |
apt-get update | |
apt-get install -y libdouble-conversion3 libegl1 libgl1 libmediainfo-dev libwebp6 python3.11-dev python3.11-venv | |
update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 | |
run: | | |
cd /libresvip | |
python -m ensurepip --upgrade | |
python -m pip install pdm | |
python -m pdm sync -G desktop -G ujson -G packaging --no-editable | |
cd packaging | |
python -m pdm run python setup.py bdist_portable | |
cd .. | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: libresvip-linux-aarch64.tar.gz | |
path: ./packaging/dist | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
tag_name: v${{ needs.make-outputs.outputs.VERSION }} | |
files: | | |
./packaging/dist/LibreSVIP-${{ needs.make-outputs.outputs.VERSION }}.linux-aarch64.tar.gz |