2019-10-06 21:47:37 +02:00
|
|
|
name: Test, build and deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
env:
|
|
|
|
STREAMLINK_DIST_DIR: ${{ github.workspace }}/dist
|
2019-10-12 01:43:07 +02:00
|
|
|
SIGNING_KEY_ID: 2E390FA0
|
|
|
|
SIGNING_KEY_FILE: ${{ github.workspace }}/signing.key
|
2019-10-06 21:47:37 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Test
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
|
|
|
python: [2.7, 3.5, 3.6, 3.7, 3.8]
|
|
|
|
# include:
|
|
|
|
# - python: X.Y-dev
|
|
|
|
# continue: true
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
- name: Install dependencies
|
|
|
|
continue-on-error: ${{ matrix.continue }}
|
|
|
|
run: bash ./script/install-dependencies.sh
|
|
|
|
- name: Test
|
|
|
|
continue-on-error: ${{ matrix.continue }}
|
|
|
|
run: pytest --cov
|
|
|
|
- name: Lint
|
|
|
|
continue-on-error: ${{ matrix.continue }}
|
|
|
|
run: flake8
|
|
|
|
- name: Upload coverage data
|
|
|
|
continue-on-error: ${{ matrix.continue }}
|
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
run: codecov
|
|
|
|
|
|
|
|
documentation:
|
|
|
|
name: Test docs
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 300
|
|
|
|
- name: Fetch tags
|
|
|
|
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
|
|
- uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
./script/install-dependencies.sh
|
|
|
|
python -m pip install -r docs-requirements.txt
|
|
|
|
- name: Build
|
|
|
|
run: make --directory=docs html
|
|
|
|
|
|
|
|
windows-installer:
|
|
|
|
name: Windows installer
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 300
|
|
|
|
- name: Fetch tags
|
|
|
|
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
|
|
- uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
./script/install-dependencies.sh
|
|
|
|
python -m pip install pynsist==2.4
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install -y nsis imagemagick inkscape
|
2019-10-12 01:43:07 +02:00
|
|
|
- name: Installer file name
|
|
|
|
id: installer
|
|
|
|
run: echo ::set-output name=filename::streamlink-$(python setup.py --version | sed 's/+/_/')
|
2019-10-06 21:47:37 +02:00
|
|
|
- name: Build
|
2019-10-12 01:43:07 +02:00
|
|
|
run: ./script/makeinstaller.sh "${{ steps.installer.outputs.filename }}"
|
|
|
|
- name: Upload artifact
|
|
|
|
if: github.repository == 'streamlink/streamlink' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
|
|
uses: actions/upload-artifact@v2-preview
|
|
|
|
with:
|
|
|
|
name: ${{ steps.installer.outputs.filename }}-win32
|
|
|
|
path: ${{ env.STREAMLINK_DIST_DIR }}/${{ steps.installer.outputs.filename }}.exe
|
|
|
|
|
|
|
|
release:
|
|
|
|
name: New release
|
|
|
|
if: github.repository == 'streamlink/streamlink' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
|
|
needs:
|
|
|
|
- test
|
|
|
|
- documentation
|
|
|
|
- windows-installer
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 300
|
|
|
|
- name: Fetch tags
|
|
|
|
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
|
|
- uses: actions/setup-python@v1
|
|
|
|
with:
|
|
|
|
python-version: 3.8
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
./script/install-dependencies.sh
|
|
|
|
python -m pip install --upgrade wheel twine
|
|
|
|
- name: Installer file name
|
|
|
|
id: installer
|
|
|
|
run: echo ::set-output name=filename::streamlink-$(python setup.py --version | sed 's/+/_/')
|
|
|
|
- name: Download installer artifact
|
|
|
|
uses: actions/download-artifact@v2-preview
|
|
|
|
with:
|
|
|
|
name: ${{ steps.installer.outputs.filename }}-win32
|
|
|
|
path: ${{ env.STREAMLINK_DIST_DIR }}
|
|
|
|
- name: sdist and wheels
|
|
|
|
env:
|
|
|
|
RELEASE_SIGN_KEY: ${{ secrets.RELEASE_SIGN_KEY }}
|
|
|
|
RELEASE_SIGN_IV: ${{ secrets.RELEASE_SIGN_IV }}
|
|
|
|
run: ./script/build-and-sign.sh
|
|
|
|
- name: Github release
|
|
|
|
env:
|
|
|
|
RELEASES_API_KEY: ${{ secrets.RELEASES_API_KEY }}
|
|
|
|
run: ./script/github_releases.py "${STREAMLINK_DIST_DIR}/"*{.exe,.tar.gz{,.asc}}
|
|
|
|
- name: PyPI release
|
|
|
|
env:
|
|
|
|
PYPI_USER: ${{ secrets.PYPI_USER }}
|
|
|
|
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
|
|
run: ./script/deploy-pypi.sh
|