This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (113 loc) · 4.16 KB
/
CI.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
---
name: CI
on:
pull_request:
branches: [master, nightly]
types: [opened, synchronize, reopened]
push:
branches: [master]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check_changelog:
name: Check Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Verify Changelog
id: verify_changelog
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
# base_ref for pull request check, ref for push
uses: LizardByte/.github/actions/verify_changelog@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
outputs:
next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }}
last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }}
release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }}
build:
runs-on: ubuntu-20.04
needs: check_changelog
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: Plugger.bundle
- name: Install Python
uses: LizardByte/action-setup-python
with:
python-version: '2.7'
- name: Set up Python Dependencies
working-directory: Plugger.bundle
run: |
echo "Installing Requirements"
python --version
python -m pip --no-python-version-warning --disable-pip-version-check install --upgrade pip setuptools wheel
# install dev requirements
python -m pip install --upgrade -r requirements-dev.txt
python -m pip install --upgrade --target=./Contents/Libraries/Shared -r \
requirements.txt --no-warn-script-location
- name: Install npm packages
working-directory: Plugger.bundle
run: |
npm install
mv ./node_modules ./Contents/Resources/web
- name: Build plist
working-directory: Plugger.bundle
env:
BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version }}
run: |
python ./scripts/build_plist.py
- name: Test Plex Plugin
working-directory: Plugger.bundle
run: |
python ./Contents/Code/__init__.py
- name: Upload Artifacts
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: Plugger.bundle
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
path: |
${{ github.workspace }}
!**/*.git*
!**/*.pyc
!**/__pycache__
!**/plexhints*
!**/Plugger.bundle/.*
!**/Plugger.bundle/cache.sqlite
!**/Plugger.bundle/DOCKER_README.md
!**/Plugger.bundle/Dockerfile
!**/Plugger.bundle/docs
!**/Plugger.bundle/scripts
!**/Plugger.bundle/tests
- name: Package Release
shell: bash
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
7z \
"-xr!*.git*" \
"-xr!*.pyc" \
"-xr!__pycache__" \
"-xr!plexhints*" \
"-xr!Plugger.bundle/.*" \
"-xr!Plugger.bundle/cache.sqlite" \
"-xr!Plugger.bundle/DOCKER_README.md" \
"-xr!Plugger.bundle/Dockerfile" \
"-xr!Plugger.bundle/docs" \
"-xr!Plugger.bundle/scripts" \
"-xr!Plugger.bundle/tests" \
a "./Plugger.bundle.zip" "Plugger.bundle"
mkdir artifacts
mv ./Plugger.bundle.zip ./artifacts/
- name: Create Release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: LizardByte/.github/actions/create_release@master
with:
token: ${{ secrets.GH_BOT_TOKEN }}
next_version: ${{ needs.check_changelog.outputs.next_version }}
last_version: ${{ needs.check_changelog.outputs.last_version }}
release_body: ${{ needs.check_changelog.outputs.release_body }}