1
0
Fork 0
mirror of synced 2024-06-26 10:11:19 +12:00

workflows: Move pyling to check workflow

This commit is contained in:
Stelios Tsampas 2022-09-11 20:46:33 +03:00 committed by loathingKernel
parent f7e9375964
commit 9e3dc61419
3 changed files with 169 additions and 56 deletions

44
.github/workflows/checks.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: "Checks"
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'rare/**'
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- main
paths:
- 'rare/**'
jobs:
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install Test Dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Install Target Dependencies
run: |
pip3 install -r requirements.txt
pip3 install -r requirements-presence.txt
- name: Analysis with pylint
run: |
pylint -E rare --disable=E0611,E1123,E1120 --ignore=ui,singleton.py --extension-pkg-whitelist=PyQt5

View file

@ -1,30 +1,12 @@
name: "Test"
name: "Release Tests"
on:
workflow_dispatch:
jobs:
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install -r requirements.txt
pip install pypresence
- name: Analysing the code with pylint
run: |
pylint -E rare --disable=E0611,E1123,E1120 --ignore=ui,singleton.py --extension-pkg-whitelist=PyQt5
jobs:
deb-package:
runs-on: ubuntu-latest
steps:
@ -46,7 +28,8 @@ jobs:
makedeb -d
mv *.deb Rare.deb
- uses: actions/upload-artifact@v2
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Rare.deb
path: build/Rare.deb
@ -72,7 +55,8 @@ jobs:
appimage-builder --skip-test
mv Rare-*.AppImage Rare.AppImage
- uses: actions/upload-artifact@v2
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Rare.AppImage
path: Rare.AppImage
@ -86,19 +70,38 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Dependencies
- name: Install build dependencies
run: pip3 install nuitka ordered-set
- name: Install target dependencies
run: |
pip3 install -r requirements.txt
pip3 install -r requirements-presence.txt
- name: Build Dependencies
run: pip3 install nuitka ordered-set PyQt5-stubs
- name: Build
- name: Version
id: version
run: |
python -m nuitka --assume-yes-for-downloads --follow-imports --prefer-source-code --mingw64 --lto=no --jobs=2 --static-libpython=no --standalone --enable-plugin=anti-bloat --enable-plugin=pyqt5 --show-anti-bloat-changes --nofollow-import-to="*.tests" --nofollow-import-to="*.distutils" --include-package-data=qtawesome --include-data-dir=rare\resources\images=rare\resources\images --include-data-files=rare\resources\languages=rare\resources\languages="*.qm" --windows-icon-from-ico=rare\resources\images\Rare.ico --windows-company-name=Rare --windows-product-name=Rare --windows-file-description=rare.exe --windows-file-version=1.9.0 --windows-product-version=1.9.0 --windows-disable-console rare
git fetch --prune --unshallow
echo "::set-output name=tag_offset::$(git describe --long --tags)"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build
run: >-
python -m nuitka
--assume-yes-for-downloads
--follow-imports --prefer-source-code --mingw64 --lto=no --jobs=2 --static-libpython=no --standalone
--enable-plugin=anti-bloat --enable-plugin=pyqt5 --show-anti-bloat-changes --nofollow-import-to="*.tests"
--nofollow-import-to="*.distutils" --include-package-data=qtawesome
--include-data-dir=rare\resources\images=rare\resources\images
--include-data-files=rare\resources\languages=rare\resources\languages="*.qm"
--windows-icon-from-ico=rare\resources\images\Rare.ico
--windows-company-name=Rare --windows-product-name=Rare --windows-file-description=rare.exe
--windows-file-version=0.0.0.0
--windows-product-version=0.0.0.0
--windows-disable-console
rare
- uses: actions/upload-artifact@v2
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Rare-Windows-Nuitka
name: Rare-Windows-${{ steps.version.outputs.tag_offset }}
path: rare.dist
cx_freeze:
@ -109,19 +112,28 @@ jobs:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Dependencies
run: pip3 install -r requirements.txt
- name: cx_freeze
python-version: '3.9'
- name: Install Build Dependencies
run: pip3 install --upgrade cx_freeze wheel
- name: pypresence
run: pip3 install pypresence
- name: Install Target Dependencies
run: |
pip3 install -r requirements.txt
pip3 install -r requirements-presence.txt
- name: Version
id: version
run: |
git fetch --prune --unshallow
echo "::set-output name=tag_offset::$(git describe --long --tags)"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build
run: python freeze.py bdist_msi
run: |
python freeze.py bdist_msi
mv dist/*.msi dist/Rare-Windows.msi
- uses: actions/upload-artifact@v2
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Rare-Windows.msi
name: Rare-Windows-${{ steps.version.outputs.tag_offset }}.msi
path: dist/*.msi
mac_os:
@ -144,8 +156,12 @@ jobs:
run: mv rare/__main__.py __main__.py
- name: run pyinstaller
run: |
pyinstaller -F --name Rare --add-data "rare/resources/languages/*:rare/resources/languages" --add-data "rare/resources/images/*:rare/resources/images/" --windowed --icon rare/resources/images/Rare.icns --hidden-import=legendary __main__.py
run: >-
pyinstaller -F --name Rare
--add-data "rare/resources/languages/*:rare/resources/languages"
--add-data "rare/resources/images/*:rare/resources/images/"
--windowed --icon rare/resources/images/Rare.icns
--hidden-import=legendary __main__.py
- name: create dmg
run: |

View file

@ -1,9 +1,12 @@
name: New Release
name: "Release"
on:
release:
types: [ published ]
jobs:
pypi-deploy:
if: "!github.event.release.prerelease"
@ -48,7 +51,7 @@ jobs:
makedeb -d
mv *.deb Rare.deb
- name: Upload files to GitHub
- name: Upload to Releases
uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
@ -79,7 +82,7 @@ jobs:
mv Rare-*.AppImage Rare.AppImage
mv Rare-*.AppImage.zsync Rare.AppImage.zsync
- name: Upload AppImage to GitHub
- name: Upload to Releases
uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
@ -96,6 +99,49 @@ jobs:
tag: ${{ github.ref }}
overwrite: true
nuitka:
runs-on: "windows-latest"
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install build dependencies
run: pip3 install nuitka ordered-set
- name: Install target dependencies
run: |
pip3 install -r requirements.txt
pip3 install -r requirements-presence.txt
- name: Build
run: >-
python -m nuitka
--assume-yes-for-downloads
--follow-imports --prefer-source-code --mingw64 --lto=no --jobs=2 --static-libpython=no --standalone
--enable-plugin=anti-bloat --enable-plugin=pyqt5 --show-anti-bloat-changes --nofollow-import-to="*.tests"
--nofollow-import-to="*.distutils" --include-package-data=qtawesome
--include-data-dir=rare\resources\images=rare\resources\images
--include-data-files=rare\resources\languages=rare\resources\languages="*.qm"
--windows-icon-from-ico=rare\resources\images\Rare.ico
--windows-company-name=Rare --windows-product-name=Rare --windows-file-description=rare.exe
--windows-file-version=${{ github.event.release.tag_name }}
--windows-product-version=${{ github.event.release.tag_name }}
--windows-disable-console
rare
- name: Compress
run: |
python -c "import shutil; shutil.make_archive('Rare-Windows', 'zip', 'rare.dist')"
- name: Upload to Releases
uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Rare-Windows.zip
asset_name: Rare-Windows-${{ github.event.release.tag_name }}.zip
tag: ${{ github.ref }}
overwrite: true
cx_freeze:
runs-on: "windows-latest"
steps:
@ -104,24 +150,27 @@ jobs:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Dependencies
run: pip3 install -r requirements.txt
- name: cx_freeze
python-version: '3.9'
- name: Install Build Dependencies
run: pip3 install --upgrade cx_freeze wheel
- name: Install Target Dependencies
run: |
pip3 install -r requirements.txt
pip3 install -r requirements-presence.txt
- name: Build
run: python freeze.py bdist_msi
run: |
python freeze.py bdist_msi
mv dist/*.msi dist/Rare-Windows.msi
- name: Rename File
run: mv dist/*.msi dist/Rare.msi
- name: Upload to GitHub
- name: Upload to Releases
uses: svenstaro/upload-release-action@2.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/Rare.msi
asset_name: Rare-${{ github.event.release.tag_name }}.msi
file: dist/Rare-Windows.msi
asset_name: Rare-Windows-${{ github.event.release.tag_name }}.msi
tag: ${{ github.ref }}
overwrite: true
mac_os:
runs-on: macos-latest
steps:
@ -142,8 +191,12 @@ jobs:
run: mv rare/__main__.py __main__.py
- name: run pyinstaller
run: |
pyinstaller -F --name Rare --add-data "rare/resources/languages/*:rare/resources/languages" --add-data "rare/resources/images/*:rare/resources/images/" --windowed --icon rare/resources/images/Rare.icns --hidden-import=legendary __main__.py
run: >-
pyinstaller -F --name Rare
--add-data "rare/resources/languages/*:rare/resources/languages"
--add-data "rare/resources/images/*:rare/resources/images/"
--windowed --icon rare/resources/images/Rare.icns
--hidden-import=legendary __main__.py
- name: create dmg
run: |