This repository was archived by the owner on Jun 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
99 lines (93 loc) · 3.11 KB
/
python-package.yml
File metadata and controls
99 lines (93 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build
on:
workflow_dispatch:
push:
pull_request:
branches: [ master ]
jobs:
build:
if: ${{ github.event_name != 'push' || startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
python-version: 3.8
DEPLOY: 'yes'
- os: ubuntu-20.04
python-version: 3.9
- os: windows-2019
python-version: 3.6
DEPLOY: 'yes'
- os: windows-2019
python-version: 3.6
architecture: x86
DEPLOY: 'yes'
# os: [ubuntu-20.04, windows-2019] # macOS-10.15
# python-version: [3.6, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Install Windows system dependencies
if: ${{ matrix.os == 'windows-2019' }}
run: choco install opus-tools flac
- name: Install Linux system dependencies
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: sudo apt-get -y install -y -qq --no-install-recommends lame opus-tools flac
- name: Install python dependencies
run: |
python -m pip install -U pip
pip install -U setuptools wheel
pip install rhvoice-wrapper-data
pip install $(python test_helper.py ${{ matrix.os }} ${{ matrix.architecture }})
- name: Build Linux Package
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: python setup.py sdist bdist_wheel
- name: Build Windows Package
if: ${{ matrix.os == 'windows-2019' }}
run: python setup.py bdist_wininst
- name: Test to install in Linux
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
pip install --no-cache-dir dist/*.gz
pip uninstall rhvoice-wrapper -y
pip install --no-cache-dir dist/*.whl
- name: Test with unittest
run: python -m unittest discover -v -s rhvoice_wrapper/tests/
- name: Upload artifacts
if: ${{ matrix.DEPLOY != '' }}
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/
retention-days: 2
deploy:
needs: build
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v4.1.7
with:
name: dist
path: dist/
- name: Deploy to GH Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
- name: Remove exe
run: rm dist/*.exe
- name: Deploy to PYPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}