Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Commit 640b134

Browse files
ci: use prerelease logic (#172)
1 parent 889efab commit 640b134

8 files changed

Lines changed: 110 additions & 92 deletions

File tree

.github/workflows/CI.yml

Lines changed: 79 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,16 @@ on:
1010
workflow_dispatch:
1111

1212
concurrency:
13-
group: ${{ github.workflow }}-${{ github.ref }}
13+
group: "${{ github.workflow }}-${{ github.ref }}"
1414
cancel-in-progress: true
1515

1616
jobs:
1717
setup_release:
1818
name: Setup Release
1919
outputs:
20-
changelog_changes: ${{ steps.setup_release.outputs.changelog_changes }}
21-
changelog_date: ${{ steps.setup_release.outputs.changelog_date }}
22-
changelog_exists: ${{ steps.setup_release.outputs.changelog_exists }}
23-
changelog_release_exists: ${{ steps.setup_release.outputs.changelog_release_exists }}
24-
changelog_url: ${{ steps.setup_release.outputs.changelog_url }}
25-
changelog_version: ${{ steps.setup_release.outputs.changelog_version }}
26-
publish_pre_release: ${{ steps.setup_release.outputs.publish_pre_release }}
2720
publish_release: ${{ steps.setup_release.outputs.publish_release }}
28-
publish_stable_release: ${{ steps.setup_release.outputs.publish_stable_release }}
29-
release_body: ${{ steps.setup_release.outputs.release_body }}
3021
release_build: ${{ steps.setup_release.outputs.release_build }}
3122
release_commit: ${{ steps.setup_release.outputs.release_commit }}
32-
release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }}
3323
release_tag: ${{ steps.setup_release.outputs.release_tag }}
3424
release_version: ${{ steps.setup_release.outputs.release_version }}
3525
runs-on: ubuntu-latest
@@ -39,7 +29,7 @@ jobs:
3929

4030
- name: Setup Release
4131
id: setup_release
42-
uses: LizardByte/setup-release-action@v2023.1210.1904
32+
uses: LizardByte/setup-release-action@v2024.520.193857
4333
with:
4434
github_token: ${{ secrets.GITHUB_TOKEN }}
4535

@@ -54,8 +44,8 @@ jobs:
5444
with:
5545
path: Plugger.bundle
5646

57-
- name: Install Python
58-
uses: LizardByte/setup-python-action@v2023.1210.35516
47+
- name: Set up Python
48+
uses: LizardByte/setup-python-action@v2024.515.10401
5949
with:
6050
python-version: '2.7'
6151

