From 204f0e3e2d235a85b1762668d01a9eee535a7400 Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Thu, 22 May 2025 20:29:49 +0400 Subject: [PATCH 1/7] fix: change dummy workspace logic to include starting and stopping (#107) fixes #104 Includes starting, stopping, pending and unknown (rare!) workspaces as "dummy" grayed workspaces. TBD what we want to do with failed or canceled workspaces. --- App/ViewModels/TrayWindowViewModel.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/App/ViewModels/TrayWindowViewModel.cs b/App/ViewModels/TrayWindowViewModel.cs index cfa5163..4d493c9 100644 --- a/App/ViewModels/TrayWindowViewModel.cs +++ b/App/ViewModels/TrayWindowViewModel.cs @@ -207,7 +207,7 @@ private void UpdateFromRpcModel(RpcModel rpcModel) // For every stopped workspace that doesn't have any agents, add a // dummy agent row. foreach (var workspace in rpcModel.Workspaces.Where(w => - w.Status == Workspace.Types.Status.Stopped && !workspacesWithAgents.Contains(w.Id))) + ShouldShowDummy(w) && !workspacesWithAgents.Contains(w.Id))) { if (!Uuid.TryFrom(workspace.Id.Span, out var uuid)) continue; @@ -372,4 +372,21 @@ public void Exit() { _ = ((App)Application.Current).ExitApplication(); } + + private static bool ShouldShowDummy(Workspace workspace) + { + switch (workspace.Status) + { + case Workspace.Types.Status.Unknown: + case Workspace.Types.Status.Pending: + case Workspace.Types.Status.Starting: + case Workspace.Types.Status.Stopping: + case Workspace.Types.Status.Stopped: + return true; + // TODO: should we include and show a different color than Gray for workspaces that are + // failed, canceled or deleting? + default: + return false; + } + } } From 2301c75d7a6526bb83a9b91a953df7f99ef1070e Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Tue, 27 May 2025 20:55:15 -0700 Subject: [PATCH 2/7] chore: publish to winget in release workflow (#108) --- .github/workflows/release.yaml | 77 ++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e6849aa..9ad6c16 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,6 +18,8 @@ permissions: jobs: release: runs-on: ${{ github.repository_owner == 'coder' && 'windows-latest-16-cores' || 'windows-latest' }} + outputs: + version: ${{ steps.version.outputs.VERSION }} timeout-minutes: 15 steps: @@ -117,3 +119,78 @@ jobs: ${{ steps.release.outputs.ARM64_OUTPUT_PATH }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + winget: + runs-on: depot-windows-latest + needs: release + steps: + - name: Sync fork + run: gh repo sync cdrci/winget-pkgs -b master + env: + GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }} + + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + # If the event that triggered the build was an annotated tag (which our + # tags are supposed to be), actions/checkout has a bug where the tag in + # question is only a lightweight tag and not a full annotated tag. This + # command seems to fix it. + # https://github.com/actions/checkout/issues/290 + - name: Fetch git tags + run: git fetch --tags --force + + - name: Install wingetcreate + run: | + Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe + + - name: Submit updated manifest to winget-pkgs + run: | + $version = "${{ needs.release.outputs.version }}" + + $release_assets = gh release view --repo coder/coder-desktop-windows "v${version}" --json assets | ` + ConvertFrom-Json + # Get the installer URLs from the release assets. + $amd64_installer_url = $release_assets.assets | ` + Where-Object name -Match ".*-x64.exe$" | ` + Select -ExpandProperty url + $arm64_installer_url = $release_assets.assets | ` + Where-Object name -Match ".*-arm64.exe$" | ` + Select -ExpandProperty url + + echo "amd64 Installer URL: ${amd64_installer_url}" + echo "arm64 Installer URL: ${arm64_installer_url}" + echo "Package version: ${version}" + + .\wingetcreate.exe update Coder.CoderDesktop ` + --submit ` + --version "${version}" ` + --urls "${amd64_installer_url}" "${arm64_installer_url}" ` + --token "$env:WINGET_GH_TOKEN" + + env: + # For gh CLI: + GH_TOKEN: ${{ github.token }} + # For wingetcreate. We need a real token since we're pushing a commit + # to GitHub and then making a PR in a different repo. + WINGET_GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }} + + + - name: Comment on PR + run: | + # wait 30 seconds + Start-Sleep -Seconds 30.0 + # Find the PR that wingetcreate just made. + $version = "${{ needs.release.outputs.version }}" + $pr_list = gh pr list --repo microsoft/winget-pkgs --search "author:cdrci Coder.CoderDesktop version ${version}" --limit 1 --json number | ` + ConvertFrom-Json + $pr_number = $pr_list[0].number + + gh pr comment --repo microsoft/winget-pkgs "${pr_number}" --body "🤖 cc: @deansheather @matifali" + + env: + # For gh CLI. We need a real token since we're commenting on a PR in a + # different repo. + GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }} \ No newline at end of file From d6cbf716130b96ece46f646ef8013967d00faf73 Mon Sep 17 00:00:00 2001 From: Michael Suchacz <203725896+ibetitsmike@users.noreply.github.com> Date: Wed, 28 May 2025 13:17:22 +0200 Subject: [PATCH 3/7] feat: enabled sign out and animated window resize (#109) Closes: #96 --------- Co-authored-by: Dean Sheather --- App/Controls/ExpandContent.xaml | 51 ++++---- App/Controls/ExpandContent.xaml.cs | 46 +++++-- App/Services/RpcController.cs | 2 + App/ViewModels/AgentViewModel.cs | 12 +- .../TrayWindowLoginRequiredViewModel.cs | 7 ++ App/ViewModels/TrayWindowViewModel.cs | 9 +- .../Pages/TrayWindowLoginRequiredPage.xaml | 9 ++ App/Views/Pages/TrayWindowMainPage.xaml | 1 - App/Views/TrayWindow.xaml | 7 ++ App/Views/TrayWindow.xaml.cs | 114 ++++++++++++++---- 10 files changed, 188 insertions(+), 70 deletions(-) diff --git a/App/Controls/ExpandContent.xaml b/App/Controls/ExpandContent.xaml index d36170d..2cc0eb4 100644 --- a/App/Controls/ExpandContent.xaml +++ b/App/Controls/ExpandContent.xaml @@ -9,42 +9,43 @@ xmlns:toolkit="using:CommunityToolkit.WinUI" mc:Ignorable="d"> - + - + - - - + + + + - - - - + + + + + diff --git a/App/Controls/ExpandContent.xaml.cs b/App/Controls/ExpandContent.xaml.cs index 1cd5d2f..926af9a 100644 --- a/App/Controls/ExpandContent.xaml.cs +++ b/App/Controls/ExpandContent.xaml.cs @@ -2,38 +2,60 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Markup; +using System; +using System.Threading.Tasks; namespace Coder.Desktop.App.Controls; + [ContentProperty(Name = nameof(Children))] [DependencyProperty("IsOpen", DefaultValue = false)] public sealed partial class ExpandContent : UserControl { public UIElementCollection Children => CollapsiblePanel.Children; + private readonly string _expandedState = "ExpandedState"; + private readonly string _collapsedState = "CollapsedState"; + public ExpandContent() { InitializeComponent(); - } + Loaded += (_, __) => + { + // When we load the control for the first time (after panel swapping) + // we need to set the initial state based on IsOpen. + VisualStateManager.GoToState( + this, + IsOpen ? _expandedState : _collapsedState, + useTransitions: false); // NO animation yet - public void CollapseAnimation_Completed(object? sender, object args) - { - // Hide the panel completely when the collapse animation is done. This - // cannot be done with keyframes for some reason. - // - // Without this, the space will still be reserved for the panel. - CollapsiblePanel.Visibility = Visibility.Collapsed; + // If IsOpen was already true we must also show the panel + if (IsOpen) + { + CollapsiblePanel.Visibility = Visibility.Visible; + // This makes the panel expand to its full height + CollapsiblePanel.ClearValue(FrameworkElement.MaxHeightProperty); + } + }; } partial void OnIsOpenChanged(bool oldValue, bool newValue) { - var newState = newValue ? "ExpandedState" : "CollapsedState"; - - // The animation can't set visibility when starting or ending the - // animation. + var newState = newValue ? _expandedState : _collapsedState; if (newValue) + { CollapsiblePanel.Visibility = Visibility.Visible; + // We use BeginTime to ensure other panels are collapsed first. + // If the user clicks the expand button quickly, we want to avoid + // the panel expanding to its full height before the collapse animation completes. + CollapseSb.SkipToFill(); + } VisualStateManager.GoToState(this, newState, true); } + + private void CollapseStoryboard_Completed(object sender, object e) + { + CollapsiblePanel.Visibility = Visibility.Collapsed; + } } diff --git a/App/Services/RpcController.cs b/App/Services/RpcController.cs index 70dfe9f..7beff66 100644 --- a/App/Services/RpcController.cs +++ b/App/Services/RpcController.cs @@ -234,6 +234,8 @@ public async Task StopVpn(CancellationToken ct = default) MutateState(state => { state.VpnLifecycle = VpnLifecycle.Unknown; }); throw new VpnLifecycleException($"Failed to stop VPN. Service reported failure: {reply.Stop.ErrorMessage}"); } + + MutateState(state => { state.VpnLifecycle = VpnLifecycle.Stopped; }); } public async ValueTask DisposeAsync() diff --git a/App/ViewModels/AgentViewModel.cs b/App/ViewModels/AgentViewModel.cs index 34b01d7..cd5907b 100644 --- a/App/ViewModels/AgentViewModel.cs +++ b/App/ViewModels/AgentViewModel.cs @@ -237,12 +237,20 @@ public AgentViewModel(ILogger logger, ICoderApiClientFactory cod Id = id; - PropertyChanged += (_, args) => + PropertyChanging += (x, args) => { if (args.PropertyName == nameof(IsExpanded)) { - _expanderHost.HandleAgentExpanded(Id, IsExpanded); + var value = !IsExpanded; + if (value) + _expanderHost.HandleAgentExpanded(Id, value); + } + }; + PropertyChanged += (x, args) => + { + if (args.PropertyName == nameof(IsExpanded)) + { // Every time the drawer is expanded, re-fetch all apps. if (IsExpanded && !FetchingApps) FetchApps(); diff --git a/App/ViewModels/TrayWindowLoginRequiredViewModel.cs b/App/ViewModels/TrayWindowLoginRequiredViewModel.cs index 628be72..abc1257 100644 --- a/App/ViewModels/TrayWindowLoginRequiredViewModel.cs +++ b/App/ViewModels/TrayWindowLoginRequiredViewModel.cs @@ -2,6 +2,7 @@ using Coder.Desktop.App.Views; using CommunityToolkit.Mvvm.Input; using Microsoft.Extensions.DependencyInjection; +using Microsoft.UI.Xaml; namespace Coder.Desktop.App.ViewModels; @@ -31,4 +32,10 @@ public void Login() _signInWindow.Closed += (_, _) => _signInWindow = null; _signInWindow.Activate(); } + + [RelayCommand] + public void Exit() + { + _ = ((App)Application.Current).ExitApplication(); + } } diff --git a/App/ViewModels/TrayWindowViewModel.cs b/App/ViewModels/TrayWindowViewModel.cs index 4d493c9..d8b3182 100644 --- a/App/ViewModels/TrayWindowViewModel.cs +++ b/App/ViewModels/TrayWindowViewModel.cs @@ -126,7 +126,7 @@ public void HandleAgentExpanded(Uuid id, bool expanded) if (!expanded) return; _hasExpandedAgent = true; // Collapse every other agent. - foreach (var otherAgent in Agents.Where(a => a.Id != id)) + foreach (var otherAgent in Agents.Where(a => a.Id != id && a.IsExpanded == true)) otherAgent.SetExpanded(false); } @@ -360,11 +360,10 @@ private void ShowFileSyncListWindow() } [RelayCommand] - private void SignOut() + private async Task SignOut() { - if (VpnLifecycle is not VpnLifecycle.Stopped) - return; - _credentialManager.ClearCredentials(); + await _rpcController.StopVpn(); + await _credentialManager.ClearCredentials(); } [RelayCommand] diff --git a/App/Views/Pages/TrayWindowLoginRequiredPage.xaml b/App/Views/Pages/TrayWindowLoginRequiredPage.xaml index ce161e3..c1d69aa 100644 --- a/App/Views/Pages/TrayWindowLoginRequiredPage.xaml +++ b/App/Views/Pages/TrayWindowLoginRequiredPage.xaml @@ -34,5 +34,14 @@ + + + + + diff --git a/App/Views/Pages/TrayWindowMainPage.xaml b/App/Views/Pages/TrayWindowMainPage.xaml index f3549c2..283867d 100644 --- a/App/Views/Pages/TrayWindowMainPage.xaml +++ b/App/Views/Pages/TrayWindowMainPage.xaml @@ -333,7 +333,6 @@ diff --git a/App/Views/TrayWindow.xaml b/App/Views/TrayWindow.xaml index 0d87874..cfc4214 100644 --- a/App/Views/TrayWindow.xaml +++ b/App/Views/TrayWindow.xaml @@ -20,5 +20,12 @@ + + + diff --git a/App/Views/TrayWindow.xaml.cs b/App/Views/TrayWindow.xaml.cs index 5d1755c..ef55095 100644 --- a/App/Views/TrayWindow.xaml.cs +++ b/App/Views/TrayWindow.xaml.cs @@ -1,8 +1,3 @@ -using System; -using System.Runtime.InteropServices; -using Windows.Graphics; -using Windows.System; -using Windows.UI.Core; using Coder.Desktop.App.Controls; using Coder.Desktop.App.Models; using Coder.Desktop.App.Services; @@ -15,6 +10,13 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Media.Animation; +using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using Windows.Graphics; +using Windows.System; +using Windows.UI.Core; using WinRT.Interop; using WindowActivatedEventArgs = Microsoft.UI.Xaml.WindowActivatedEventArgs; @@ -24,8 +26,15 @@ public sealed partial class TrayWindow : Window { private const int WIDTH = 300; + private readonly AppWindow _aw; + + public double ProxyHeight { get; private set; } + + // This is used to know the "start point of the animation" + private int _lastWindowHeight; + private Storyboard? _currentSb; + private NativeApi.POINT? _lastActivatePosition; - private int _maxHeightSinceLastActivation; private readonly IRpcController _rpcController; private readonly ICredentialManager _credentialManager; @@ -82,8 +91,34 @@ public TrayWindow(IRpcController rpcController, ICredentialManager credentialMan var value = 2; // Best effort. This does not work on Windows 10. _ = NativeApi.DwmSetWindowAttribute(windowHandle, 33, ref value, Marshal.SizeOf()); + + _aw = AppWindow.GetFromWindowId( + Win32Interop.GetWindowIdFromWindow( + WindowNative.GetWindowHandle(this))); + SizeProxy.SizeChanged += (_, e) => + { + if (_currentSb is null) return; // nothing running + + int newHeight = (int)Math.Round( + e.NewSize.Height * DisplayScale.WindowScale(this)); + + int delta = newHeight - _lastWindowHeight; + if (delta == 0) return; + + var pos = _aw.Position; + var size = _aw.Size; + + pos.Y -= delta; // grow upward + size.Height = newHeight; + + _aw.MoveAndResize( + new RectInt32(pos.X, pos.Y, size.Width, size.Height)); + + _lastWindowHeight = newHeight; + }; } + private void SetPageByState(RpcModel rpcModel, CredentialModel credentialModel, SyncSessionControllerStateModel syncSessionModel) { @@ -140,22 +175,62 @@ public void SetRootFrame(Page page) private void RootFrame_SizeChanged(object sender, SizedFrameEventArgs e) { - MoveAndResize(e.NewSize.Height); + AnimateWindowHeight(e.NewSize.Height); } - private void MoveAndResize(double height) + // We need to animate the height change in code-behind, because XAML + // storyboard animation timeline is immutable - it cannot be changed + // mid-run to accomodate a new height. + private void AnimateWindowHeight(double targetHeight) { - var size = CalculateWindowSize(height); - var pos = CalculateWindowPosition(size); - var rect = new RectInt32(pos.X, pos.Y, size.Width, size.Height); - AppWindow.MoveAndResize(rect); + // If another animation is already running we need to fast forward it. + if (_currentSb is { } oldSb) + { + oldSb.Completed -= OnStoryboardCompleted; + // We need to use SkipToFill, because Stop actually sets Height to 0, which + // makes the window go haywire. + oldSb.SkipToFill(); + } + + _lastWindowHeight = AppWindow.Size.Height; + + var anim = new DoubleAnimation + { + To = targetHeight, + Duration = TimeSpan.FromMilliseconds(200), + EasingFunction = new CubicEase { EasingMode = EasingMode.EaseOut }, + EnableDependentAnimation = true + }; + + Storyboard.SetTarget(anim, SizeProxy); + Storyboard.SetTargetProperty(anim, "Height"); + + var sb = new Storyboard { Children = { anim } }; + sb.Completed += OnStoryboardCompleted; + sb.Begin(); + + _currentSb = sb; + } + + private void OnStoryboardCompleted(object? sender, object e) + { + // We need to remove the event handler after the storyboard completes, + // to avoid memory leaks and multiple calls. + if (sender is Storyboard sb) + sb.Completed -= OnStoryboardCompleted; + + // SizeChanged handler will stop forwarding resize ticks + // until we start the next storyboard. + _currentSb = null; } private void MoveResizeAndActivate() { SaveCursorPos(); - _maxHeightSinceLastActivation = 0; - MoveAndResize(RootFrame.GetContentSize().Height); + var size = CalculateWindowSize(RootFrame.GetContentSize().Height); + var pos = CalculateWindowPosition(size); + var rect = new RectInt32(pos.X, pos.Y, size.Width, size.Height); + AppWindow.MoveAndResize(rect); AppWindow.Show(); NativeApi.SetForegroundWindow(WindowNative.GetWindowHandle(this)); } @@ -179,9 +254,6 @@ private SizeInt32 CalculateWindowSize(double height) var scale = DisplayScale.WindowScale(this); var newWidth = (int)(WIDTH * scale); var newHeight = (int)(height * scale); - // Store the maximum height we've seen for positioning purposes. - if (newHeight > _maxHeightSinceLastActivation) - _maxHeightSinceLastActivation = newHeight; return new SizeInt32(newWidth, newHeight); } @@ -190,14 +262,6 @@ private PointInt32 CalculateWindowPosition(SizeInt32 size) { var width = size.Width; var height = size.Height; - // For positioning purposes, pretend the window is the maximum size it - // has been since it was last activated. This has the affect of - // allowing the window to move up to accomodate more content, but - // prevents it from moving back down when the window shrinks again. - // - // Prevents a lot of jittery behavior with app drawers. - if (height < _maxHeightSinceLastActivation) - height = _maxHeightSinceLastActivation; var cursorPosition = _lastActivatePosition; if (cursorPosition is null) From 22c9bcdb8cfe884179f07f47ab8b2c27e86d775f Mon Sep 17 00:00:00 2001 From: Michael Suchacz <203725896+ibetitsmike@users.noreply.github.com> Date: Wed, 28 May 2025 13:17:53 +0200 Subject: [PATCH 4/7] feat: disabled 'new sync form' when creating a mutagen sync (#110) Closes: #82 --- App/ViewModels/FileSyncListViewModel.cs | 13 ++++++++++--- App/Views/Pages/FileSyncListMainPage.xaml | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/App/ViewModels/FileSyncListViewModel.cs b/App/ViewModels/FileSyncListViewModel.cs index da40e5c..4777183 100644 --- a/App/ViewModels/FileSyncListViewModel.cs +++ b/App/ViewModels/FileSyncListViewModel.cs @@ -48,7 +48,11 @@ public partial class FileSyncListViewModel : ObservableObject [NotifyPropertyChangedFor(nameof(ShowSessions))] public partial string? Error { get; set; } = null; - [ObservableProperty] public partial bool OperationInProgress { get; set; } = false; + [ObservableProperty] + [NotifyPropertyChangedFor(nameof(CanOpenLocalPath))] + [NotifyPropertyChangedFor(nameof(NewSessionRemoteHostEnabled))] + [NotifyPropertyChangedFor(nameof(NewSessionRemotePathDialogEnabled))] + public partial bool OperationInProgress { get; set; } = false; [ObservableProperty] public partial IReadOnlyList Sessions { get; set; } = []; @@ -60,6 +64,7 @@ public partial class FileSyncListViewModel : ObservableObject [ObservableProperty] [NotifyPropertyChangedFor(nameof(NewSessionCreateEnabled))] + [NotifyPropertyChangedFor(nameof(CanOpenLocalPath))] public partial bool NewSessionLocalPathDialogOpen { get; set; } = false; [ObservableProperty] @@ -80,10 +85,12 @@ public partial class FileSyncListViewModel : ObservableObject [NotifyPropertyChangedFor(nameof(NewSessionRemotePathDialogEnabled))] public partial bool NewSessionRemotePathDialogOpen { get; set; } = false; - public bool NewSessionRemoteHostEnabled => AvailableHosts.Count > 0; + public bool CanOpenLocalPath => !NewSessionLocalPathDialogOpen && !OperationInProgress; + + public bool NewSessionRemoteHostEnabled => AvailableHosts.Count > 0 && !OperationInProgress; public bool NewSessionRemotePathDialogEnabled => - !string.IsNullOrWhiteSpace(NewSessionRemoteHost) && !NewSessionRemotePathDialogOpen; + !string.IsNullOrWhiteSpace(NewSessionRemoteHost) && !NewSessionRemotePathDialogOpen && !OperationInProgress; [ObservableProperty] public partial string NewSessionStatus { get; set; } = ""; diff --git a/App/Views/Pages/FileSyncListMainPage.xaml b/App/Views/Pages/FileSyncListMainPage.xaml index cb9f2bb..0872c1a 100644 --- a/App/Views/Pages/FileSyncListMainPage.xaml +++ b/App/Views/Pages/FileSyncListMainPage.xaml @@ -318,11 +318,12 @@ Grid.Column="0" Margin="0,0,5,0" VerticalAlignment="Stretch" + IsEnabled="{x:Bind ViewModel.OperationInProgress,Converter={StaticResource InverseBoolConverter}, Mode=OneWay}" Text="{x:Bind ViewModel.NewSessionLocalPath, Mode=TwoWay}" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #(loc.FailureHyperlinkLogText) + + + + + + + From 0b27367bb4cc7a809877efab6cd3d4f0483d415b Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Tue, 3 Jun 2025 18:12:18 +1000 Subject: [PATCH 7/7] fix: avoid build errors in CI (#115) --- .github/workflows/ci.yaml | 4 ++-- scripts/Publish.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 459579c..ac57947 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: cache: true cache-dependency-path: '**/packages.lock.json' - name: dotnet restore - run: dotnet restore --locked-mode + run: dotnet restore --locked-mode /p:BuildWithNetFrameworkHostedCompiler=true - name: dotnet format run: dotnet format --verify-no-changes --no-restore @@ -75,7 +75,7 @@ jobs: cache: true cache-dependency-path: '**/packages.lock.json' - name: dotnet restore - run: dotnet restore --locked-mode + run: dotnet restore --locked-mode /p:BuildWithNetFrameworkHostedCompiler=true # This doesn't call `dotnet publish` on the entire solution, just the # projects we care about building. Doing a full publish includes test # libraries and stuff which is pointless. diff --git a/scripts/Publish.ps1 b/scripts/Publish.ps1 index ee86980..6c0c101 100644 --- a/scripts/Publish.ps1 +++ b/scripts/Publish.ps1 @@ -113,7 +113,7 @@ if (Test-Path $buildPath) { New-Item -ItemType Directory -Path $buildPath -Force # Build in release mode -& dotnet.exe restore +& dotnet.exe restore /p:BuildWithNetFrameworkHostedCompiler=true if ($LASTEXITCODE -ne 0) { throw "Failed to dotnet restore" } $servicePublishDir = Join-Path $buildPath "service" & dotnet.exe publish .\Vpn.Service\Vpn.Service.csproj -c Release -a $arch -o $servicePublishDir /p:Version=$version