-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
action.yaml
85 lines (74 loc) · 2.52 KB
/
action.yaml
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
name: 'jprm-build'
description: 'Builds a Jellyfin plugin via Jellyfin Plugin Repository Manager'
author: 'Odd Stråbø'
branding:
icon: package
color: purple
inputs:
path:
required: false
default: '.'
description: 'The path to the sources of the plugin solution (default: ".")'
output:
required: false
default: './artifacts'
description: 'Path to dotnet build directory (default: ./artifacts)'
version:
required: false
default: ''
description: 'Overwrite the detected version of the plugin (default: "")'
dotnet-config:
required: false
default: 'Release'
description: 'The dotnet build configuration (default: Release)'
dotnet-target:
required: false
default: ''
description: 'Overwrite the detected dotnet target framework used for the plugin build (default: "")'
max-cpu-count:
required: false
default: '1'
description: 'Maximum number of processors to use during build (default: "1")'
verbosity:
required: false
default: 'debug'
description: 'The log verbosity of JPRM'
outputs:
artifact:
description: 'Returns the built plugin zip'
value: ${{ steps.build.outputs.artifact }}
runs:
using: composite
steps:
- name: Ensure ouput dir exists
shell: bash
run: |-
echo "::group::Preparing Environment"
mkdir -p ${{ inputs.output }}
- name: Setup JRPM Deps
shell: bash
run: |-
# PEP 668 can burn.
rm -f /usr/lib/python*/EXTERNALLY-MANAGED
python3 -m pip config set global.break-system-packages true
python3 -m pip install -r ${{ github.action_path }}/requirements.txt
echo "::endgroup::"
- id: build
name: Run JPRM build
shell: bash
run: |-
echo "::group::Building and Packaging"
if [[ -n "${{ inputs.dotnet-target }}" ]]; then
DOTNET_FRAMEWORK="--dotnet-framework ${{ inputs.dotnet-target }}"
else
DOTNET_FRAMEWORK=""
fi
if [[ -n "${{ inputs.version }}" ]]; then
PLUGIN_VERSION="-v ${{ inputs.version }}"
else
PLUGIN_VERSION=""
fi
artifact="$(python3 ${{ github.action_path }}/jprm/__init__.py --verbosity=${{ inputs.verbosity }} plugin build ${{ inputs.path }} -o ${{ inputs.output }} ${PLUGIN_VERSION} --dotnet-configuration ${{ inputs.dotnet-config }} --max-cpu-count ${{ inputs.max-cpu-count }} ${DOTNET_FRAMEWORK})"
echo "Artifact: ${artifact}"
echo "artifact=${artifact}" >> $GITHUB_OUTPUT
echo "::endgroup::"