mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-06 11:35:29 +00:00
Update build.yml
This commit is contained in:
parent
66e7d47685
commit
438adb2f4c
50
.github/workflows/build.yml
vendored
50
.github/workflows/build.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Build and Release with PyInstaller
|
name: Build with PyInstaller
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -9,7 +9,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
@ -17,9 +17,9 @@ jobs:
|
|||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Cache Python dependencies
|
- name: Cache Python dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pip
|
path: C:\Users\runneradmin\AppData\Local\pip\Cache
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pip-
|
${{ runner.os }}-pip-
|
||||||
@ -27,22 +27,54 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
python -m pip install -r requirements.txt
|
||||||
pip install fake-useragent==1.1.3
|
python -m pip install fake-useragent==1.1.3 pyinstaller
|
||||||
|
|
||||||
- name: Build executable with PyInstaller
|
- name: Build executable with PyInstaller
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
pyinstaller --onefile --hidden-import=pycryptodomex --hidden-import=fake_useragent --hidden-import=qbittorrentapi --hidden-import=qbittorrent --hidden-import=googlesearch --hidden-import=bs4 --hidden-import=httpx --hidden-import=rich --hidden-import=tqdm --hidden-import=m3u8 --hidden-import=psutil --hidden-import=unidecode --hidden-import=jsbeautifier --hidden-import=pathvalidate --hidden-import=Cryptodome.Cipher --hidden-import=Cryptodome.Cipher.AES --hidden-import=Cryptodome.Util --hidden-import=Cryptodome.Util.Padding --hidden-import=Cryptodome.Random --hidden-import=Pillow --hidden-import=pyTelegramBotAPI --additional-hooks-dir=pyinstaller/hooks --add-data "StreamingCommunity;StreamingCommunity" --name=StreamingCommunity --icon="StreamingCommunity/Test/Media/62809003.ico" test_run.py
|
set -e
|
||||||
|
pyinstaller --onefile --hidden-import=pycryptodomex --hidden-import=fake_useragent --hidden-import=qbittorrentapi \
|
||||||
|
--hidden-import=qbittorrent --hidden-import=googlesearch --hidden-import=bs4 --hidden-import=httpx \
|
||||||
|
--hidden-import=rich --hidden-import=tqdm --hidden-import=m3u8 --hidden-import=psutil --hidden-import=unidecode \
|
||||||
|
--hidden-import=jsbeautifier --hidden-import=pathvalidate --hidden-import=Cryptodome.Cipher \
|
||||||
|
--hidden-import=Cryptodome.Cipher.AES --hidden-import=Cryptodome.Util --hidden-import=Cryptodome.Util.Padding \
|
||||||
|
--hidden-import=Cryptodome.Random --hidden-import=Pillow --hidden-import=pyTelegramBotAPI \
|
||||||
|
--additional-hooks-dir=pyinstaller/hooks --add-data "StreamingCommunity;StreamingCommunity" \
|
||||||
|
--name=StreamingCommunity --icon="Test/Media/62809003.ico" test_run.py
|
||||||
|
|
||||||
|
- name: Verify build output
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ ! -f "dist/StreamingCommunity.exe" ]; then
|
||||||
|
echo "Errore: il file dist/StreamingCommunity.exe non esiste!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Upload executable as artifact
|
- name: Upload executable as artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: StreamingCommunity
|
name: StreamingCommunity
|
||||||
path: dist/StreamingCommunity.exe
|
path: dist/StreamingCommunity.exe
|
||||||
|
|
||||||
|
- name: Get latest tag from GitHub
|
||||||
|
id: get_latest_tag
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
TAG=$(curl -s https://api.github.com/repos/Arrowar/StreamingCommunity/releases/latest | jq -r '.tag_name')
|
||||||
|
if [[ "$TAG" == "null" || -z "$TAG" ]]; then
|
||||||
|
echo "Nessun tag trovato, impostazione di default a v1.0.0"
|
||||||
|
TAG="v1.0.0"
|
||||||
|
fi
|
||||||
|
echo "Latest tag: $TAG"
|
||||||
|
echo "latest_tag=$TAG" >> $GITHUB_ENV
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Create or update GitHub release
|
- name: Create or update GitHub release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
|
tag_name: ${{ env.latest_tag }}
|
||||||
files: dist/StreamingCommunity.exe
|
files: dist/StreamingCommunity.exe
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user