Skip to content

Build executable

Build executable #61

Workflow file for this run

name: Build executable
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
environment:
name: release
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install pyinstaller
- name: Build package
run: python -m build
- name: Install locally
run: python -m pip install -e .
- name: Uninstall aiodns, installed by slixmpp
run: python -m pip uninstall aiodns --yes
- name: Build executable as a single file
run: pyinstaller avtdl.py --icon NONE --collect-all avtdl --onefile --collect-submodules slixmpp.features --collect-all dateutil.zoneinfo
- name: Build executable as a folder
run: pyinstaller avtdl.py --icon NONE --collect-all avtdl
- name: Compress the folder
run: |
Compress-Archive -Path dist/avtdl/* -DestinationPath dist/avtdl.zip
Compress-Archive -Path example.config.yml -Update -DestinationPath dist/avtdl.zip
- name: Rename artifacts
run: |
mv dist/avtdl.zip dist/avtdl-${{github.event.release.tag_name}}.zip
mv dist/avtdl.exe dist/avtdl-${{github.event.release.tag_name}}.exe
- name: Upload artifacts
run: |
gh release upload ${{github.event.release.tag_name}} dist/avtdl-${{github.event.release.tag_name}}.zip
gh release upload ${{github.event.release.tag_name}} dist/avtdl-${{github.event.release.tag_name}}.exe
env:
GITHUB_TOKEN: ${{ github.TOKEN }}