Skip to content

Publish Studio Desktop for Windows #115

Publish Studio Desktop for Windows

Publish Studio Desktop for Windows #115

name: Publish Studio Desktop for Windows
on:
workflow_dispatch:
workflow_run:
workflows: [ Publish Studio Desktop ]
types:
- completed
permissions:
contents: read
jobs:
build:
name: Build
if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') }}
runs-on: self-hosted
outputs:
version: ${{ steps.get-oneware-version.outputs.info }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: mavrosxristoforos/get-xml-info@2.0
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: Make Out Dir
run: mkdir ./out
# Build win-x64
- name: Publish win-x64
run: dotnet build ./studio/OneWare.Studio.Desktop.WindowsInstaller/OneWare.Studio.Desktop.WindowsInstaller.wixproj -c Release -p:InstallerPlatform=x64 -o ./publishInstaller/win-x64
# Build win-arm64
- name: Publish win-arm64
run: dotnet build ./studio/OneWare.Studio.Desktop.WindowsInstaller/OneWare.Studio.Desktop.WindowsInstaller.wixproj -c Release -p:InstallerPlatform=arm64 -o ./publishInstaller/win-arm64
- name: Create Button HTML x64
shell: powershell
run: ((Get-Content -path ./studio/OneWare.Studio.Desktop.WindowsInstaller/WinDownloadTemplate-x64.htm -Raw) -replace '\$version\$', '${{ steps.get-oneware-version.outputs.info }}') | Set-Content -NoNewline -Path ./out/WinDownload-x64.htm -Encoding UTF8
- name: Create Button HTML arm64
shell: powershell
run: ((Get-Content -path ./studio/OneWare.Studio.Desktop.WindowsInstaller/WinDownloadTemplate-arm64.htm -Raw) -replace '\$version\$', '${{ steps.get-oneware-version.outputs.info }}') | Set-Content -NoNewline -Path ./out/WinDownload-arm64.htm -Encoding UTF8
# Version info for win-x64
- name: Create VersionInfo win-x64
shell: powershell
run: Set-Content -NoNewline -Path ./out/win-x64.txt -Value "${{ 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" -Encoding UTF8
# Version info for win-arm64
- name: Create VersionInfo win-arm64
shell: powershell
run: Set-Content -NoNewline -Path ./out/win-arm64.txt -Value "${{ 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-arm64.msi" -Encoding UTF8
# Rename installers
- name: Rename Installer win-x64
run: mv ./publishInstaller/win-x64/en-us/OneWareStudio.WindowsInstaller.msi ./out/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-win-x64.msi
- name: Rename Installer win-arm64
run: mv ./publishInstaller/win-arm64/en-us/OneWareStudio.WindowsInstaller.msi ./out/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-win-arm64.msi
- name: Upload Artifacts
uses: actions/upload-artifact@v7
with:
name: windows-artifacts
path: |
./out/*.msi
./out/WinDownload-arm64.htm
./out/WinDownload-x64.htm
./out/win-x64.txt
./out/win-arm64.txt
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v8
with:
name: windows-artifacts
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.build.outputs.version }}
artifacts: "*.msi"
allowUpdates: true
omitBodyDuringUpdate: True
omitNameDuringUpdate: True
omitPrereleaseDuringUpdate: True
omitDraftDuringUpdate: True
- name: Upload to CDN
uses: pontago/lftp-deploy-action@master
with:
protocol: sftp
host: 5017617850.ssh.w2.strato.hosting
username: ${{ secrets.ONEWARE_SFTP_USER }}
password: ${{ secrets.ONEWARE_SFTP_PW }}
script: |
set cmd:fail-exit false
mkdir ./cdn.one-ware.com/onewarestudio/${{ needs.build.outputs.version }}
set cmd:fail-exit true
put OneWareStudio-${{ needs.build.outputs.version }}-win-x64.msi -o ./cdn.one-ware.com/onewarestudio/${{ needs.build.outputs.version }}/OneWareStudio-${{ needs.build.outputs.version }}-win-x64.msi
put OneWareStudio-${{ needs.build.outputs.version }}-win-arm64.msi -o ./cdn.one-ware.com/onewarestudio/${{ needs.build.outputs.version }}/OneWareStudio-${{ needs.build.outputs.version }}-win-arm64.msi
put WinDownload-arm64.htm -o ./cdn.one-ware.com/onewarestudio/WinDownload-arm64.htm
put WinDownload-x64.htm -o ./cdn.one-ware.com/onewarestudio/WinDownload-x64.htm
put win-x64.txt -o ./cdn.one-ware.com/onewarestudio/win-x64.txt
put win-arm64.txt -o ./cdn.one-ware.com/onewarestudio/win-arm64.txt