forked from streamlink/streamlink
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (146 loc) · 4.62 KB
/
main.yml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Test, build and deploy
on:
push:
branches-ignore:
- 'automated/**'
tags:
- '**'
pull_request: {}
schedule:
- cron: '0 0 * * *'
env:
STREAMLINK_DIST_DIR: ${{ github.workspace }}/dist
SIGNING_KEY_ID: 2E390FA0
SIGNING_KEY_FILE: ${{ github.workspace }}/signing.key
jobs:
test:
name: Test
strategy:
fail-fast: false
# 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
matrix:
os:
- ubuntu-latest
- windows-latest
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
# include:
# - python: "3.12-dev"
# os: ubuntu-20.04
# continue: true
# - python: "3.12-dev"
# os: windows-latest
# continue: true
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 300
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
continue-on-error: ${{ matrix.continue || false }}
run: bash ./script/install-dependencies.sh
- name: Test
continue-on-error: ${{ matrix.continue || false }}
run: pytest -r a --cov --cov-branch --cov-report=xml --durations 10
- name: Build shell completions
continue-on-error: ${{ matrix.continue || false }}
run: bash ./script/build-shell-completions.sh
- name: Upload coverage data
if: github.event_name != 'schedule'
continue-on-error: ${{ matrix.continue || false }}
uses: codecov/codecov-action@v3
with:
name: os:${{ matrix.os }} py:${{ matrix.python }}
documentation:
name: Test docs
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 300
- name: Fetch tags
run: git fetch --depth=300 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
./script/install-dependencies.sh
python -m pip install -r docs-requirements.txt
- name: Build
run: make --directory=docs html man
deploy-documentation:
name: Deploy docs
if: github.repository == 'streamlink/streamlink' && github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/'))
needs:
- test
- documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 300
- name: Fetch tags
run: git fetch --depth=300 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- 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:
DOCS_DEPLOY_TOKEN: ${{ secrets.DOCS_DEPLOY_TOKEN }}
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
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --depth=300 origin +refs/tags/*:refs/tags/*
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
./script/install-dependencies.sh
python -m pip install -r docs-requirements.txt
python -m pip install --upgrade Jinja2 build wheel twine
- name: Build shell completions
run: ./script/build-shell-completions.sh
- name: Build man page
run: make --directory=docs man
- name: sdist and wheels
env:
RELEASE_KEY_PASSPHRASE: ${{ secrets.RELEASE_KEY_PASSPHRASE }}
run: ./script/build-and-sign.sh
- name: Github release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./script/github-release.py "${STREAMLINK_DIST_DIR}"/*.tar.gz{,.asc}
- name: PyPI release
env:
PYPI_USER: streamlink
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: ./script/deploy-pypi.sh