-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (47 loc) · 1.77 KB
/
publish-exe.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 }}