Add macos to pyinstaller

This commit is contained in:
Dark1291 2025-02-11 09:47:30 +01:00
parent 6162bdc08f
commit a78dd10b36
2 changed files with 41 additions and 14 deletions

View File

@ -52,7 +52,7 @@ jobs:
if: github.event.inputs.publish_pypi == 'false' if: github.event.inputs.publish_pypi == 'false'
strategy: strategy:
matrix: matrix:
os: [windows-latest, ubuntu-latest] os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
@ -67,6 +67,7 @@ jobs:
run: | run: |
$latestTag = git describe --tags --abbrev=0 $latestTag = git describe --tags --abbrev=0
echo "latest_tag=$latestTag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "latest_tag=$latestTag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
@ -92,7 +93,7 @@ jobs:
--hidden-import=Cryptodome.Random --hidden-import=Pillow ` --hidden-import=Cryptodome.Random --hidden-import=Pillow `
--hidden-import=pyTelegramBotAPI --additional-hooks-dir=pyinstaller/hooks ` --hidden-import=pyTelegramBotAPI --additional-hooks-dir=pyinstaller/hooks `
--add-data "StreamingCommunity;StreamingCommunity" ` --add-data "StreamingCommunity;StreamingCommunity" `
--name=StreamingCommunity --icon=".github/media/logo.ico" test_run.py --name=StreamingCommunity_win --icon=".github/media/logo.ico" test_run.py
- name: Build executable with PyInstaller (Linux) - name: Build executable with PyInstaller (Linux)
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
@ -107,28 +108,51 @@ jobs:
--hidden-import=Cryptodome.Random --hidden-import=Pillow \ --hidden-import=Cryptodome.Random --hidden-import=Pillow \
--hidden-import=pyTelegramBotAPI --additional-hooks-dir=pyinstaller/hooks \ --hidden-import=pyTelegramBotAPI --additional-hooks-dir=pyinstaller/hooks \
--add-data "StreamingCommunity:StreamingCommunity" \ --add-data "StreamingCommunity:StreamingCommunity" \
--name=StreamingCommunity test_run.py --name=StreamingCommunity_linux test_run.py
- name: Build executable with PyInstaller (macOS)
if: matrix.os == 'macos-latest'
run: |
pyinstaller --onefile --hidden-import=pycryptodomex --hidden-import=ua_generator \
--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_mac test_run.py
- name: Upload executable (Windows) - name: Upload executable (Windows)
if: matrix.os == 'windows-latest' if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: StreamingCommunity-Windows name: StreamingCommunity_win
path: dist/StreamingCommunity.exe path: dist/StreamingCommunity_win.exe
- name: Upload executable (Linux) - name: Upload executable (Linux)
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: StreamingCommunity-Linux name: StreamingCommunity_linux
path: dist/StreamingCommunity path: dist/StreamingCommunity_linux
- name: Upload executable (macOS)
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: StreamingCommunity_mac
path: dist/StreamingCommunity_mac
- name: Create or update release - name: Create or update release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
tag_name: ${{ env.latest_tag }} tag_name: ${{ env.latest_tag }}
files: | files: |
dist/StreamingCommunity.exe dist/StreamingCommunity_win.exe
dist/StreamingCommunity dist/StreamingCommunity_linux
dist/StreamingCommunity_mac
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -58,11 +58,14 @@
# Installation # Installation
<p align="center"> <p align="center">
<a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity.exe"> <a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_win.exe">
<img src="https://img.shields.io/badge/-Windows_x64-blue.svg?style=for-the-badge&logo=windows" alt="Windows"> <img src="https://img.shields.io/badge/-Windows-blue.svg?style=for-the-badge&logo=windows" alt="Windows">
</a> </a>
<a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity.zip"> <a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_mac">
<img src="https://img.shields.io/badge/-Source_tar-green.svg?style=for-the-badge" alt="Source Tarball"> <img src="https://img.shields.io/badge/-macOS-black.svg?style=for-the-badge&logo=apple" alt="macOS">
</a>
<a href="https://github.com/Arrowar/StreamingCommunity/releases/latest/download/StreamingCommunity_linux">
<img src="https://img.shields.io/badge/-Linux-orange.svg?style=for-the-badge&logo=linux" alt="Linux">
</a> </a>
<a href="https://github.com/Arrowar/StreamingCommunity/releases"> <a href="https://github.com/Arrowar/StreamingCommunity/releases">
<img src="https://img.shields.io/badge/-All_Versions-lightgrey.svg?style=for-the-badge" alt="All Versions"> <img src="https://img.shields.io/badge/-All_Versions-lightgrey.svg?style=for-the-badge" alt="All Versions">