Skip to content

Publish Studio Desktop for MacOS #24

Publish Studio Desktop for MacOS

Publish Studio Desktop for MacOS #24

name: Publish Studio Desktop for MacOS
on:
workflow_dispatch:
workflow_run:
workflows: [ Publish Studio Desktop ]
types:
- completed
jobs:
# Build DMG (x64, arm64) and upload to CDN
deploy-macos:
name: Deploy for MacOS
runs-on: macos-latest
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: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install create-dmg using Brew
run: brew install create-dmg
- name: Make Out Dir
run: mkdir ./out
- name: Create Bundles
working-directory: ./studio/OneWare.Studio.Desktop.MacOSInstaller
run: ./CreateAppBundle.sh
- name: Rename Packages
run: |
mv ./studio/OneWare.Studio.Desktop.MacOSInstaller/publish/OneWareStudio-x64.dmg ./studio/OneWare.Studio.Desktop.MacOSInstaller/publish/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-osx-x64.dmg
mv ./studio/OneWare.Studio.Desktop.MacOSInstaller/publish/OneWareStudio-arm64.dmg ./studio/OneWare.Studio.Desktop.MacOSInstaller/publish/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-osx-arm64.dmg
- uses: ncipollo/release-action@v1
with:
tag: ${{ steps.get-oneware-version.outputs.info }}
artifacts: "./studio/OneWare.Studio.Desktop.MacOSInstaller/publish/*.dmg"
allowUpdates: true
omitBodyDuringUpdate: True
omitNameDuringUpdate: True
omitPrereleaseDuringUpdate: True
omitDraftDuringUpdate: True
- name: Create Button HTML x64
shell: pwsh
run: ((Get-Content -path ./studio/OneWare.Studio.Desktop.MacOSInstaller/MacOSDownloadTemplate-x64.htm -Raw) -replace '\$version\$', '${{ steps.get-oneware-version.outputs.info }}') | Set-Content -NoNewline -Path ./out/MacOSDownload-x64.htm -Encoding UTF8
- name: Create Button HTML arm64
shell: pwsh
run: ((Get-Content -path ./studio/OneWare.Studio.Desktop.MacOSInstaller/MacOSDownloadTemplate-arm64.htm -Raw) -replace '\$version\$', '${{ steps.get-oneware-version.outputs.info }}') | Set-Content -NoNewline -Path ./out/MacOSDownload-arm64.htm -Encoding UTF8
- name: Create VersionInfo x64
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 }}-osx-x64.dmg" > ./out/osx-x64.txt
- name: Create VersionInfo arm64
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 }}-osx-arm64.dmg" > ./out/osx-arm64.txt
- 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 ./studio/OneWare.Studio.Desktop.MacOSInstaller/publish/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-osx-x64.dmg ./cdn.one-ware.com/onewarestudio/${{ steps.get-oneware-version.outputs.info }}/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-osx-x64.dmg
put ./studio/OneWare.Studio.Desktop.MacOSInstaller/publish/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-osx-arm64.dmg ./cdn.one-ware.com/onewarestudio/${{ steps.get-oneware-version.outputs.info }}/OneWareStudio-${{ steps.get-oneware-version.outputs.info }}-osx-arm64.dmg
put ./out/MacOSDownload-x64.htm ./cdn.one-ware.com/onewarestudio/MacOSDownload-x64.htm
put ./out/MacOSDownload-arm64.htm ./cdn.one-ware.com/onewarestudio/MacOSDownload-arm64.htm
put ./out/osx-x64.txt ./cdn.one-ware.com/onewarestudio/osx-x64.txt
put ./out/osx-arm64.txt ./cdn.one-ware.com/onewarestudio/osx-arm64.txt