build(ci): add windows and macos binary support

This commit is contained in:
Rémi Alvergnat
2021-02-04 00:50:09 +01:00
parent d0df79f477
commit 4b1fa7748b
3 changed files with 161 additions and 28 deletions
+159 -27
View File
@@ -3,12 +3,12 @@ on:
push: ~
pull_request: ~
jobs:
build:
ci:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
strategy:
fail-fast: false
fail-fast: true
matrix:
python-version: [ 3.5, 3.6, 3.7, 3.8, 3.9 ] # pypy-3.6, pypy-3.7 are supported but a bit slow.
regex: [ "0", "1" ]
@@ -37,11 +37,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Git User config
run: |
git config --global user.email "action@github.com"
git config --global user.name "github-actions"
- name: Install Dependencies
run: |
pip install -e .[dev,test]
@@ -66,23 +61,6 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
- name: Build
run: python setup.py build
- name: Binary
run: pyinstaller --dist ./dist guessit.spec
if: matrix.python-version != 'pypy-3.7'
- name: Check binary
run: ./dist/guessit "Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi"
if: matrix.python-version != 'pypy-3.7'
- uses: actions/upload-artifact@v2
if: matrix.regex == '0'
with:
name: guessit-dist-${{matrix.python-version}}
path: ./dist
commitlint:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
@@ -94,9 +72,9 @@ jobs:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v2
release:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: build
build-setuptools:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
needs: [ci]
runs-on: ubuntu-latest
@@ -111,6 +89,160 @@ jobs:
with:
fetch-depth: 0
- name: Install Dependencies
run: |
pip install -e .[dev]
- name: Bump version
run: semantic-release -v DEBUG version
- name: Build
run: python setup.py sdist bdist_wheel
- uses: actions/upload-artifact@v2
with:
name: guessit-python
path: ./dist
build-bin-linux:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
needs: [ci]
runs-on: ubuntu-latest
steps:
- name: Setup python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Dependencies
run: |
pip install -e .[dev]
- name: Bump version
run: semantic-release -v DEBUG version
- name: Binary
run: pyinstaller --dist ./dist guessit.spec
- name: Check binary
run: ./dist/guessit "Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi"
- uses: actions/upload-artifact@v2
if: matrix.regex == '0'
with:
name: guessit-bin-linux
path: ./dist
build-bin-windows:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
needs: [ci]
runs-on: windows-latest
steps:
- name: Setup python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Dependencies
run: |
pip install -e .[dev]
- name: Bump version
run: semantic-release -v DEBUG version
- name: Binary
run: pyinstaller --dist ./dist guessit.spec
- name: Check binary
run: ./dist/guessit "Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi"
- uses: actions/upload-artifact@v2
with:
name: guessit-bin-windows
path: ./dist
build-bin-macos:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
needs: [ci]
runs-on: macos-latest
steps:
- name: Setup python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Dependencies
run: |
pip install -e .[dev]
- name: Bump version
run: semantic-release -v DEBUG version
- name: Binary
run: pyinstaller --dist ./dist guessit.spec
- name: Check binary
run: ./dist/guessit "Treme.1x03.Right.Place,.Wrong.Time.HDTV.XviD-NoTV.avi"
- uses: actions/upload-artifact@v2
with:
name: guessit-bin-macos
path: ./dist
release:
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
needs: [commitlint, build-setuptools, build-bin-linux, build-bin-windows, build-bin-macos]
runs-on: ubuntu-latest
steps:
- name: Setup python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/download-artifact@v2
with:
path: artifacts
- run: ls -alR artifacts
- name: Copy artifacts to ./dist
run: |
mkdir -p ./dist
mv artifacts/guessit-bin-linux/guessit ./dist/guessit-linux
mv artifacts/guessit-bin-macos/guessit ./dist/guessit-macos
mv artifacts/guessit-bin-windows/guessit.exe ./dist/guessit-windows.exe
mv artifacts/guessit-python/* ./dist
- run: ls -al ./dist
- name: Git User config
run: |
git config --global user.email "action@github.com"
+1
View File
@@ -3,6 +3,7 @@ version_variable = guessit/__version__.py:__version__
commit_subject = chore(release): release v{version}
commit_author = github-actions <actions@github.com>
upload_to_pypi_glob_patterns = *.tar.gz,*.whl
build_command = ""
[aliases]
test=pytest
+1 -1
View File
@@ -19,7 +19,7 @@ install_requires = ['rebulk>=3', 'babelfish', 'python-dateutil']
setup_requires = ['pytest-runner']
dev_require = ['tox', 'mkdocs', 'mkdocs-material', 'pyinstaller']
dev_require = ['tox', 'mkdocs', 'mkdocs-material', 'pyinstaller', 'python-semantic-release']
tests_require = ['pytest', 'pytest-benchmark', 'pylint', 'PyYAML']