Skip to content

added one more dependency, easier json #27

added one more dependency, easier json

added one more dependency, easier json #27

Workflow file for this run

name: Build and Package App
on:
push:
branches:
- main
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install VLC
run: sudo apt-get install -y vlc
- name: Install dependencies
run: pip install -r requirements.txt
- name: Package App with PyInstaller for Linux
run: |
pip install pyinstaller
pyinstaller qitv-linux.spec
- name: Upload Linux artifact
uses: actions/upload-artifact@v3
with:
name: packaged-app-linux
path: dist/qitv
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install VLC
run: choco install vlc -y
- name: Install dependencies
run: pip install -r requirements.txt
- name: Package App with PyInstaller for Windows
run: |
pip install pyinstaller
pyinstaller qitv-windows.spec
- name: Upload Windows artifact
uses: actions/upload-artifact@v3
with:
name: packaged-app-windows
path: dist/qitv.exe
build-macos-universal:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install VLC
run: brew install --cask vlc
- name: Install dependencies
run: pip install -r requirements.txt
- name: Package App with PyInstaller for macOS
run: |
pip install pyinstaller
pyinstaller qitv-macos.spec
- name: Rename the executable
run: mv dist/qitv.app/Contents/MacOS/qitv dist/qitv.app/Contents/MacOS/qitv_cli
- name: Create launcher script
run: |
printf '#!/bin/bash\nopen -n "$(dirname "$0")/qitv_cli"\n' > dist/qitv.app/Contents/MacOS/qitv
chmod +x dist/qitv.app/Contents/MacOS/qitv
- name: Ad-Hoc Sign the app
run: codesign --force --deep --sign - dist/qitv.app
- name: Zip macOS App
run: |
cd dist
zip -r qitv-macos-universal.zip qitv.app
- name: Upload macOS artifact
uses: actions/upload-artifact@v3
with:
name: packaged-app-macos-universal
path: dist/qitv-macos-universal.zip
build-macos-intel:
runs-on: macos-11
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install VLC
run: brew install --cask vlc
- name: Install dependencies
run: pip install -r requirements.txt
- name: Package App with PyInstaller for macOS (Intel)
run: |
pip install pyinstaller
pyinstaller qitv-macos.spec
- name: Rename the executable
run: mv dist/qitv.app/Contents/MacOS/qitv dist/qitv.app/Contents/MacOS/qitv_cli
- name: Create launcher script
run: |
printf '#!/bin/bash\nopen -n "$(dirname "$0")/qitv_cli"\n' > dist/qitv.app/Contents/MacOS/qitv
chmod +x dist/qitv.app/Contents/MacOS/qitv
- name: Ad-Hoc Sign the app
run: codesign --force --deep --sign - dist/qitv.app
- name: Zip macOS App
run: |
cd dist
zip -r qitv-macos-intel.zip qitv.app
- name: Upload macOS artifact
uses: actions/upload-artifact@v3
with:
name: packaged-app-macos-intel
path: dist/qitv-macos-intel.zip
release:
needs: [build-linux, build-windows, build-macos-universal, build-macos-intel]
runs-on: ubuntu-latest
steps:
- name: Get shortened SHA
id: short-sha
run: |
echo ${GITHUB_SHA:0:7} > short_sha.txt
echo "SHORT_SHA=$(cat short_sha.txt)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: release-${{ env.SHORT_SHA }}
release_name: Release ${{ env.SHORT_SHA }}
draft: false
prerelease: false
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Upload Linux Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: packaged-app-linux/qitv
asset_name: qitv-linux
asset_content_type: application/octet-stream
- name: Upload Windows Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: packaged-app-windows/qitv.exe
asset_name: qitv-windows.exe
asset_content_type: application/octet-stream
- name: Upload macOS Universal Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: packaged-app-macos-universal/qitv-macos-universal.zip
asset_name: qitv-macos-universal.zip
asset_content_type: application/zip
- name: Upload macOS Intel Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: packaged-app-macos-intel/qitv-macos-intel.zip
asset_name: qitv-macos-intel.zip
asset_content_type: application/zip