Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ on:
jobs:
build:
name: Latest Media Handler / Build
runs-on: windows-2019
runs-on: windows-2022
steps:
- name: Setup Visual Studio 2019
uses: microsoft/setup-msbuild@v2
with:
vs-version: 16.11

- name: Git Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -64,18 +59,21 @@ jobs:
outputs:
changes: ${{ steps.changes.outputs.xmp }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
xmp:
- '**.xmp2'
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
xmp:
- '**.xmp2'

codeql:
name: CodeQL
if: ${{ needs.changes.outputs.changes == 'true' }}
uses: Mediaportal-Plugin-Team/Mediaportal-Tools/.github/workflows/codeql.yml@master
with:
build-file: Build_GIT.bat
build-path: scripts
needs:
- build
- changes
Expand All @@ -85,7 +83,7 @@ jobs:

mpe:
name: Latest Media Handler / MPE
runs-on: windows-2019
runs-on: windows-2022
needs:
- build
- changes
Expand Down Expand Up @@ -230,8 +228,8 @@ jobs:
- name: Delete XML Artifact
uses: geekyeggo/delete-artifact@v5
with:
name: LatestMediaHandler XML
failOnError: false
name: LatestMediaHandler XML
failOnError: false

release:
name: Latest Media Handler / Release
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test / Latest Media Handler

on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
- edited
- ready_for_review
branches:
- master

jobs:
build:
name: Latest Media Handler / Build
runs-on: windows-2022
steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build
run: |
build_git.bat < nul
working-directory: ${{ github.workspace }}\scripts
shell: cmd

- name: Upload Artifact / Plugin
uses: actions/upload-artifact@v4
if: ${{ success() }}
with:
name: LatestMediaHandler
path: |
${{ github.workspace }}\LatestMediaHandler\bin\Release\LatestMediaHandler.dll
retention-days: 7
if-no-files-found: error

ci-status:
name: Build Status
runs-on: ubuntu-latest
needs:
- build
if: always()
steps:
- name: Success
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failure
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
2 changes: 1 addition & 1 deletion LatestMediaHandler/LatestMediaHandler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LatestMediaHandler</RootNamespace>
<AssemblyName>LatestMediaHandler</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
Expand Down
64 changes: 34 additions & 30 deletions scripts/Build_Debug_GIT.bat
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
@echo off
cls
Title Building MediaPortal Latest Media Handler (RELEASE)
cd ..

if "%programfiles(x86)%XXX"=="XXX" goto 32BIT
:: 64-bit
set PROGS=%programfiles(x86)%
goto CONT
:32BIT
set PROGS=%ProgramFiles%
:CONT

setlocal enabledelayedexpansion

:: Prepare version
for /f "tokens=*" %%a in ('git rev-list HEAD --count') do set REVISION=%%a
set REVISION=%REVISION: =%
"scripts\Tools\sed.exe" -i "s/\$WCREV\$/%REVISION%/g" LatestMediaHandler\Properties\AssemblyInfo.cs

:: Build
"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBUILD.exe" /target:Rebuild /property:Configuration=DEBUG /fl /flp:logfile=LatestMediaHandler.log;verbosity=diagnostic LatestMediaHandler.sln

:: Revert version
git checkout LatestMediaHandler\Properties\AssemblyInfo.cs

cd scripts

pause

@echo off
cls
Title Building MediaPortal Latest Media Handler (DEBUG)
cd ..

setlocal enabledelayedexpansion

:: Prepare version
for /f "tokens=*" %%a in ('git rev-list HEAD --count') do set REVISION=%%a
set REVISION=%REVISION: =%
"scripts\Tools\sed.exe" -i "s/\$WCREV\$/%REVISION%/g" LatestMediaHandler\Properties\AssemblyInfo.cs

:: Build
FOR %%p IN ("%PROGRAMFILES(x86)%" "%PROGRAMFILES%") DO (
FOR %%s IN (2019 2022) DO (
FOR %%e IN (Community Professional Enterprise BuildTools) DO (
SET PF=%%p
SET PF=!PF:"=!
SET MSBUILD_PATH="!PF!\Microsoft Visual Studio\%%s\%%e\MSBuild\Current\Bin\MSBuild.exe"
IF EXIST "!MSBUILD_PATH!" GOTO :BUILD
)
)
)

:BUILD

%MSBUILD_PATH% /target:Rebuild /property:Configuration=DEBUG /fl /flp:logfile=LatestMediaHandler.log;verbosity=diagnostic LatestMediaHandler.sln

:: Revert version
git checkout LatestMediaHandler\Properties\AssemblyInfo.cs

cd scripts

pause
65 changes: 34 additions & 31 deletions scripts/Build_GIT.bat
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
@echo off
cls
Title Building MediaPortal Latest Media Handler (RELEASE)
cd ..

if "%programfiles(x86)%XXX"=="XXX" goto 32BIT
:: 64-bit
set PROGS=%programfiles(x86)%
goto CONT
:32BIT
set PROGS=%ProgramFiles%
:CONT
IF NOT EXIST "%PROGS%\Team MediaPortal\MediaPortal\" SET PROGS=C:

setlocal enabledelayedexpansion

:: Prepare version
for /f "tokens=*" %%a in ('git rev-list HEAD --count') do set REVISION=%%a
set REVISION=%REVISION: =%
"scripts\Tools\sed.exe" -i "s/\$WCREV\$/%REVISION%/g" LatestMediaHandler\Properties\AssemblyInfo.cs

:: Build
"%WINDIR%\Microsoft.NET\Framework\v4.0.30319\MSBUILD.exe" /target:Rebuild /property:Configuration=RELEASE /fl /flp:logfile=LatestMediaHandler.log;verbosity=diagnostic LatestMediaHandler.sln

:: Revert version
git checkout LatestMediaHandler\Properties\AssemblyInfo.cs

cd scripts

pause

@echo off
cls
Title Building MediaPortal Latest Media Handler (RELEASE)
cd ..

setlocal enabledelayedexpansion

:: Prepare version
for /f "tokens=*" %%a in ('git rev-list HEAD --count') do set REVISION=%%a
set REVISION=%REVISION: =%
"scripts\Tools\sed.exe" -i "s/\$WCREV\$/%REVISION%/g" LatestMediaHandler\Properties\AssemblyInfo.cs

:: Build
FOR %%p IN ("%PROGRAMFILES(x86)%" "%PROGRAMFILES%") DO (
FOR %%s IN (2019 2022) DO (
FOR %%e IN (Community Professional Enterprise BuildTools) DO (
SET PF=%%p
SET PF=!PF:"=!
SET MSBUILD_PATH="!PF!\Microsoft Visual Studio\%%s\%%e\MSBuild\Current\Bin\MSBuild.exe"
IF EXIST "!MSBUILD_PATH!" GOTO :BUILD
)
)
)

:BUILD

%MSBUILD_PATH% /target:Rebuild /property:Configuration=RELEASE /fl /flp:logfile=LatestMediaHandler.log;verbosity=diagnostic LatestMediaHandler.sln

:: Revert version
git checkout LatestMediaHandler\Properties\AssemblyInfo.cs

cd scripts

pause