Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix macOS app building #10

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 33 additions & 10 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ 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
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: Upload Linux artifact
uses: actions/upload-artifact@v4
Expand All @@ -47,8 +42,36 @@ 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-on-macos:
# the dmg-step doesn't work on linux
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --configuration Release

- 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 -p:UseAppHost=true

- name: create macOS dmg
uses: L-Super/[email protected]
with:
dmg_name: QuIDE
src_dir: QuIDE/bin/Release/net8.0/osx-arm64/publish/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
2 changes: 1 addition & 1 deletion QuIDE/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<PropertyGroup>
<Version>2.2</Version>
<FileVersion>2.2</FileVersion>
<InformationalVersion>2.2-dev</InformationalVersion>
<InformationalVersion>2.2</InformationalVersion>
</PropertyGroup>
</Project>
11 changes: 8 additions & 3 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>
<CFBundleShortVersionString>2.2-dev</CFBundleShortVersionString>
<CFBundleName>QuIDE 2</CFBundleName>
<CFBundleShortVersionString>2.2</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.