-
Notifications
You must be signed in to change notification settings - Fork 4
206 lines (179 loc) · 5.99 KB
/
build.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: Build / Titan Extended
on:
push:
# On Push to Master branch
branches:
- master
# Ignore all Tags / Release
tags-ignore:
- '**'
paths:
- '**.xmp2'
workflow_call:
outputs:
version:
description: "MPE1 Version"
value: ${{ jobs.build.outputs.version }}
jobs:
build:
name: Titan Extended / Build
runs-on: windows-2019
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Git Checkout / MPE / XPath / Tools
uses: actions/checkout@v4
with:
repository: andrewjswan/MPE
path: MPE
- name: MP folder for MPEMaker
run: |
mkdir "C:\Team MediaPortal"
shell: cmd
- name: Link to MPEMaker
run: |
mklink /J "C:\Team MediaPortal\MediaPortal" "${{ github.workspace }}\MPE\MPEMaker"
shell: cmd
- name: Update Known Extensions
run: |
MPEUpdater.exe
working-directory: ${{ github.workspace }}\MPE\MPEMaker
shell: cmd
- name: Clear Build folder
run: |
del /F /Q *.*
working-directory: ${{ github.workspace }}\builds
shell: cmd
- name: Build MPE1
run: |
Create_Installer.bat git
working-directory: ${{ github.workspace }}\scripts
shell: cmd
- name: Get Version
id: version
run: |
FOR /F "tokens=*" %%i IN ('call ..\MPE\XPath\xpath.cmd "Titan Extended Temp.xmp2" "//PackageClass/GeneralInfo/Version" ^| ..\MPE\Tools\sed "s/ /./g"') DO (ECHO version=%%i >> %GITHUB_OUTPUT%)
working-directory: ${{ github.workspace }}\MPEI
shell: cmd
- name: Upload Artifact / MPE1
uses: actions/upload-artifact@v4
with:
name: Titan Extended - MPE1
path: |
${{ github.workspace }}\builds\Titan Extended-*.mpe1
if-no-files-found: error
- name: Upload Artifact / MPE XML
uses: actions/upload-artifact@v4
with:
name: Titan Extended - XML
path: |
${{ github.workspace }}\update\TitanExtendedUpdate.xml
if-no-files-found: error
- name: Get Release Version Description
run: |
call ..\MPE\XPath\xpath.cmd "Titan Extended.xmp2" "//PackageClass/GeneralInfo/VersionDescription" last > description.txt
working-directory: ${{ github.workspace }}\MPEI
shell: cmd
- name: Add Badges to Release Version Description
run: |
ECHO. >> description.txt
ECHO [![Downloads](https://img.shields.io/github/downloads/MediaPortal/TitanExtended/v${{steps.version.outputs.version}}/total)](https://github.com/MediaPortal/TitanExtended/releases/tag/v${{steps.version.outputs.version}}) [![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md) >> description.txt
working-directory: ${{ github.workspace }}\MPEI
shell: cmd
- name: Clean Release Version Description
run: |
..\MPE\Tools\sed.exe -i "s/ \//\//g" description.txt
working-directory: ${{ github.workspace }}\MPEI
shell: cmd
- name: Upload Artifact / Version Description
uses: actions/upload-artifact@v4
with:
name: Titan Extended - Version Description
path: |
${{ github.workspace }}\MPEI\description.txt
retention-days: ${{ inputs.retention-build || 90 }}
if-no-files-found: error
xml:
name: Titan Extended / XML
runs-on: ubuntu-latest
needs:
- build
permissions:
contents: write
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: Titan Extended - XML
path: ${{ github.workspace }}/update/
- name: Update / MPE1 XML
uses: EndBug/add-and-commit@v9
with:
message: 'Titan Extended ${{needs.build.outputs.version}} / Release'
add: '${{ github.workspace }}/update/TitanExtendedUpdate.xml'
- name: Delete XML Artifact
uses: geekyeggo/delete-artifact@v5
with:
name: Titan Extended - XML
failOnError: false
release:
name: Titan Extended / Release
runs-on: ubuntu-latest
needs:
- build
- xml
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: Titan Extended - MPE1
path: release-files
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: Titan Extended - Version Description
path: release-description
- name: Check Artifacts
run: |
ls -l
working-directory: release-files
- name: Release
uses: softprops/action-gh-release@v2
with:
name: Titan Extended v${{needs.build.outputs.version}}
tag_name: v${{needs.build.outputs.version}}
body_path: release-description/description.txt
generate_release_notes: true
files: |
release-files/*.mpe1
- name: Delete MPE1 Artifact
uses: geekyeggo/delete-artifact@v5
with:
name: Titan Extended - MPE1
failOnError: false
- name: Delete Version Description Artifact
uses: geekyeggo/delete-artifact@v5
with:
name: Titan Extended - Version Description
failOnError: false
ci-status:
name: Release Status
runs-on: ubuntu-latest
needs:
- release
if: always()
steps:
- name: Success
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failure
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1