@@ -73,25 +63,25 @@ jobs:
7363
python -m pip install --upgrade --target=./Contents/Libraries/Shared -r \
7464
requirements.txt --no-warn-script-location
7565
66+
- name: Compile Locale Translations
67+
working-directory: Plugger.bundle
68+
run: |
69+
python ./scripts/_locale.py --compile
70+
7671
- name: Install npm packages
7772
working-directory: Plugger.bundle
7873
run: |
7974
npm install
8075
mv ./node_modules ./Contents/Resources/web
8176
8277
- name: Build plist
78+
shell: bash
8379
working-directory: Plugger.bundle
8480
env:
8581
BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }}
8682
run: |
8783
python ./scripts/build_plist.py
8884
89-
- name: Test Plex Plugin
90-
# todo - replace with pytest
91-
working-directory: Plugger.bundle
92-
run: |
93-
python ./Contents/Code/__init__.py
94-
9585
- name: Package Release
9686
shell: bash
9787
run: |
@@ -102,6 +92,8 @@ jobs:
10292
"-xr!plexhints*" \
10393
"-xr!Plugger.bundle/.*" \
10494
"-xr!Plugger.bundle/cache.sqlite" \
95+
"-xr!Plugger.bundle/codecov.yml" \
96+
"-xr!Plugger.bundle/crowdin.yml" \
10597
"-xr!Plugger.bundle/DOCKER_README.md" \
10698
"-xr!Plugger.bundle/Dockerfile" \
10799
"-xr!Plugger.bundle/docs" \
@@ -122,14 +114,77 @@ jobs:
122114
123115
- name: Create/Update GitHub Release
124116
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
125-
uses: LizardByte/create-release-action@v2023.1210.832
117+
uses: LizardByte/create-release-action@v2024.520.193838
126118
with:
127119
allowUpdates: true
128-
body: ''
129120
discussionCategory: announcements
130121
generateReleaseNotes: true
131122
name: ${{ needs.setup_release.outputs.release_tag }}
132-
# use pre-release for now
133-
prerelease: true # ${{ needs.setup_release.outputs.publish_pre_release }}
123+
prerelease: true
134124
tag: ${{ needs.setup_release.outputs.release_tag }}
135125
token: ${{ secrets.GH_BOT_TOKEN }}
126+
127+
pytest:
128+
needs: [build]
129+
strategy:
130+
fail-fast: false
131+
matrix:
132+
os: [windows-latest, ubuntu-latest, macos-latest]
133+
134+
runs-on: ${{ matrix.os }}
135+
steps:
136+
- name: Checkout
137+
uses: actions/checkout@v4
138+
139+
- name: Download artifacts
140+
uses: actions/download-artifact@v4
141+
with:
142+
name: Plugger.bundle
143+
144+
- name: Extract artifacts zip
145+
shell: bash
146+
run: |
147+
# extract zip
148+
7z x Plugger.bundle.zip -o.
149+
150+
# move all files from "Plugger.bundle" to root, with no target directory
151+
cp -r ./Plugger.bundle/. .
152+
153+
# remove zip
154+
rm Plugger.bundle.zip
155+
156+
- name: Set up Python
157+
uses: LizardByte/setup-python-action@v2024.515.10401
158+
with:
159+
python-version: '2.7'
160+
161+
- name: Install python dependencies
162+
shell: bash
163+
run: |
164+
python -m pip --no-python-version-warning --disable-pip-version-check install --upgrade \
165+
pip setuptools wheel
166+
python -m pip --no-python-version-warning --disable-pip-version-check install --no-build-isolation \
167+
-r requirements-dev.txt
168+
169+
- name: Test with pytest
170+
id: test
171+
shell: bash
172+
run: |
173+
python -m pytest \
174+
-rxXs \
175+
--tb=native \
176+
--verbose \
177+
--cov=Contents/Code \
178+
tests
179+
180+
- name: Upload coverage
181+
# any except canceled or skipped
182+
if: >-
183+
always() &&
184+
(steps.test.outcome == 'success' || steps.test.outcome == 'failure') &&
185+
startsWith(github.repository, 'LizardByte/')
186+
uses: codecov/codecov-action@v4
187+
with:
188+
fail_ci_if_error: true
189+
flags: ${{ runner.os }}
190+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/ci-docker.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
workflow_dispatch:
3030

3131
concurrency:
32-
group: ${{ github.workflow }}-${{ github.ref }}
32+
group: "${{ github.workflow }}-${{ github.ref }}"
3333
cancel-in-progress: true
3434

3535
jobs:
@@ -102,19 +102,9 @@ jobs:
102102
needs:
103103
- check_dockerfiles
104104
outputs:
105-
changelog_changes: ${{ steps.setup_release.outputs.changelog_changes }}
106-
changelog_date: ${{ steps.setup_release.outputs.changelog_date }}
107-
changelog_exists: ${{ steps.setup_release.outputs.changelog_exists }}
108-
changelog_release_exists: ${{ steps.setup_release.outputs.changelog_release_exists }}
109-
changelog_url: ${{ steps.setup_release.outputs.changelog_url }}
110-
changelog_version: ${{ steps.setup_release.outputs.changelog_version }}
111-
publish_pre_release: ${{ steps.setup_release.outputs.publish_pre_release }}
112105
publish_release: ${{ steps.setup_release.outputs.publish_release }}
113-
publish_stable_release: ${{ steps.setup_release.outputs.publish_stable_release }}
114-
release_body: ${{ steps.setup_release.outputs.release_body }}
115106
release_build: ${{ steps.setup_release.outputs.release_build }}
116107
release_commit: ${{ steps.setup_release.outputs.release_commit }}
117-
release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }}
118108
release_tag: ${{ steps.setup_release.outputs.release_tag }}
119109
release_version: ${{ steps.setup_release.outputs.release_version }}
120110
runs-on: ubuntu-latest
@@ -124,7 +114,7 @@ jobs:
124114

125115
- name: Setup Release
126116
id: setup_release
127-
uses: LizardByte/setup-release-action@v2023.1210.1904
117+
uses: LizardByte/setup-release-action@v2024.520.181643
128118
with:
129119
dotnet: ${{ needs.check_dockerfiles.outputs.dotnet }}
130120
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -171,7 +161,7 @@ jobs:
171161

