Skip to content

Fix cloud-init blocking on WSL1 #1079

Fix cloud-init blocking on WSL1

Fix cloud-init blocking on WSL1 #1079

Workflow file for this run

name: Build windows package
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
paths-ignore:
- docs/**
jobs:
build-wsl:
name: Build
runs-on: windows-latest
if: ${{ !github.event.pull_request.draft }}
env:
rootfs64: 'http://cloud-images.ubuntu.com/wsl/jammy/current/ubuntu-jammy-wsl-amd64-wsl.rootfs.tar.gz'
workDir: 'C:/Temp/builddir'
steps:
- name: Checkout WSL
uses: actions/checkout@v3
with:
# we need to use a subdirectory as we can't move back base GITHUB_WORKSPACE directory
path: repo
- name: Copy under workDir (which has more space to build the package)
shell: bash
# Bash.exe wouldn't know how to handle the symlinks inside docs/ without the export below.
run: |
export MSYS=winsymlinks:nativestrict
mkdir -p $(dirname ${{ env.workDir }})
mv ${GITHUB_WORKSPACE}/repo ${{ env.workDir }}
cd ${{ env.workDir }}
git checkout "${GITHUB_SHA}"
git submodule update --init --recursive
- name: Download rootfs and configure project to only build x64
working-directory: ${{ env.workDir }}
shell: powershell
run: |
Set-Content -Path "DistroLauncher.sln" -Value (get-content -Path "DistroLauncher.sln" | Select-String -Pattern 'ARM64' -NotMatch)
mkdir x64/
$client = new-object System.Net.WebClient
$client.DownloadFile("${{ env.rootfs64}}","x64/install.tar.gz")
- name: Setup MSBuild (PATH)
uses: microsoft/setup-msbuild@v1.0.2
- name: Install certificate
shell: powershell
working-directory: ${{ env.workDir }}
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.CERTIFICATE }}'
certutil -decode certificate\certificate.txt certificate\certificate.pfx
$pwd = ConvertTo-SecureString '${{ secrets.CERTIFICATE_PASSWORD }}' -AsPlainText -Force
Import-PfxCertificate -Password $pwd -CertStoreLocation Cert:LocalMachine\Trust -FilePath certificate\certificate.pfx
Import-PfxCertificate -Password $pwd -CertStoreLocation Cert:CurrentUser\My -FilePath certificate\certificate.pfx
- name: Build Bundle
working-directory: ${{ env.workDir }}
run: msbuild .\DistroLauncher.sln /t:Build /m /nr:false /p:Configuration=Release /p:AppxBundle=Always /p:AppxBundlePlatforms="x64" /p:UapAppxPackageBuildMode=SideloadOnly -verbosity:normal
- name: Allow downloading sideload appxbundle
uses: actions/upload-artifact@v4
with:
name: sideload-build
path: |
${{ env.workDir }}/AppPackages/Ubuntu/Ubuntu_*/*
retention-days: 7