Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 8 additions & 7 deletions .github/actions/download-rootfs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ inputs:
distros:
description: Space-separated list of distros to download
required: true
default: "Ubuntu"
default: 'Ubuntu'
path:
description: Directory to store the rootfs in (${path}\${distro}.tar.gz)
required: true
default: "Ubuntu"
default: 'Ubuntu'

runs:
using: "composite"
using: 'composite'
steps:
- name: Check out repo
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Install python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: '3.10'
- name: Install dependencies
shell: powershell
run: python -m pip install launchpadlib
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version: "1.21.4"
go-version-file: go.work
- name: Generate WSL release info
shell: powershell
# Repository root
Expand All @@ -45,6 +45,7 @@ runs:
}
Write-Output "::endgroup::"

New-Item -Type Directory -Path "${{ inputs.path }}" -ErrorAction Ignore | Out-Null
Write-Output "::group::Fetch release info"
python .\wsl-builder\lp-distro-info -o "${{ inputs.path }}\ubuntu-releases.csv"
Get-Content "${{ inputs.path }}\ubuntu-releases.csv"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
runs-on: windows-latest
if: ${{ !github.event.pull_request.draft }}
env:
rootfs64: 'http://cloud-images.ubuntu.com/wsl/jammy/current/ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz'
rootfs64: 'https://releases.ubuntu.com/resolute/ubuntu-26.04-wsl-amd64.wsl'
workDir: 'C:/Temp/builddir'
steps:
- name: Checkout WSL
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
# we need to use a subdirectory as we can't move back base GITHUB_WORKSPACE directory
path: repo
Expand All @@ -42,7 +42,7 @@ jobs:
$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
uses: microsoft/setup-msbuild@v3
- name: Install certificate
shell: powershell
working-directory: ${{ env.workDir }}
Expand All @@ -58,7 +58,7 @@ jobs:
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
uses: actions/upload-artifact@v7
with:
name: sideload-build
path: |
Expand Down
54 changes: 18 additions & 36 deletions .github/workflows/build-wsl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ on:
required: true
default: 'yes'

env:
goversion: '1.21.4'

jobs:
build-matrix:
name: Build Matrix for AppIDs to run on with rootfses, which can be manually supplied or automatically.
Expand All @@ -33,16 +30,16 @@ jobs:
run: |
sudo DEBIAN_FRONTEND=noninteractive apt update
sudo DEBIAN_FRONTEND=noninteractive apt install -y jq
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ env.goversion }}
go-version-file: go.work
- name: Build Matrix for AppIDs to run on with rootfses, which can be manually supplied or automatically
id: build-matrix-release
run: |
set -eux
# Manual build
if [ ${{ github.event_name }} = 'workflow_dispatch' ]; then
if [ "${{ github.event_name }}" = 'workflow_dispatch' ]; then
appID="${{ github.event.inputs.appID }}"
if [ -z "${appID}" ]; then
appID="UbuntuPreview"
Expand All @@ -65,15 +62,15 @@ jobs:
wsl-builder/lp-distro-info > /tmp/all-releases.csv
go build ./wsl-builder/prepare-build
builds_config="$(./prepare-build build-github-matrix /tmp/all-releases.csv)"
if [ "${builds_config}" == "null" ]; then
if [ "${builds_config}" = "null" ]; then
echo "No active application to build"
exit 0
fi
builds="{\"include\":${builds_config}}"
fi

echo "${builds}"
echo "::set-output name=matrix::${builds}"
echo "matrix=${builds}" >> $GITHUB_OUTPUT
echo "::notice::Building for: $(echo "${builds}" | jq '.include[] | "\(.AppID): \(.Rootfses). RootfsesChecksum: \(.RootfsesChecksum). Upload to store: \(.Upload)"')"

