Skip to content

Commit

Permalink
fix macOS app building on github
Browse files Browse the repository at this point in the history
  • Loading branch information
linderd committed Aug 28, 2024
1 parent 3a73f8f commit 44a0735
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 17 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,22 @@ jobs:

- name: Build Windows-single-file-app
run: dotnet publish QuIDE/QuIDE.csproj -r win-x64 -f net8.0 -p:PublishSingleFile=true --self-contained false

- name: Build macOS
- name: Build macOS software
run: dotnet publish QuIDE/QuIDE.csproj -r osx-arm64
- name: build macOS app
run: dotnet msbuild QuIDE/QuIDE.csproj -t:BundleApp -p:Configuration=Release -p:RuntimeIdentifier=osx-arm64

- name: build macOS single-file-app
run: dotnet msbuild QuIDE/QuIDE.csproj -t:BundleApp -p:Configuration=Release -p:RuntimeIdentifier=osx-arm64 -p:UseAppHost=true

# will later be put in .dmg
- name: Upload macOS App
uses: actions/upload-artifact@v4
with:
name: QuIDE.app
path: QuIDE/bin/Release/net8.0/osx-arm64/publish/QuIDE.app
compression-level: 0
retention-days: 1

- name: Upload Linux artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -47,8 +57,27 @@ jobs:
name: QuIDE Windows amd64
path: QuIDE/bin/Release/net8.0/win-x64/publish/QuIDE.exe

- name: Upload macOS artifact
uses: actions/upload-artifact@v4
with:
name: QuIDE macOS arm64
path: QuIDE/bin/Release/net8.0/osx-arm64/publish/QuIDE.app
build-dmg:
# the dmg-step doesn't work on linux
runs-on: macos-latest
needs: [build]

steps:
- uses: actions/download-artifact@v4
with:
name: QuIDE.app
path: QuIDE.app

# here we could sign the app if we had a certificate

- name: create macOS dmg
uses: L-Super/[email protected]
with:
dmg_name: QuIDE
src_dir: QuIDE.app

- name: Upload macOS artifact
uses: actions/upload-artifact@v4
with:
name: QuIDE macOS arm64
path: QuIDE.dmg
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.vs
.vscode
.DS_Store
bin
obj
packages
Expand Down
9 changes: 7 additions & 2 deletions QuIDE/QuIDE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<!-- for Parser.cs we need an unsafe block for a pointer to get the assemblies in a single-file-app -->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!-- needed for macOS App -->
<UseAppHost>true</UseAppHost>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -41,7 +43,7 @@
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10" />
<PackageReference Include="AvaloniaEdit.TextMate" Version="11.0.6" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="DotNet.Bundle" Version="0.9.13" />
<PackageReference Include="DotNet.Bundle" Version="*" />
<PackageReference Include="MessageBox.Avalonia" Version="3.1.5.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.10.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
Expand Down Expand Up @@ -122,10 +124,13 @@

<!-- Define things for dotnet-bundle for macOS-App -->
<PropertyGroup>
<CFBundleName>QuIDE</CFBundleName>
<CFBundleName>QuIDE 2</CFBundleName>
<CFBundleShortVersionString>2.2-dev</CFBundleShortVersionString>
<NSPrincipalClass>NSApplication</NSPrincipalClass>
<CFBundlePackageType>AAPL</CFBundlePackageType>
<NSRequiresAquaSystemAppearance>false</NSRequiresAquaSystemAppearance>
<NSHighResolutionCapable>true</NSHighResolutionCapable>
<CFBundleSignature>????</CFBundleSignature>
<CFBundleExecutable>QuIDE</CFBundleExecutable>
</PropertyGroup>
</Project>
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# QuIDE 2

Quantum Integrated Development Environment
Cross Platform Quantum Circuit Simulator

[![.NET](https://github.com/mnm-team/quide/actions/workflows/dotnet.yml/badge.svg)](https://github.com/mnm-team/quide/actions/workflows/dotnet.yml)

- fork of QuIDE 1.0.0 from [quide.eu](http://quide.eu/)
- refactored with [Avalonia](https://www.avaloniaui.net/) to be cross-compilable on Linux, Windows and macOS.
- maintained by [MNM-Team](https://www.mnm-team.org) at LMU Munich.

## Run the app

- simply download the application in the [Releases](https://github.com/mnm-team/quide/releases) section, there is a version for Windows, Linux (amd64) and macOS (arm64) precompiled.
- to run the program on your machine, you only need the dotnet-8.0-runtime. It can be obtained by [Microsoft](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or at your local packet manager, e.g. `dotnet-runtime-8.0` on Ubuntu.
- on Linux or macOS it can be necessary to set the file as executable for your user (`chmod +x <file>`) after unzipping.
- we don't have any certificate etc. for macOS, so you may need to start via [right-click](https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unidentified-developer-mh40616/mac).
- to run the program on your machine, you need the dotnet-8.0-runtime. It can be obtained by [Microsoft](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) or at your local packet manager, e.g. `dotnet-runtime-8.0` on Ubuntu.
- on Linux it can be necessary to set the file as executable for your user (`chmod +x QuIDE`) after unzipping.
- we don't have a developer ID for macOS, so you may need to use the following command: `xattr -cr /Applications/QuIDE.app` after installation (especially when macOS tells the app is broken).

## Compile by yourself

Expand All @@ -27,8 +28,12 @@ Quantum Integrated Development Environment
### Build single-file-app

- To build a single-file-app (Linux & Windows) you can use dotnet publish, e.g.: `dotnet publish QuIDE/QuIDE.csproj -r <linux/win>-x64 -p:PublishSingleFile=true --self-contained false -o out/`, then the App is at `out/QuIDE<.exe>` and all shared libraries (except dotnet-runtime) are included.
- To build a .app on macOS you need two commands: `dotnet publish QuIDE/QuIDE.csproj -r osx-arm64` and `dotnet msbuild QuIDE/QuIDE.csproj -t:BundleApp -p:RuntimeIdentifier=osx-arm64`.
- To build a .app on macOS you need two commands: `dotnet publish QuIDE/QuIDE.csproj -r osx-arm64` and `dotnet msbuild QuIDE/QuIDE.csproj -t:BundleApp -p:RuntimeIdentifier=osx-arm64 -property:Configuration=Release -p:UseAppHost=true`. Then you find it at `QuIDE/bin/Release/net8.0/osx-arm64/publish/QuIDE.app`.

## Documentation

- User Documentation of version 1.0.0 can be found [here](https://bitbucket.org/quide/quide/downloads/UserManual_EN.pdf), until now there are no features in QuIDE 2 which would extend the described functionality.
- User Documentation of version 1.0.0 can be found [here](https://bitbucket.org/quide/quide/downloads/UserManual_EN.pdf), until now there are no features in QuIDE 2 which would extend the described functionality.

## Contributing

Feel free to open PRs, open issues and more. We are happy about everbody who helps to make this tool better.

0 comments on commit 44a0735

Please sign in to comment.