3
3
4
4
on :
5
5
pull_request :
6
- branches : [master]
6
+ branches : [master, dev/standalone] # TODO: remove dev/standalone ... temporarily allow PRs to this branch
7
7
types : [opened, synchronize, reopened]
8
8
push :
9
9
branches : [master]
@@ -37,177 +37,69 @@ jobs:
37
37
build :
38
38
needs :
39
39
- setup_release
40
- runs-on : ubuntu-20.04
40
+ runs-on : ${{ matrix.os }}
41
+ strategy :
42
+ fail-fast : false
43
+ matrix :
44
+ os : [windows-2019, ubuntu-20.04, macos-12]
45
+ architecture : [x64]
46
+ include : # additional runs
47
+ - os : windows-2019
48
+ architecture : x86
41
49
42
50
steps :
43
51
- name : Checkout
44
52
uses : actions/checkout@v4
45
- with :
46
- path : Themerr-plex.bundle
47
- submodules : recursive
48
53
49
- - name : Set up Python
50
- uses :
LizardByte /setup-python[email protected]
54
+ - name : Setup Python
55
+ uses : actions /setup-python@v5
51
56
with :
52
- python-version : ' 2.7'
53
-
54
- - name : Patch third-party deps
55
- if : false # disabled
56
- shell : bash
57
- working-directory : Themerr-plex.bundle/third-party
58
- run : |
59
- patch_dir=${{ github.workspace }}/Themerr-plex.bundle/patches
57
+ python-version : ' 3.12'
58
+ architecture : ${{ matrix.architecture }}
60
59
61
- # youtube-dl patches
62
- pushd youtube-dl
63
- git apply -v "${patch_dir}/youtube_dl-compat.patch"
64
- popd
65
-
66
- - name : Set up Python Dependencies
67
- shell : bash
68
- working-directory : Themerr-plex.bundle
60
+ - name : Setup Python Dependencies
69
61
run : |
70
- echo "Installing Requirements"
71
- python --version
72
- python -m pip --no-python-version-warning --disable-pip-version-check install --upgrade pip setuptools
73
-
74
- # install dev requirements
75
- python -m pip install --upgrade \
76
- -r requirements-build.txt \
77
- -r requirements-dev.txt
78
-
79
- python -m pip install --upgrade --target=./Contents/Libraries/Shared \
80
- -r requirements.txt --no-warn-script-location
62
+ python -m pip install --upgrade pip setuptools wheel
63
+ python -m pip install -r requirements-dev.txt
81
64
82
65
- name : Compile Locale Translations
83
- working-directory : Themerr-plex.bundle
84
66
run : |
85
67
python ./scripts/_locale.py --compile
86
68
87
69
- name : Install npm packages
88
- working-directory : Themerr-plex.bundle
70
+ shell : bash
89
71
run : |
72
+ # install node_modules
90
73
npm install
91
- mv ./node_modules ./Contents/Resources/web
92
74
93
- - name : Build plist
94
- shell : bash
95
- working-directory : Themerr-plex.bundle
96
- env :
97
- BUILD_VERSION : ${{ needs.setup_release.outputs.release_tag }}
75
+ # move node_modules directory to web directory
76
+ mv -f ./node_modules/ ./web/
77
+
78
+ - name : Compile Docs
79
+ working-directory : docs
80
+ run : |
81
+ make html
82
+
83
+ - name : Build pyinstaller package
98
84
run : |
99
- python ./scripts/build_plist .py
85
+ python ./scripts/build .py
100
86
101
87
- name : Package Release
102
- shell : bash
103
88
run : |
104
- 7z \
105
- "-xr!*.git*" \
106
- "-xr!*.pyc" \
107
- "-xr!__pycache__" \
108
- "-xr!plexhints*" \
109
- "-xr!Themerr-plex.bundle/.*" \
110
- "-xr!Themerr-plex.bundle/cache.sqlite" \
111
- "-xr!Themerr-plex.bundle/codecov.yml" \
112
- "-xr!Themerr-plex.bundle/crowdin.yml" \
113
- "-xr!Themerr-plex.bundle/DOCKER_README.md" \
114
- "-xr!Themerr-plex.bundle/Dockerfile" \
115
- "-xr!Themerr-plex.bundle/docs" \
116
- "-xr!Themerr-plex.bundle/patches" \
117
- "-xr!Themerr-plex.bundle/scripts" \
118
- "-xr!Themerr-plex.bundle/tests" \
119
- a "./Themerr-plex.bundle.zip" "Themerr-plex.bundle"
89
+ 7z a "./Themerr-plex_${{ runner.os }}_${{ matrix.architecture }}.zip" "dist"
120
90
121
91
mkdir artifacts
122
- mv ./Themerr-plex.bundle. zip ./artifacts/
92
+ mv " ./Themerr-plex_${{ runner.os }}_${{ matrix.architecture }}. zip" ./artifacts/
123
93
124
94
- name : Upload Artifacts
125
- uses : actions/upload-artifact@v4
95
+ uses : actions/upload-artifact@v4 # https://github.com/actions/upload-artifact
126
96
with :
127
- name : Themerr-plex.bundle
97
+ name : Themerr-plex_${{ runner.os }}_${{ matrix.architecture }}
128
98
if-no-files-found : error # 'warn' or 'ignore' are also available, defaults to `warn`
129
99
path : |
130
100
${{ github.workspace }}/artifacts
131
101
132
- - name : Create/Update GitHub Release
133
- if : ${{ needs.setup_release.outputs.publish_release == 'true' }}
134
- uses :
LizardByte/[email protected]
135
- with :
136
- allowUpdates : true
137
- body : ${{ needs.setup_release.outputs.release_body }}
138
- discussionCategory : announcements
139
- generateReleaseNotes : ${{ needs.setup_release.outputs.release_generate_release_notes }}
140
- name : ${{ needs.setup_release.outputs.release_tag }}
141
- prerelease : true
142
- tag : ${{ needs.setup_release.outputs.release_tag }}
143
- token : ${{ secrets.GH_BOT_TOKEN }}
144
-
145
- pytest :
146
- needs : [build]
147
- strategy :
148
- fail-fast : false
149
- matrix :
150
- os : [windows-latest, ubuntu-latest, macos-latest]
151
-
152
- runs-on : ${{ matrix.os }}
153
- steps :
154
- - name : Checkout
155
- uses : actions/checkout@v4
156
-
157
- - name : Download artifacts
158
- uses : actions/download-artifact@v4
159
- with :
160
- name : Themerr-plex.bundle
161
-
162
- - name : Extract artifacts zip
163
- shell : bash
164
- run : |
165
- # extract zip
166
- 7z x Themerr-plex.bundle.zip -o.
167
-
168
- # move all files from "Themerr-plex.bundle" to root, with no target directory
169
- cp -r ./Themerr-plex.bundle/. .
170
-
171
- # remove zip
172
- rm Themerr-plex.bundle.zip
173
-
174
- - name : Set up Python
175
- uses :
LizardByte/[email protected]
176
- with :
177
- python-version : ' 2.7'
178
-
179
- - name : Bootstrap Plex server
180
- env :
181
- PLEXAPI_PLEXAPI_TIMEOUT : " 60"
182
- id : bootstrap
183
- uses :
LizardByte/[email protected]
184
- with :
185
- additional_server_queries : >-
186
- put|/system/agents/com.plexapp.agents.imdb/config/1?order=com.plexapp.agents.imdb%2Cdev.lizardbyte.themerr-plex
187
- put|/system/agents/com.plexapp.agents.themoviedb/config/1?order=com.plexapp.agents.themoviedb%2Cdev.lizardbyte.themerr-plex
188
- put|/system/agents/com.plexapp.agents.themoviedb/config/2?order=com.plexapp.agents.themoviedb%2Cdev.lizardbyte.themerr-plex
189
- put|/system/agents/com.plexapp.agents.thetvdb/config/2?order=com.plexapp.agents.thetvdb%2Cdev.lizardbyte.themerr-plex
190
- get|/:/plugins/dev.lizardbyte.themerr-plex/prefs/set?bool_overwrite_plex_provided_themes=true
191
- plugin_bundles_to_install : >-
192
- Themerr-plex.bundle
193
- without_music : true
194
- without_photos : true
195
-
196
- - name : Install python dependencies
197
- shell : bash
198
- run : |
199
- python -m pip --no-python-version-warning --disable-pip-version-check install --upgrade \
200
- pip setuptools wheel
201
- python -m pip --no-python-version-warning --disable-pip-version-check install --no-build-isolation \
202
- -r requirements-dev.txt
203
-
204
102
- name : Test with pytest
205
- env :
206
- PLEX_PLUGIN_LOG_PATH : ${{ steps.bootstrap.outputs.PLEX_PLUGIN_LOG_PATH }}
207
- PLEXAPI_AUTH_SERVER_BASEURL : ${{ steps.bootstrap.outputs.PLEX_SERVER_BASEURL }}
208
- PLEXAPI_AUTH_SERVER_TOKEN : ${{ steps.bootstrap.outputs.PLEXTOKEN }}
209
- PLEXAPI_PLEXAPI_TIMEOUT : " 60"
210
- PLEXTOKEN : ${{ steps.bootstrap.outputs.PLEXTOKEN }}
211
103
id : test
212
104
shell : bash
213
105
run : |
@@ -216,30 +108,26 @@ jobs:
216
108
--tb=native \
217
109
--verbose \
218
110
--color=yes \
219
- --cov=Contents/Code \
111
+ --cov=src \
220
112
tests
221
113
222
- - name : Debug log file
223
- if : always()
224
- shell : bash
225
- run : |
226
- echo "Debugging log file"
227
- if [[ "${{ runner.os }}" == "Windows" ]]; then
228
- log_file=$(cygpath.exe -u \
229
- "${{ steps.bootstrap.outputs.PLEX_PLUGIN_LOG_PATH }}/dev.lizardbyte.themerr-plex.log")
230
- else
231
- log_file="${{ steps.bootstrap.outputs.PLEX_PLUGIN_LOG_PATH }}/dev.lizardbyte.themerr-plex.log"
232
- fi
233
- cat "${log_file}"
234
-
235
114
- name : Upload coverage
236
- # any except canceled or skipped
237
- if : >-
238
- always() &&
239
- (steps.test.outcome == 'success' || steps.test.outcome == 'failure') &&
240
- startsWith(github.repository, 'LizardByte/')
241
115
uses : codecov/codecov-action@v4
242
116
with :
243
117
fail_ci_if_error : true
244
- flags : ${{ runner.os }}
118
+ flags : " ${{ runner.os }}-${{ matrix.architecture }} "
245
119
token : ${{ secrets.CODECOV_TOKEN }}
120
+ verbose : true
121
+
122
+ - name : Create/Update GitHub Release
123
+ if : ${{ needs.setup_release.outputs.publish_release == 'true' }}
124
+ uses :
LizardByte/[email protected]
125
+ with :
126
+ allowUpdates : true
127
+ body : ${{ needs.setup_release.outputs.release_body }}
128
+ discussionCategory : announcements
129
+ generateReleaseNotes : ${{ needs.setup_release.outputs.release_generate_release_notes }}
130
+ name : ${{ needs.setup_release.outputs.release_tag }}
131
+ prerelease : true
132
+ tag : ${{ needs.setup_release.outputs.release_tag }}
133
+ token : ${{ secrets.GH_BOT_TOKEN }}
0 commit comments