build-wsl:
Expand Down Expand Up @@ -102,9 +99,9 @@ jobs:
run: |
mkdir -p ${{ env.workDir }}/wiki/
git clone https://github.com/ubuntu/wsl.wiki ${{ env.workDir }}/wiki --depth 1
- uses: actions/setup-go@v3
- uses: actions/setup-go@v6
with:
go-version: ${{ env.goversion }}
go-version-file: ${{ env.workDir }}/go.work
- name: Prepare project metadata, assets and download rootfses
working-directory: ${{ env.workDir }}
shell: bash
Expand All @@ -113,7 +110,7 @@ jobs:
# Download rootfses, checksum and place them at the correct place
go build ./wsl-builder/prepare-build
extraArgs=""
if [ ${{ matrix.RootfsesChecksum }} != "yes" ]; then
if [ "${{ matrix.RootfsesChecksum }}" != "yes" ]; then
extraArgs="--no-checksum"
fi
archsBundle="$(./prepare-build prepare ${{ env.buildInfoPath }}/${{ matrix.AppID }}-buildid.md ${{ matrix.AppID }} ${{ matrix.Rootfses }} ${extraArgs})"
Expand All @@ -123,7 +120,7 @@ jobs:
buildMode="StoreUpload"
echo "UapAppxPackageBuildMode=${buildMode}" >> $GITHUB_ENV
- name: Setup MSBuild (PATH)
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v3
- name: Install certificate
shell: powershell
working-directory: ${{ env.workDir }}
Expand All @@ -145,7 +142,6 @@ jobs:
set -eu

# Launcher PDBs

for arch in "x64" "ARM64"; do
collectTo="debug-database-${{ matrix.AppID }}/launcher/$arch/"
mkdir -p "$collectTo"
Expand All @@ -160,14 +156,14 @@ jobs:
done

- name: Allow downloading sideload appxbundle
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: sideload-${{ matrix.AppID }}
path: |
${{ env.workDir }}/AppPackages/Ubuntu/Ubuntu_*/*
retention-days: 7
- name: Allow downloading store appxupload
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: store-${{ matrix.AppID }}
path: |
Expand All @@ -189,8 +185,8 @@ jobs:

build_id=$(cat "${{ env.buildInfoPath }}/${{ matrix.AppID }}-buildid.md")

echo "::set-output name=has-changes::false"
echo "::set-output name=should-upload::false"
echo "has-changes=false" >> $GITHUB_OUTPUT
echo "should-upload=false" >> $GITHUB_OUTPUT

# Store md5sum of rootfs, launcher and assets related code
fingerprint_file="${{ matrix.AppID }}-fingerprint.md"
Expand Down Expand Up @@ -220,7 +216,7 @@ jobs:
exit 0
fi

echo "::set-output name=has-changes::true"
echo "has-changes=true" >> $GITHUB_OUTPUT

if [ ${{ matrix.Upload }} != "yes" ]; then
echo "::notice::${{ matrix.AppID }} build ${build_id} ready for sideload or manual submission to the Microsoft Store"
Expand All @@ -235,7 +231,7 @@ jobs:
exit 0
fi
echo "::notice::Uploading to the store ${{ matrix.AppID }} build ${build_id}"
echo "::set-output name=should-upload::true"
echo "should-upload=true" >> $GITHUB_OUTPUT

echo "Uploading new version as some files have changed:"
echo "${hasChanges}"
Expand Down Expand Up @@ -308,7 +304,7 @@ jobs:
mkdir -p build-info/

cp -a ${{ env.artifactsPath }}/build-artifacts-*/*.md build-info/ || exit 0
echo "::set-output name=needs-wiki-update::true"
echo "needs-wiki-update=true" >> $GITHUB_OUTPUT

# Pushing PDB's to the wiki only makes sense if we uploaded new app versions to the store.
- name: Copy debug databases to base wiki
Expand All @@ -322,7 +318,7 @@ jobs:
find ${{ env.artifactsPath }} -name "debug-database-*" -maxdepth 1 -exec sh -c 'tar -cavf debug-databases/"$(basename $1)".tar.zst' sh '{}' \; || \
exit 0

echo "::set-output name=needs-wiki-update::true"
echo "needs-wiki-update=true" >> $GITHUB_OUTPUT

- name: Sync wiki to repository documentation
if: ${{ steps.modified-artifacts.outputs.needs-wiki-update == 'true' }}
Expand All @@ -341,17 +337,3 @@ jobs:
git clone https://github.com/ubuntu/wsl.git ${{ env.codeDir }} --depth 1
mkdir -p ${{ env.codeDir }}/uat
git clone https://git.launchpad.net/ubuntu-archive-tools ${{ env.codeDir }}/uat --depth 1

