From 910b6eee70d6ff530bc1491fd29fa9139ad81c79 Mon Sep 17 00:00:00 2001 From: "J. Fronny" <33260128+JFronny@users.noreply.github.com> Date: Sun, 8 Mar 2020 17:16:36 +0100 Subject: [PATCH] Build XML --- .github/workflows/main.yml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 96877df..a4f5c1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,8 @@ jobs: & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" -noLogo -verbosity:m -p:Configuration=Release cp *\bin\Release\netcoreapp3.1\package.zip . $file = Get-Item $(Resolve-Path *\bin\Release\netcoreapp3.1\*.exe).Path - $asmver = $([Reflection.Assembly]::Loadfile($file.DirectoryName + "\" + $file.BaseName + ".dll").GetName().version.ToString()) + $asm = $([Reflection.Assembly]::ReflectionOnlyLoadFrom($file.DirectoryName + "\" + $file.BaseName + ".dll")) + $asmver = $asm.GetName().Version.ToString() echo "::set-output name=vers::$asmver" - name: Create Release id: create_release @@ -47,3 +48,31 @@ jobs: asset_path: ./package.zip asset_name: package.zip asset_content_type: application/zip + - name: Generate XML + id: make_xml + run: | + $file = Get-Item $(Resolve-Path *\bin\Release\netcoreapp3.1\*.exe).Path + $asm = [Reflection.Assembly]::ReflectionOnlyLoadFrom($file.DirectoryName + "\" + $file.BaseName + ".dll") + [System.XML.XMLDocument]$xml=New-Object System.XML.XMLDocument + [System.XML.XMLElement]$app=$xml.CreateElement("app") + $xml.appendChild($app) + $app.appendChild($xml.CreateElement("Name")).InnerText = $asm.GetName().Name + $app.appendChild($xml.CreateElement("Description")).InnerText = "Resize Windows with style" + $app.appendChild($xml.CreateElement("Version")).InnerText = "${{ steps.base_init.outputs.vers }}" + $app.appendChild($xml.CreateElement("ID")).InnerText = "e09cfca6-b6f7-4c56-96c4-d7cc2a318984" + $app.appendChild($xml.CreateElement("File")).InnerText = "${{ steps.upload_release_asset.outputs.browser_download_url }}" + $app.appendChild($xml.CreateElement("Hash")).InnerText = $(Get-FileHash .\package.zip).Hash + $app.appendChild($xml.CreateElement("Icon")).InnerText = "https://raw.githubusercontent.com/JFronny/Resizor/master/Resizor/Resizor.ico" + $app.appendChild($xml.CreateElement("MainFile")).InnerText = $file.Name + echo NULL > app.xml + $xml.save($(gi .\app.xml).Fullname) + - name: Upload XML + id: upload_xml + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./app.xml + asset_name: app.xml + asset_content_type: text/xml