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

Feature Request - Windows Support #1

Open
StevenEBarbaro opened this issue Jun 13, 2023 · 4 comments
Open

Feature Request - Windows Support #1

StevenEBarbaro opened this issue Jun 13, 2023 · 4 comments

Comments

@StevenEBarbaro
Copy link

StevenEBarbaro commented Jun 13, 2023

First-off, love this GitHub action! I've been using it to build for device and would like to use it for the Windows simulator.

I have a custom set up now that works using WinGet. Sharing learnings here in hopes that they can be adapted for this project!

#          ...
      build:
        runs-on: windows-latest
#          ...
      # https://github.com/microsoft/winget-cli/issues/1861
      # https://github.com/microsoft/winget-cli/issues/700
      - name: Install WinGet
        run: |
          Import-Module -Name Appx -UseWindowsPowerShell
          Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.UI.Xaml/2.7.3 -OutFile .\microsoft.ui.xaml.2.7.3.zip
          Expand-Archive .\microsoft.ui.xaml.2.7.3.zip
          Add-AppxPackage .\microsoft.ui.xaml.2.7.3\tools\AppX\x64\Release\Microsoft.UI.Xaml.2.7.appx
          $progressPreference = 'silentlyContinue'
          $latestWingetMsixBundleUri = $(Invoke-RestMethod https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url | Where-Object {$_.EndsWith(".msixbundle")}
          $latestWingetMsixBundle = $latestWingetMsixBundleUri.Split("/")[-1]
          Write-Information "Downloading winget to artifacts directory..."
          Invoke-WebRequest -Uri $latestWingetMsixBundleUri -OutFile "./$latestWingetMsixBundle"
          Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile Microsoft.VCLibs.x64.14.00.Desktop.appx
          Add-AppxPackage Microsoft.VCLibs.x64.14.00.Desktop.appx
          Add-AppxPackage $latestWingetMsixBundle
          $latestWingetLicenseUri = $(Invoke-RestMethod https://api.github.com/repos/microsoft/winget-cli/releases/latest).assets.browser_download_url | Where-Object {$_.EndsWith("License1.xml")}
          $latestWingetLicenseBundle = $latestWingetLicenseUri.Split("/")[-1]
          Invoke-WebRequest -Uri $latestWingetLicenseUri -OutFile "./$latestWingetLicenseBundle"
          Add-AppxProvisionedPackage -Online -PackagePath .\$latestWingetMsixBundle -LicensePath .\$latestWingetLicenseBundle -Verbose

#          ...

      - name: Install PlaydateSDK
        run: winget install --version 1.13.7 Panic.PlaydateSDK --silent --accept-source-agreements

#          ... some other step PLAYDATE_SDK_PATH=C:\Users\runneradmin\Documents\PlaydateSDK

Some additional notes:

  • SDK installs to Documents by default, I didn't look into obtaining the path dynamically.
  • omitting --version to take the latest will bring down beta SDK v2
  • Path resolution for folders like ${{ runner.temp }} get messed up when using shell: bash in the windows runner.
@idleberg
Copy link
Owner

I'd like to ask you something because I've been thinking about supporting other operating systems but so far discarded the idea.

What is a use case to compile a Playdate game on a different platform? Is this specific to developing games in C? It looks to me like you're installing dependencies (Microsoft.UI.Xaml, Microsoft.VCLibs), are these used in the code of the game? I wonder if these are dependencies specific to your project because in that case, I wouldn't want to make them a part of the installation. Different developers have different needs.

I might consider supporting other operating systems once I get a better understanding.

@StevenEBarbaro
Copy link
Author

StevenEBarbaro commented Jun 13, 2023

Those are dependencies of WinGet specifically. I had to kludge them into my steps because I'm using the default GitHub windows-latest runner and it needed them to get WinGet working.

As for use case: For me it's developing games in C with build and test-validation for both the simulator and device (underlying c calls do vary in implementation when cross-compiled for the device!).

@idleberg
Copy link
Owner

idleberg commented Jun 24, 2023

Slightly off-topic: a couple of months ago, I was surprised that there's no action available on the GitHub Marketplace, which lets you install or use winget. Also, I find it surprising that the Windows Server version used in workflows doesn't come with winget installed, even though the retail version doesn't include it. Other platforms seem to use modified images, e.g. macOS comes with brew pre-installed. Do you happen to know more about this?

Since you managed to get winget installed, have you considered publishing it as a re-usable action on the GitHub Marketplace?

@idleberg
Copy link
Owner

idleberg commented Aug 4, 2023

Looks like there's finally an action for installing Winget on the GitHub Marketplace

https://github.com/marketplace/actions/install-winget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants