2019-10-06 21:47:37 +02:00
|
|
|
name: Test, build and deploy
|
|
|
|
|
|
|
|
on:
|
2022-06-03 03:50:52 +02:00
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- 'automated/**'
|
2022-07-09 05:07:44 +02:00
|
|
|
tags:
|
|
|
|
- '**'
|
2020-03-17 20:24:42 +01:00
|
|
|
pull_request: {}
|
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *'
|
2019-10-06 21:47:37 +02:00
|
|
|
|
|
|
|
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
|
2020-09-25 03:19:06 +02:00
|
|
|
# please remember to change the `codecov.notify.after_n_builds` value in .codecov.yml
|
|
|
|
# when changing the build matrix and changing the number of test runners
|
2019-10-06 21:47:37 +02:00
|
|
|
matrix:
|
2021-10-05 15:06:12 +02:00
|
|
|
os:
|
|
|
|
- ubuntu-20.04
|
|
|
|
- windows-latest
|
|
|
|
python:
|
|
|
|
- "3.7"
|
|
|
|
- "3.8"
|
|
|
|
- "3.9"
|
|
|
|
- "3.10"
|
2022-10-29 05:58:35 +02:00
|
|
|
- "3.11"
|
|
|
|
# include:
|
|
|
|
# - python: "3.12-dev"
|
|
|
|
# os: ubuntu-20.04
|
|
|
|
# continue: true
|
|
|
|
# - python: "3.12-dev"
|
|
|
|
# os: windows-latest
|
|
|
|
# continue: true
|
2019-10-06 21:47:37 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
2022-09-23 02:16:40 +02:00
|
|
|
- uses: actions/checkout@v3
|
2021-02-08 13:27:06 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 300
|
2022-09-23 02:16:40 +02:00
|
|
|
- uses: actions/setup-python@v4
|
2019-10-06 21:47:37 +02:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
- name: Install dependencies
|
2020-04-07 14:34:37 +02:00
|
|
|
continue-on-error: ${{ matrix.continue || false }}
|
2019-10-06 21:47:37 +02:00
|
|
|
run: bash ./script/install-dependencies.sh
|
|
|
|
- name: Test
|
2020-04-07 14:34:37 +02:00
|
|
|
continue-on-error: ${{ matrix.continue || false }}
|
2021-08-22 10:45:00 +02:00
|
|
|
run: pytest -r a --cov --cov-branch --cov-report=xml --durations 10
|
2021-09-25 12:35:43 +02:00
|
|
|
- name: Build shell completions
|
2022-05-24 21:05:07 +02:00
|
|
|
continue-on-error: ${{ matrix.continue || false }}
|
2021-09-25 12:35:43 +02:00
|
|
|
run: bash ./script/build-shell-completions.sh
|
2019-10-06 21:47:37 +02:00
|
|
|
- name: Upload coverage data
|
2020-07-04 18:59:41 +02:00
|
|
|
if: github.event_name != 'schedule'
|
2020-04-07 14:34:37 +02:00
|
|
|
continue-on-error: ${{ matrix.continue || false }}
|
2022-09-23 02:16:40 +02:00
|
|
|
uses: codecov/codecov-action@v3
|
2020-04-28 17:55:15 +02:00
|
|
|
with:
|
|
|
|
name: os:${{ matrix.os }} py:${{ matrix.python }}
|
2019-10-06 21:47:37 +02:00
|
|
|
|
|
|
|
documentation:
|
|
|
|
name: Test docs
|
2020-06-13 09:41:24 +02:00
|
|
|
if: github.event_name != 'schedule'
|
2020-10-31 14:32:34 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2019-10-06 21:47:37 +02:00
|
|
|
steps:
|
2022-09-23 02:16:40 +02:00
|
|
|
- uses: actions/checkout@v3
|
2019-10-06 21:47:37 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 300
|
|
|
|
- name: Fetch tags
|
2020-04-28 17:55:15 +02:00
|
|
|
run: git fetch --depth=300 origin +refs/tags/*:refs/tags/*
|
2022-09-23 02:16:40 +02:00
|
|
|
- uses: actions/setup-python@v4
|
2019-10-06 21:47:37 +02:00
|
|
|
with:
|
2022-09-23 02:16:40 +02:00
|
|
|
python-version: "3.10"
|
2019-10-06 21:47:37 +02:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
./script/install-dependencies.sh
|
|
|
|
python -m pip install -r docs-requirements.txt
|
|
|
|
- name: Build
|
2021-09-25 12:35:43 +02:00
|
|
|
run: make --directory=docs html man
|
2019-10-06 21:47:37 +02:00
|
|
|
|
2020-03-18 02:45:13 +01:00
|
|
|
deploy-documentation:
|
|
|
|
name: Deploy docs
|
|
|
|
if: github.repository == 'streamlink/streamlink' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
|
2019-10-12 01:43:07 +02:00
|
|
|
needs:
|
|
|
|
- test
|
|
|
|
- documentation
|
2020-10-31 14:32:34 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2020-03-18 02:45:13 +01:00
|
|
|
steps:
|
2022-06-14 05:11:44 +02:00
|
|
|
- uses: actions/checkout@v3
|
2020-03-18 02:45:13 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 300
|
|
|
|
- name: Fetch tags
|
2020-04-28 17:55:15 +02:00
|
|
|
run: git fetch --depth=300 origin +refs/tags/*:refs/tags/*
|
2022-06-14 05:11:44 +02:00
|
|
|
- uses: actions/setup-python@v4
|
2020-03-18 02:45:13 +01:00
|
|
|
with:
|
2022-06-14 05:11:44 +02:00
|
|
|
python-version: "3.10"
|
2020-03-18 02:45:13 +01:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
./script/install-dependencies.sh
|
|
|
|
python -m pip install -r docs-requirements.txt
|
|
|
|
- name: Build
|
|
|
|
run: make --directory=docs html
|
|
|
|
- name: Deploy
|
|
|
|
env:
|
2022-06-14 05:11:44 +02:00
|
|
|
DOCS_DEPLOY_TOKEN: ${{ secrets.DOCS_DEPLOY_TOKEN }}
|
2020-03-18 02:45:13 +01:00
|
|
|
run: ./script/deploy-docs.sh
|
|
|
|
|
|
|
|
release:
|
|
|
|
name: New release
|
|
|
|
if: github.repository == 'streamlink/streamlink' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
|
|
needs:
|
|
|
|
- deploy-documentation
|
2020-10-31 14:32:34 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2022-05-02 06:52:58 +02:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2019-10-12 01:43:07 +02:00
|
|
|
steps:
|
2022-09-23 02:16:40 +02:00
|
|
|
- uses: actions/checkout@v3
|
2019-10-12 01:43:07 +02:00
|
|
|
with:
|
2022-04-29 05:53:59 +02:00
|
|
|
fetch-depth: 0
|
2019-10-12 01:43:07 +02:00
|
|
|
- name: Fetch tags
|
2020-04-28 17:55:15 +02:00
|
|
|
run: git fetch --depth=300 origin +refs/tags/*:refs/tags/*
|
2022-09-23 02:16:40 +02:00
|
|
|
- uses: actions/setup-python@v4
|
2019-10-12 01:43:07 +02:00
|
|
|
with:
|
2022-04-29 05:53:59 +02:00
|
|
|
python-version: "3.10"
|
2019-10-12 01:43:07 +02:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
./script/install-dependencies.sh
|
2020-12-28 12:35:51 +01:00
|
|
|
python -m pip install -r docs-requirements.txt
|
2022-04-29 05:53:59 +02:00
|
|
|
python -m pip install --upgrade Jinja2 wheel twine
|
2021-09-25 12:35:43 +02:00
|
|
|
- name: Build shell completions
|
|
|
|
run: ./script/build-shell-completions.sh
|
2020-12-28 12:35:51 +01:00
|
|
|
- name: Build man page
|
|
|
|
run: make --directory=docs man
|
2019-10-12 01:43:07 +02:00
|
|
|
- name: sdist and wheels
|
|
|
|
env:
|
2020-04-01 16:45:45 +02:00
|
|
|
RELEASE_KEY_PASSPHRASE: ${{ secrets.RELEASE_KEY_PASSPHRASE }}
|
2019-10-12 01:43:07 +02:00
|
|
|
run: ./script/build-and-sign.sh
|
|
|
|
- name: Github release
|
|
|
|
env:
|
2022-05-02 06:52:58 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-05-02 06:46:40 +02:00
|
|
|
run: ./script/github-release.py "${STREAMLINK_DIST_DIR}"/*.tar.gz{,.asc}
|
2019-10-12 01:43:07 +02:00
|
|
|
- name: PyPI release
|
|
|
|
env:
|
2020-04-21 03:05:40 +02:00
|
|
|
PYPI_USER: streamlink
|
2019-10-12 01:43:07 +02:00
|
|
|
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
|
|
run: ./script/deploy-pypi.sh
|