172162
steps:
173163
- name: Maximize build space
174-
uses: easimon/maximize-build-space@v8
164+
uses: easimon/maximize-build-space@v10
175165
with:
176166
root-reserve-mb: 30720 # https://github.com/easimon/maximize-build-space#caveats
177167
remove-dotnet: 'true'
@@ -287,7 +277,7 @@ jobs:
287277
id: buildx
288278

289279
- name: Cache Docker Layers
290-
uses: actions/cache@v3
280+
uses: actions/cache@v4
291281
with:
292282
path: /tmp/.buildx-cache
293283
key: Docker-buildx${{ matrix.tag }}-${{ github.sha }}
@@ -373,21 +363,20 @@ jobs:
373363

374364
- name: Create/Update GitHub Release
375365
if: ${{ needs.setup_release.outputs.publish_release == 'true' && steps.prepare.outputs.artifacts == 'true' }}
376-
uses: LizardByte/create-release-action@v2023.1210.832
366+
uses: LizardByte/create-release-action@v2024.520.180003
377367
with:
378368
allowUpdates: true
379369
artifacts: "*artifacts/*"
380-
body: ''
381370
discussionCategory: announcements
382371
generateReleaseNotes: true
383372
name: ${{ needs.setup_release.outputs.release_tag }}
384-
prerelease: ${{ needs.setup_release.outputs.publish_pre_release }}
373+
prerelease: true
385374
tag: ${{ needs.setup_release.outputs.release_tag }}
386375
token: ${{ secrets.GH_BOT_TOKEN }}
387376

388377
- name: Update Docker Hub Description
389378
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
390-
uses: peter-evans/dockerhub-description@v3
379+
uses: peter-evans/dockerhub-description@v4
391380
with:
392381
username: ${{ secrets.DOCKER_HUB_USERNAME }}
393382
password: ${{ secrets.DOCKER_HUB_PASSWORD }} # token is not currently supported

.github/workflows/python-tests.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

DOCKER_README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### lizardbyte/plugger
22

33
This is a [docker-mod](https://linuxserver.github.io/docker-mods/) for
4-
[plex](https://hub.docker.com/r/linuxserver/plex) which adds
4+
[plex](https://hub.docker.com/r/linuxserver/plex) that adds
55
[Plugger](https://github.com/LizardByte/Plugger) to plex as a plugin,
66
to be downloaded/updated during container start.
77

@@ -17,13 +17,5 @@ If adding multiple mods, enter them in an array separated by `|`, such as
1717

1818
### Supported Architectures
1919

20-
Specifying `lizardbyte/plugger:latest` or `ghcr.io/lizardbyte/plugger:latest`
21-
should retrieve the correct image for your architecture.
22-
23-
The architectures supported by this image are:
24-
25-
| Architecture | Available |
26-
|:------------:|:---------:|
27-
| x86-64 ||
28-
| arm64 ||
29-
| armhf ||
20+
Linuxserver.io docker mods do not support multi-arch images; however this image should run on any architecture. If
21+
you have issues with this image on a specific architecture, please open an issue on GitHub.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1.4
22
# artifacts: false
3-
# platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
3+
# platforms: linux/amd64
44
FROM ubuntu:22.04 AS buildstage
55

66
# build args

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Integrations
2828
:alt: Read the Docs
2929
:target: http://plugger.readthedocs.io/
3030

31+
.. image:: https://img.shields.io/codecov/c/gh/LizardByte/Plugger?token=LID1Y7IEKI&style=for-the-badge&logo=codecov&label=codecov
32+
:alt: Codecov
33+
:target: https://codecov.io/gh/LizardByte/Plugger
34+
3135
Downloads
3236
---------
3337

codecov.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
codecov:
3+
branch: master
4+
5+
coverage:
6+
status:
7+
project:
8+
default:
9+
target: auto
10+
threshold: 10%
11+
12+
comment:
13+
layout: "diff, flags, files"
14+
behavior: default
15+
require_changes: false # if true: only post the comment if coverage changes

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ m2r2==0.3.2;python_version<"3"
44
numpydoc==0.9.2;python_version<"3"
55
plexhints==2024.129.31313 # type hinting library for plex development
66
pytest==4.6.11;python_version<"3"
7+
pytest-cov==2.12.1;python_version<"3"
78
rstcheck==3.5.0;python_version<"3"
89
Sphinx==1.8.6;python_version<"3"
910
sphinx-rtd-theme==1.2.0;python_version<"3"

0 commit comments

Comments
 (0)