Skip to content

Bump setuptools from 70.0.0 to 78.1.1 in /packaging/flatpak #8

Bump setuptools from 70.0.0 to 78.1.1 in /packaging/flatpak

Bump setuptools from 70.0.0 to 78.1.1 in /packaging/flatpak #8

Workflow file for this run

name: Build and Test
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
workflow_dispatch:
workflow_call:
jobs:
python-tests:
name: Test Python Package
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
timeout-minutes: 10
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -e ".[dev]"
- name: Run tests
timeout-minutes: 10
run: pytest --cov=lddecode --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
functional-tests:
name: Functional Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
timeout-minutes: 10
run: |
sudo apt-get update
sudo apt-get install -y cmake ffmpeg
python -m pip install --upgrade pip setuptools wheel
pip install -e .
- name: Configure CMake
run: |
mkdir -p build/testout
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
- name: Run functional tests
timeout-minutes: 60
working-directory: build
run: ctest --output-on-failure -V
build-python-wheel:
name: Build Python Wheel for PyPI
runs-on: ubuntu-latest
needs: [python-tests, functional-tests]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build Python wheel
run: |
python -m pip install --upgrade pip build
python -m build
- name: Upload Python wheel
uses: actions/upload-artifact@v4
with:
name: python-wheel
path: dist/*
retention-days: 7
build-flatpak:
name: Build Flatpak
runs-on: ubuntu-latest
needs: [python-tests, functional-tests]
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-24.08
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Determine version
id: version
run: |
if [[ "${{ github.ref }}" =~ ^refs/tags/v(.*)$ ]]; then
echo "version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
else
echo "version=0.0.0-dev-${{ github.sha }}" >> $GITHUB_OUTPUT
fi
- name: Generate version file
run: |
BRANCH="release"
COMMIT="unknown"
DIRTY=""
if git describe --tags --exact-match > /dev/null 2>&1; then
COMMIT=$(git describe --tags --exact-match | sed 's/^v//')
BRANCH="release"
elif git describe --tags --always > /dev/null 2>&1; then
COMMIT=$(git describe --tags --always | sed 's/^v//')
fi
if [ -z "$BRANCH" ] || [ "$BRANCH" = "HEAD" ]; then
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$BRANCH" = "HEAD" ]; then
BRANCH="release"
fi
fi
if [ -n "$(git status --porcelain)" ]; then
DIRTY=":dirty"
fi
VERSION_STRING="${BRANCH}:${COMMIT}${DIRTY}"
echo "$VERSION_STRING" > lddecode/version
echo "Version: $VERSION_STRING"
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: ld-decode-${{ steps.version.outputs.version }}-x86_64.flatpak
manifest-path: packaging/flatpak/com.github.happycube.LdDecode.yml
cache-key: flatpak-builder-${{ github.sha }}
- name: Upload Flatpak
uses: actions/upload-artifact@v4
with:
name: flatpak-package
path: ld-decode-*.flatpak
retention-days: 90
build-windows:
name: Build Windows MSI
runs-on: windows-latest
needs: [python-tests, functional-tests]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install WiX Toolset
shell: pwsh
run: |
choco install wixtoolset -y
$wixPath = "C:\Program Files (x86)\WiX Toolset v3.14\bin"
if (Test-Path "C:\Program Files (x86)\WiX Toolset v3.11\bin") {
$wixPath = "C:\Program Files (x86)\WiX Toolset v3.11\bin"
}
echo $wixPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Host "WiX path: $wixPath"
- name: Build MSI
shell: pwsh
run: |
$version = "0.0.0.dev0+git.${{ github.sha }}"
if ("${{ github.ref }}" -match '^refs/tags/v(.*)$') {
$version = $matches[1]
}
# Generate version file before build
$branch = "release"
$commit = "unknown"
$dirty = ""
try {
$tagDesc = & git describe --tags --exact-match 2>$null
if ($LASTEXITCODE -eq 0) {
$commit = $tagDesc.Trim() -replace '^v', ''
$branch = "release"
} else {
$describeResult = & git describe --tags --always 2>$null
if ($LASTEXITCODE -eq 0) {
$commit = $describeResult.Trim() -replace '^v', ''
}
$branchResult = & git rev-parse --abbrev-ref HEAD 2>$null
if ($LASTEXITCODE -eq 0) {
$branch = $branchResult.Trim()
if ($branch -eq "HEAD") { $branch = "release" }
}
}
$statusResult = & git status --porcelain 2>$null
if ($LASTEXITCODE -eq 0 -and $statusResult.Length -gt 0) {
$dirty = ":dirty"
}
} catch {
Write-Host "Note: Could not get git info, using defaults" -ForegroundColor Gray
}
$versionString = "$branch`:$commit$dirty"
Set-Content "lddecode/version" $versionString
Write-Host "Version: $versionString" -ForegroundColor Cyan
.\packaging\windows\build_msi.ps1 -Version $version
- name: Upload MSI
uses: actions/upload-artifact@v4
with:
name: windows-msi
path: ld-decode-*-win64.msi
retention-days: 90
build-macos:
name: Build macOS DMG
runs-on: macos-latest
needs: [python-tests, functional-tests]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies and build bundle
run: |
python -m pip install --upgrade pip pyinstaller
pip install -e .
pyinstaller packaging/macos/ld-decode.spec --clean
- name: Install create-dmg
run: brew install create-dmg
- name: Package DMG
run: |
# Generate version file before build
BRANCH="release"
COMMIT="unknown"
DIRTY=""
if git describe --tags --exact-match > /dev/null 2>&1; then
COMMIT=$(git describe --tags --exact-match | sed 's/^v//')
BRANCH="release"
elif git describe --tags --always > /dev/null 2>&1; then
COMMIT=$(git describe --tags --always | sed 's/^v//')
fi
if [ -z "$BRANCH" ] || [ "$BRANCH" = "HEAD" ]; then
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$BRANCH" = "HEAD" ]; then
BRANCH="release"
fi
fi
if [ -n "$(git status --porcelain)" ]; then
DIRTY=":dirty"
fi
VERSION_STRING="${BRANCH}:${COMMIT}${DIRTY}"
echo "$VERSION_STRING" > lddecode/version
echo "Version: $VERSION_STRING"
VERSION="0.0.0-dev-${{ github.sha }}"
if [[ "${{ github.ref }}" =~ ^refs/tags/v(.*)$ ]]; then
VERSION="${BASH_REMATCH[1]}"
fi
create-dmg \
--volname "ld-decode" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "ld-decode.app" 200 190 \
--hide-extension "ld-decode.app" \
--app-drop-link 600 185 \
"ld-decode-${VERSION}-macos.dmg" \
"dist/ld-decode.app" || true
# Fallback to hdiutil if create-dmg fails
if [ ! -f "ld-decode-${VERSION}-macos.dmg" ]; then
echo "Using hdiutil fallback..."
mkdir -p dmg_staging
cp -R dist/ld-decode.app dmg_staging/
ln -s /Applications dmg_staging/Applications
hdiutil create -volname "ld-decode" \
-srcfolder dmg_staging \
-ov -format UDZO \
"ld-decode-${VERSION}-macos.dmg"
rm -rf dmg_staging
fi
- name: Upload DMG
uses: actions/upload-artifact@v4
with:
name: macos-dmg
path: ld-decode-*-macos.dmg
retention-days: 90