From 463cb6d4f97fc3e54973c731a2cd5c5e76dc5ac2 Mon Sep 17 00:00:00 2001 From: Srevin Saju Date: Sun, 19 Sep 2021 21:59:51 +0300 Subject: [PATCH] ci: move to pyuploadtool for release orchestration --- .github/workflows/continuous.yml | 109 ++++++------------------------- pyproject.toml | 2 + 2 files changed, 21 insertions(+), 90 deletions(-) diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index ebb448e9..8d17a743 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -5,7 +5,7 @@ on: jobs: Wheel: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -117,21 +117,14 @@ jobs: python-version: '3.x' architecture: ${{ matrix.arch }} - - name: Patch PySide2 - if: matrix.qt == 'PySide2' - run: | - sed -i 's,PyQt5,PySide2,g' requirements.txt - sed -i 's,PyQt5,PySide2,g' setup.py - - name: Install dependencies run: | - pip3 install --upgrade pip - pip3 install --upgrade setuptools wheel - pip3 install PyInstaller - pip3 install -r requirements.txt - pip3 install . - echo Done - + pip3 install --upgrade pip wheel + pip3 install --upgrade poetry PyInstaller ${{ matrix.arch }} + poetry install -E pyinstaller -E ${{ matrix.qt }} + poetry build + pip3 install dist/*.whl + - name: Create .exe run: | echo "from guiscrcpy.cli import cli; cli()" > entry.py @@ -163,21 +156,13 @@ jobs: python-version: '3.x' architecture: ${{ matrix.arch }} - - name: Patch PySide2 - if: matrix.qt == 'PySide2' - run: | - brew install gnu-sed - gsed -i 's,PyQt5,PySide2,g' requirements.txt - gsed -i 's,PyQt5,PySide2,g' setup.py - name: Install dependencies run: | - pip3 install --upgrade pip - pip3 install --upgrade setuptools wheel - pip3 install PyInstaller - pip3 install -r requirements.txt - pip3 install . - echo Done + pip3 install --upgrade pip wheel + pip3 install --upgrade poetry PyInstaller ${{ matrix.arch }} + poetry build + pip3 install dist/*.whl - name: Create .exe run: | @@ -196,70 +181,14 @@ jobs: Release: needs: [Windows, AppImage, Wheel, MacOS] runs-on: ubuntu-latest - strategy: - matrix: - version: [3.8] steps: - - uses: actions/download-artifact@v1 - with: - name: guiscrcpy-PyQt5-x86-continuous.exe - - uses: actions/download-artifact@v1 - with: - name: guiscrcpy-PyQt5-x64-continuous.exe - - uses: actions/download-artifact@v1 - with: - name: guiscrcpy-PySide2-x86-continuous.exe - - uses: actions/download-artifact@v1 - with: - name: guiscrcpy-PySide2-x64-continuous.exe - - uses: actions/download-artifact@v1 - with: - name: guiscrcpy-PySide2-x64-continuous.app - - uses: actions/download-artifact@v1 - with: - name: guiscrcpy-continuous-none-any-py3.whl - - uses: actions/download-artifact@v1 - with: - name: guiscrcpy-r-continuous-x86_64.AppImage - - uses: actions/download-artifact@v1 - with: - name: guiscrcpy-m-continuous-x86_64.AppImage - - - name: PreRelease - uses: marvinpinto/action-automatic-releases@latest - if: github.ref == 'refs/heads/master' && startsWith(github.ref, 'refs/tags/') != true - with: - prerelease: true - draft: false - automatic_release_tag: continuous - title: continuous - files: | - guiscrcpy-PyQt5-x86-continuous.exe - guiscrcpy-PyQt5-x64-continuous.exe - guiscrcpy-PySide2-x86-continuous.exe - guiscrcpy-PySide2-x64-continuous.exe - guiscrcpy-PySide2-x64-continuous.app - guiscrcpy-continuous-none-any-py3.whl - guiscrcpy-m-continuous-x86_64.AppImage - guiscrcpy-r-continuous-x86_64.AppImage + - uses: actions/download-artifact@v2 - repo_token: ${{ secrets.GITHUB_TOKEN }} - - - name: Release - uses: marvinpinto/action-automatic-releases@latest - if: startsWith(github.ref, 'refs/tags/v') - with: - prerelease: false - draft: true - files: | - guiscrcpy-PyQt5-x86-continuous.exe - guiscrcpy-PyQt5-x64-continuous.exe - guiscrcpy-PySide2-x86-continuous.exe - guiscrcpy-PySide2-x64-continuous.exe - guiscrcpy-PySide2-x64-continuous.app - guiscrcpy-continuous-none-any-py3.whl - guiscrcpy-m-continuous-x86_64.AppImage - guiscrcpy-r-continuous-x86_64.AppImage - - repo_token: ${{ secrets.GITHUB_TOKEN }} + - name: Create release and upload artifacts + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CHANGELOG_TYPE: conventional + run: | + wget -q https://github.com/srevinsaju/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage && chmod +x pyuploadtool-x86_64.AppImage + ./pyuploadtool-x86_64.AppImage */guiscrcpy*.* diff --git a/pyproject.toml b/pyproject.toml index 19179214..d5e8dfe4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ colorama = "^0.4.4" click = "^8.0.1" QtPy = "^1.9.0" PyQt5 = {version = "^5.15.4", optional = true} +PyInstaller = {version = "*", optional = true} PySide2 = {version = "^5.15.2", optional = true} CairoSVG = {version = "^2.5.2", optional = true} @@ -26,6 +27,7 @@ black = "^21.7b0" [tool.poetry.extras] pyqt5 = ["pyqt5"] pyside2 = ["pyside2"] +pyinstaller = ["pyinstaller"] [build-system] requires = ["poetry-core>=1.0.0"]