Release after PR #6 #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build / MePo Theme | |
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: MePo Theme / 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: Build MPE1 | |
run: | | |
Create_Installer.bat git | |
working-directory: ${{ github.workspace }}\script | |
shell: cmd | |
- name: Get Version | |
id: version | |
run: | | |
FOR /F "tokens=*" %%i IN ('call ..\MPE\XPath\xpath.cmd "MePoThemeTemp.xmp2" "//PackageClass/GeneralInfo/Version" ^| ..\MPE\Tools\sed "s/ /./g"') DO (ECHO version=%%i >> %GITHUB_OUTPUT%) | |
working-directory: ${{ github.workspace }}\script | |
shell: cmd | |
- name: Upload Artifact / MPE1 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MePo Theme - MPE1 | |
path: | | |
${{ github.workspace }}\build\MePoTheme.Titan-*.mpe1 | |
if-no-files-found: error | |
- name: Upload Artifact / MPE XML | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MePo Theme - XML | |
path: | | |
${{ github.workspace }}\script\MePoTheme.xml | |
if-no-files-found: error | |
- name: Get Release Version Description | |
run: | | |
call ..\MPE\XPath\xpath.cmd "MePoTheme.xmp2" "//PackageClass/GeneralInfo/VersionDescription" last > description.txt | |
working-directory: ${{ github.workspace }}\script | |
shell: cmd | |
- name: Add Badges to Release Version Description | |
run: | | |
ECHO. >> description.txt | |
ECHO [![Downloads](https://img.shields.io/github/downloads/andrewjswan/mediaportal-titan-mepo-theme/v${{steps.version.outputs.version}}/total)](https://github.com/andrewjswan/mediaportal-titan-mepo-theme/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 }}\script | |
shell: cmd | |
- name: Clean Release Version Description | |
run: | | |
..\MPE\Tools\sed.exe -i "s/ \//\//g" description.txt | |
working-directory: ${{ github.workspace }}\script | |
shell: cmd | |
- name: Upload Artifact / Version Description | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MePo Theme - Version Description | |
path: | | |
${{ github.workspace }}\script\description.txt | |
retention-days: ${{ inputs.retention-build || 90 }} | |
if-no-files-found: error | |
xml: | |
name: MePo Theme / 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: MePo Theme - XML | |
path: ${{ github.workspace }}/script/ | |
- name: Update / MPE1 XML | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: 'MePo Theme ${{needs.build.outputs.version}} / Release' | |
add: '${{ github.workspace }}/script/MePoTheme.xml' | |
- name: Delete XML Artifact | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: MePo Theme - XML | |
failOnError: false | |
release: | |
name: MePo Theme / Release | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- xml | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: MePo Theme - MPE1 | |
path: release-files | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: MePo Theme - 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: MePo Theme 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: MePo Theme - MPE1 | |
failOnError: false | |
- name: Delete Version Description Artifact | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: MePo Theme - 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 |