Replace Travis CI with GitHub Actions, and make Windows/Linux builds. (#896)

This commit is contained in:
Ryan Hirasaki 2022-06-15 05:37:49 +00:00 committed by GitHub
parent 1efa3d80d2
commit 62e0da6824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 66 additions and 23 deletions

66
.github/workflows/package.yml vendored Normal file
View File

@ -0,0 +1,66 @@
name: Package
on: [push, pull_request]
jobs:
package-macos:
runs-on: macos-latest
env:
PIPENV_VENV_IN_PROJECT: 1
PIPENV_IGNORE_VIRTUALENVS: 1
steps:
- uses: actions/checkout@v3
- name: Setup Python Environment
run: |
pip3 install pipenv
pipenv install pyqt5 lxml
pipenv run pip install pyqt5==5.15.6 lxml
- name: Build LabelImg
run: |
pipenv run make qt5py3
rm -rf build dist
- name: Package LabelImg
run: |
pipenv run python setup.py py2app
open dist/labelImg.app
- name: Archive macOS app
run: |
cd dist/
tar czf labelImg.tgz labelImg.app
- uses: actions/upload-artifact@v3
with:
name: macOS artifact
path: dist/labelImg.tgz
package-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python Environment
run: |
pip3 install pyinstaller pyqt5==5.15.6 lxml
- name: Build LabelImg
run: |
pyrcc5 -o libs/resources.py resources.qrc
- name: Package LabelImg
run: |
pyinstaller --hidden-import=pyqt5 --hidden-import=lxml -F -n "labelImg" -c labelImg.py -p ./libs -p ./
- uses: actions/upload-artifact@v3
with:
name: Windows artifact
path: dist/labelImg.exe
package-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python Environment
run: |
pip3 install pyinstaller pyqt5==5.15.6 lxml
- name: Build LabelImg
run: |
pyrcc5 -o libs/resources.py resources.qrc
- name: Package LabelImg
run: |
pyinstaller --hidden-import=pyqt5 --hidden-import=lxml -F -n "labelImg" -c labelImg.py -p ./libs -p ./
- uses: actions/upload-artifact@v3
with:
name: Linux artifact
path: dist/labelImg

View File

@ -1,23 +0,0 @@
# vim: set ts=2 et:
jobs:
include:
# Pipenv Python 3.7.5 + QT5 - Build .app
- os: osx
language: generic
env:
- PIPENV_VENV_IN_PROJECT=1
- PIPENV_IGNORE_VIRTUALENVS=1
install:
- python3 --version
- pip3 install pipenv
- pipenv install pyqt5 lxml
- pipenv run pip install pyqt5==5.13.2 lxml
- pipenv run make qt5py3
- rm -rf build dist
- pipenv run python setup.py py2app
- open dist/labelImg.app
script:
- exit 0