Skip to content

Publish Studio Desktop for Windows #17

Publish Studio Desktop for Windows

Publish Studio Desktop for Windows #17

name: Publish Studio Desktop for Windows
on:
workflow_dispatch:
workflow_run:
workflows: [ Publish Studio Desktop ]
types:
- completed
jobs:
# Build MSI and Upload to CDN
# Run on local machine that needs to install .NET SDK 8.0
deploy-windows:
name: Deploy for Windows
runs-on: self-hosted
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') }}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: mavrosxristoforos/[email protected]
name: Get Version
id: get-oneware-version
with:
xml-file: "./build/props/Base.props"
xpath: "//*[local-name()='Project']/*[local-name()='PropertyGroup']/*[local-name()='StudioVersion']"
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 8.0.x
# - name: Install Wix
# run: dotnet tool install --global wix
- name: Publish
run: dotnet build ./studio/OneWare.Studio.Desktop.WindowsInstaller/OneWare.Studio.Desktop.WindowsInstaller.wixproj -c Release -r win-x64 -o ./out
- name: Create Button HTML
shell: powershell
run: ((Get-Content -path ./studio/OneWare.Studio.Desktop.WindowsInstaller/WinDownloadTemplate.htm -Raw) -replace '\$version\$', '${{ steps.get-oneware-version.outputs.info }}') | Set-Content -NoNewline -Path ./out/WinDownload.htm -Encoding UTF8
- name: Sign Installer
shell: powershell
run: signtool sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a ./out/en-us/OneWareStudio.WindowsInstaller.msi
- name: Create VersionInfo
run: echo "${{ steps.get-oneware-version.outputs.info }}|https://github.com/one-ware/OneWare/releases/download/${{ steps.get-oneware-version.outputs.info }}/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-win-x64.msi" > ./out/win-x64.txt
- name: Rename Installer
run: mv ./out/en-us/OneWareStudio.WindowsInstaller.msi ./out/en-us/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-win-x64.msi
- uses: ncipollo/release-action@v1
with:
tag: ${{ steps.get-oneware-version.outputs.info }}
artifacts: "./out/en-us/*.msi"
allowUpdates: true
omitBodyDuringUpdate: True
omitNameDuringUpdate: True
omitPrereleaseDuringUpdate: True
omitDraftDuringUpdate: True
- uses: joutvhu/ftp-transfer@v1
name: Upload
with:
host: w01ec151.kasserver.com
username: w01ec151
password: ${{ secrets.ONEWARE_FTP }}
commands: |
mkdir ./cdn.one-ware.com/onewarestudio/${{ steps.get-oneware-version.outputs.info }}
put ./out/en-us/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-win-x64.msi ./cdn.one-ware.com/onewarestudio/${{ steps.get-oneware-version.outputs.info }}/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-win-x64.msi
put ./out/WinDownload.htm ./cdn.one-ware.com/onewarestudio/WinDownload.htm
put ./out/win-x64.txt ./cdn.one-ware.com/onewarestudio/win-x64.txt