This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
testexetrisathlon/.github/workflows/main.yml

76 lines
3.2 KiB
YAML
Raw Normal View History

2020-03-17 15:18:46 +01:00
name: CD
on:
push:
2020-04-02 15:41:43 +02:00
branches:
- master
2020-03-17 15:18:46 +01:00
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Build
id: base_init
run: |
2020-03-17 15:30:15 +01:00
choco install ffmpeg
2020-03-17 15:20:51 +01:00
python DownloadDataDepsInstall.py
python DownloadData.py
2020-03-17 15:18:46 +01:00
$(new-object System.Net.WebClient).DownloadFile("https://www.github.com/JFronny/UpTool2/releases/latest/download/Tools.zip", "$($(pwd).Path)\Tools.zip")
& "C:\Program Files\7-Zip\7z.exe" x .\Tools.zip
rm Tools.zip
rm Install.bat
rm Remove.bat
dotnet build --verbosity:m -p:Configuration=Release
cp *\bin\Release\netcoreapp3.1\package.zip .
$file = Get-Item $(Resolve-Path *\bin\Release\netcoreapp3.1\*.exe).Path
$asm = $([Reflection.Assembly]::LoadFile($file.DirectoryName + "\" + $file.BaseName + ".dll"))
$asmver = $asm.GetName().Version.ToString()
echo "::set-output name=vers::$asmver"
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.base_init.outputs.vers }}
release_name: Release ${{ steps.base_init.outputs.vers }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload_release_asset
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: ./package.zip
asset_name: package.zip
asset_content_type: application/zip
- name: Generate XML
run: |
$file = Get-Item $(Resolve-Path *\bin\Release\netcoreapp3.1\*.exe).Path
$asm = [Reflection.Assembly]::LoadFile($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
2020-03-24 16:18:26 +01:00
$app.appendChild($xml.CreateElement("Description")).InnerText = "Terminal based Tetris clone"
2020-03-17 15:18:46 +01:00
$app.appendChild($xml.CreateElement("Version")).InnerText = "${{ steps.base_init.outputs.vers }}"
2020-03-24 16:18:26 +01:00
$app.appendChild($xml.CreateElement("ID")).InnerText = "9214aca9-af09-441d-8329-612e77347eba"
2020-03-17 15:18:46 +01:00
$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("MainFile")).InnerText = $file.Name
2020-03-24 16:11:07 +01:00
$app.appendChild($xml.CreateElement("Icon")).InnerText = "https://raw.githubusercontent.com/JFronny/testexetrisathlon/master/testexetrisathlon/tetris_yUxH6t_256px.ico"
2020-03-17 15:18:46 +01:00
echo NULL > app.xml
$xml.save($(gi .\app.xml).Fullname)
- name: 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