- name: Notify ISO Tracker
if: ${{ steps.modified-artifacts.outputs.needs-wiki-update == 'true' }}
env:
ISOTRACKER_USERNAME: ${{ secrets.ISOTRACKER_USERNAME }}
ISOTRACKER_PASSWORD: ${{ secrets.ISOTRACKER_PASSWORD }}
run: |
[ -f /tmp/all-releases.csv ] || ${{ env.codeDir }}/wsl-builder/lp-distro-info > /tmp/all-releases.csv
# There might have been more than one build in the latest commit
for build in $(git diff-tree --no-commit-id --name-only -r HEAD | grep buildid); do
AppID=$(basename $build);
AppID=${AppID%-buildid.md};
PYTHONPATH=${{ env.codeDir }}/uat ${{ env.codeDir }}/wsl-builder/notify-isotracker --debug $AppID $GITHUB_RUN_ID
done
18 changes: 9 additions & 9 deletions .github/workflows/detect-update-releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ on:
- '.github/workflows/detect-update-releases.yaml'
- 'wsl-builder/**'

env:
goversion: '1.21.4'

jobs:
update-releases:
name: Update and create metadata and assets for releases
runs-on: ubuntu-latest
container:
image: ubuntu:rolling
permissions:
contents: write
pull-requests: write # To create PRs
steps:
- name: Install git and dependencies
run: |
Expand All @@ -28,10 +28,10 @@ jobs:
apt install -y python3-launchpadlib libmagickwand-dev git pngquant fonts-ubuntu
- name: work around permission issue with git vulnerability (we are local here). TO REMOVE
run: git config --global --add safe.directory /__w/WSL/WSL
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ env.goversion }}
go-version-file: go.work
- name: Fetch current available releases from launchpad
run: |
wsl-builder/lp-distro-info > /tmp/all-releases.csv
Expand All @@ -47,14 +47,14 @@ jobs:
- name: Get destination branch for branch name
id: get-branch-name
shell: bash
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v8
with:
commit-message: Refreshes releases and assets
title: Refresh releases and assets
labels: automated pr
body: "[Auto-generated pull request](https://github.com/ubuntu/WSL/actions/workflows/detect-update-releases.yaml) by GitHub Action"
body: '[Auto-generated pull request](https://github.com/ubuntu/WSL/actions/workflows/detect-update-releases.yaml) by GitHub Action'
branch: auto-update-releases-${{ steps.get-branch-name.outputs.branch }}
token: ${{ secrets.GITHUB_TOKEN }}
delete-branch: true
52 changes: 10 additions & 42 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,22 @@ on:
pull_request:
paths-ignore:
- docs/**
- "*.md"
concurrency: azure-vm

env:
az_name: wsl-ci
az_resource_group: wsl
- '*.md'

jobs:
vm-setup:
runs-on: ubuntu-latest
steps:
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_VM_CREDS }}
- name: Start the Runner
shell: bash
run: |
az vm start --name ${{ env.az_name }} --resource-group ${{ env.az_resource_group }}

end-to-end-tests:
runs-on: self-hosted
needs: vm-setup
runs-on: windows-2025
env:
rootFsCache: "${env:USERPROFILE}\\Downloads\\rootfs"
# TODO: Move this to "Ubuntu" once we have backported everything and Ubuntu is transitionned to 24.04
distroName: Ubuntu-24.04
appID: Ubuntu24.04LTS
launcher: ubuntu2404.exe
distroName: Ubuntu
appID: Ubuntu
launcher: ubuntu.exe
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
uses: actions/checkout@v6
- name: Set up MSBuild (PATH)
uses: microsoft/setup-msbuild@v1.0.2
uses: microsoft/setup-msbuild@v3
- name: Install certificate
shell: powershell
run: |
Expand All @@ -50,14 +31,14 @@ jobs:
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: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version-file: ./e2e/go.work
go-version-file: go.work
- name: Install or update WSL
uses: ./.github/actions/wsl-install
- name: Download rootfs
uses: ./.github/actions/download-rootfs
with:
with:
distros: ${{ env.distroName }}
path: ${{ env.rootFsCache }}
- name: Build and install the appxbundle for testing
Expand Down Expand Up @@ -99,16 +80,3 @@ jobs:
shell: powershell
run: |
Remove-AppxPackage "$(Get-AppxPackage | Where-Object PackageFullName -like *${{ env.appID }}*)"

stop-vm:
runs-on: ubuntu-latest
needs: [vm-setup, end-to-end-tests]
if: always()
steps:
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_VM_CREDS }}
- name: Deallocate the Runner
shell: bash
run: |
az vm deallocate --name ${{ env.az_name }} --resource-group ${{ env.az_resource_group }}
Loading
Loading