33
44on :
55 pull_request :
6- branches : [master]
6+ branches : [master, dev/standalone] # TODO: remove dev/standalone ... temporarily allow PRs to this branch
77 types : [opened, synchronize, reopened]
88 push :
99 branches : [master]
@@ -37,176 +37,69 @@ jobs:
3737 build :
3838 needs :
3939 - 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
4149
4250 steps :
4351 - name : Checkout
4452 uses : actions/checkout@v4
45- with :
46- path : Themerr-plex.bundle
47- submodules : recursive
4853
49- - name : Set up Python
50- uses : LizardByte /setup-python-action@v2024.609.5111
54+ - name : Setup Python
55+ uses : actions /setup-python@v5
5156 with :
52- python-version : ' 2.7'
57+ python-version : ' 3.12'
58+ architecture : ${{ matrix.architecture }}
5359
54- - name : Patch third-party deps
55- if : false # disabled
56- shell : bash
57- working-directory : Themerr-plex.bundle/third-party
60+ - name : Setup Python Dependencies
5861 run : |
59- patch_dir=${{ github.workspace }}/Themerr-plex.bundle/patches
60-
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
69- 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
8164
8265 - name : Compile Locale Translations
83- working-directory : Themerr-plex.bundle
8466 run : |
8567 python ./scripts/_locale.py --compile
8668
8769 - name : Install npm packages
88- working-directory : Themerr-plex.bundle
70+ shell : bash
8971 run : |
72+ # install node_modules
9073 npm install
91- mv ./node_modules ./Contents/Resources/web
9274
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
9884 run : |
99- python ./scripts/build_plist .py
85+ python ./scripts/build .py
10086
10187 - name : Package Release
102- shell : bash
10388 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"
12090
12191 mkdir artifacts
122- mv ./Themerr-plex.bundle. zip ./artifacts/
92+ mv " ./Themerr-plex_${{ runner.os }}_${{ matrix.architecture }}. zip" ./artifacts/
12393
12494 - name : Upload Artifacts
125- uses : actions/upload-artifact@v4
95+ uses : actions/upload-artifact@v4 # https://github.com/actions/upload-artifact
12696 with :
127- name : Themerr-plex.bundle
97+ name : Themerr-plex_${{ runner.os }}_${{ matrix.architecture }}
12898 if-no-files-found : error # 'warn' or 'ignore' are also available, defaults to `warn`
12999 path : |
130100 ${{ github.workspace }}/artifacts
131101
132- - name : Create/Update GitHub Release
133- if : ${{ needs.setup_release.outputs.publish_release == 'true' }}
134- uses : LizardByte/create-release-action@v2024.919.143026
135- with :
136- allowUpdates : true
137- body : ${{ needs.setup_release.outputs.release_body }}
138- generateReleaseNotes : ${{ needs.setup_release.outputs.release_generate_release_notes }}
139- name : ${{ needs.setup_release.outputs.release_tag }}
140- prerelease : true
141- tag : ${{ needs.setup_release.outputs.release_tag }}
142- token : ${{ secrets.GH_BOT_TOKEN }}
143-
144- pytest :
145- needs : [build]
146- strategy :
147- fail-fast : false
148- matrix :
149- os : [windows-latest, ubuntu-latest, macos-latest]
150-
151- runs-on : ${{ matrix.os }}
152- steps :
153- - name : Checkout
154- uses : actions/checkout@v4
155-
156- - name : Download artifacts
157- uses : actions/download-artifact@v4
158- with :
159- name : Themerr-plex.bundle
160-
161- - name : Extract artifacts zip
162- shell : bash
163- run : |
164- # extract zip
165- 7z x Themerr-plex.bundle.zip -o.
166-
167- # move all files from "Themerr-plex.bundle" to root, with no target directory
168- cp -r ./Themerr-plex.bundle/. .
169-
170- # remove zip
171- rm Themerr-plex.bundle.zip
172-
173- - name : Set up Python
174- uses : LizardByte/setup-python-action@v2024.609.5111
175- with :
176- python-version : ' 2.7'
177-
178- - name : Bootstrap Plex server
179- env :
180- PLEXAPI_PLEXAPI_TIMEOUT : " 60"
181- id : bootstrap
182- uses : LizardByte/plexhints@v2024.809.14117
183- with :
184- additional_server_queries : >-
185- put|/system/agents/com.plexapp.agents.imdb/config/1?order=com.plexapp.agents.imdb%2Cdev.lizardbyte.themerr-plex
186- put|/system/agents/com.plexapp.agents.themoviedb/config/1?order=com.plexapp.agents.themoviedb%2Cdev.lizardbyte.themerr-plex
187- put|/system/agents/com.plexapp.agents.themoviedb/config/2?order=com.plexapp.agents.themoviedb%2Cdev.lizardbyte.themerr-plex
188- put|/system/agents/com.plexapp.agents.thetvdb/config/2?order=com.plexapp.agents.thetvdb%2Cdev.lizardbyte.themerr-plex
189- get|/:/plugins/dev.lizardbyte.themerr-plex/prefs/set?bool_overwrite_plex_provided_themes=true
190- plugin_bundles_to_install : >-
191- Themerr-plex.bundle
192- without_music : true
193- without_photos : true
194-
195- - name : Install python dependencies
196- shell : bash
197- run : |
198- python -m pip --no-python-version-warning --disable-pip-version-check install --upgrade \
199- pip setuptools wheel
200- python -m pip --no-python-version-warning --disable-pip-version-check install --no-build-isolation \
201- -r requirements-dev.txt
202-
203102 - name : Test with pytest
204- env :
205- PLEX_PLUGIN_LOG_PATH : ${{ steps.bootstrap.outputs.PLEX_PLUGIN_LOG_PATH }}
206- PLEXAPI_AUTH_SERVER_BASEURL : ${{ steps.bootstrap.outputs.PLEX_SERVER_BASEURL }}
207- PLEXAPI_AUTH_SERVER_TOKEN : ${{ steps.bootstrap.outputs.PLEXTOKEN }}
208- PLEXAPI_PLEXAPI_TIMEOUT : " 60"
209- PLEXTOKEN : ${{ steps.bootstrap.outputs.PLEXTOKEN }}
210103 id : test
211104 shell : bash
212105 run : |
@@ -215,30 +108,25 @@ jobs:
215108 --tb=native \
216109 --verbose \
217110 --color=yes \
218- --cov=Contents/Code \
111+ --cov=src \
219112 tests
220113
221- - name : Debug log file
222- if : always()
223- shell : bash
224- run : |
225- echo "Debugging log file"
226- if [[ "${{ runner.os }}" == "Windows" ]]; then
227- log_file=$(cygpath.exe -u \
228- "${{ steps.bootstrap.outputs.PLEX_PLUGIN_LOG_PATH }}/dev.lizardbyte.themerr-plex.log")
229- else
230- log_file="${{ steps.bootstrap.outputs.PLEX_PLUGIN_LOG_PATH }}/dev.lizardbyte.themerr-plex.log"
231- fi
232- cat "${log_file}"
233-
234114 - name : Upload coverage
235- # any except canceled or skipped
236- if : >-
237- always() &&
238- (steps.test.outcome == 'success' || steps.test.outcome == 'failure') &&
239- startsWith(github.repository, 'LizardByte/')
240115 uses : codecov/codecov-action@v4
241116 with :
242117 fail_ci_if_error : true
243- flags : ${{ runner.os }}
118+ flags : " ${{ runner.os }}-${{ matrix.architecture }} "
244119 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/create-release-action@v2024.919.143026
125+ with :
126+ allowUpdates : true
127+ body : ${{ needs.setup_release.outputs.release_body }}
128+ generateReleaseNotes : ${{ needs.setup_release.outputs.release_generate_release_notes }}
129+ name : ${{ needs.setup_release.outputs.release_tag }}
130+ prerelease : true
131+ tag : ${{ needs.setup_release.outputs.release_tag }}
132+ token : ${{ secrets.GH_BOT_TOKEN }}
0 commit comments