diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml new file mode 100644 index 0000000..6e9f25c --- /dev/null +++ b/.github/workflows/build-dev.yml @@ -0,0 +1,92 @@ +name: Build Dev Branch + +on: + workflow_dispatch: + push: + branches: + - "dev" + +jobs: + build: + strategy: + matrix: + include: + - os: windows-latest + artifact_name: dev_StreamingCommunity_win + executable: dev_StreamingCommunity_win.exe + separator: ';' + + - os: macos-latest + artifact_name: dev_StreamingCommunity_mac + executable: dev_StreamingCommunity_mac + separator: ':' + + - os: ubuntu-latest + artifact_name: dev_StreamingCommunity_linux_latest + executable: dev_StreamingCommunity_linux_latest + separator: ':' + + - os: ubuntu-22.04 + artifact_name: dev_StreamingCommunity_linux_previous + executable: dev_StreamingCommunity_linux_previous + separator: ':' + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get the latest release tag + id: get_latest_release + shell: bash + run: | + latest_tag=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name) + echo "latest_tag=$latest_tag" >> $GITHUB_ENV + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade certifi + python -m pip install -r requirements.txt + python -m pip install pyinstaller + + - name: Build executable with PyInstaller + shell: bash + run: | + pyinstaller --onefile --hidden-import=pycryptodomex --hidden-import=ua_generator \ + --hidden-import=qbittorrentapi --hidden-import=qbittorrent \ + --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=jsbeautifier.core \ + --hidden-import=jsbeautifier.javascript --hidden-import=jsbeautifier.javascript.beautifier \ + --hidden-import=jsbeautifier.unpackers --hidden-import=jsbeautifier.unpackers.packer \ + --hidden-import=jsbeautifier.unpackers.javascriptobfuscator \ + --hidden-import=jsbeautifier.unpackers.myobfuscate \ + --hidden-import=jsbeautifier.unpackers.urlencode \ + --hidden-import=jsbeautifier.unpackers.meshim \ + --hidden-import=editorconfig --hidden-import=editorconfig.handlers \ + --hidden-import=six --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=telebot \ + --additional-hooks-dir=pyinstaller/hooks \ + --add-data "StreamingCommunity${{ matrix.separator }}StreamingCommunity" \ + --name=${{ matrix.artifact_name }} test_run.py + + - name: Upload executable to latest release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.latest_tag }} + files: dist/${{ matrix.executable }} + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}