Skip to content

Commit

Permalink
Adapt to installer file and distribution renaming for Ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Nov 3, 2022
1 parent 57b39bc commit 6ae2757
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 50 deletions.
41 changes: 21 additions & 20 deletions .github/workflows/template/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ jobs:
match-pattern: '*openSUSE*Leap*15.2*'
default-absent-tool: which
- &ubuntu_22_04
wsl-id: Ubuntu-22.04
wsl-id: Ubuntu
user-id: Ubuntu-22.04
match-pattern: '*Ubuntu*22.04*'
default-absent-tool: dos2unix
Expand Down Expand Up @@ -1193,13 +1193,6 @@ jobs:
distribution: ${{ matrix.distributions.distribution7.user-id }}
set-as-default: 'false'

- <<: *execute_action
name: Execute action for ${{ matrix.distributions.distribution8.user-id }}
id: execute_action8
with:
distribution: ${{ matrix.distributions.distribution8.user-id }}
set-as-default: 'false'

- name: Test - wsl-bash_${{ matrix.distributions.distribution1.user-id }} should use the correct distribution
if: always()
&& (steps.execute_action1.outcome == 'success')
Expand Down Expand Up @@ -1295,6 +1288,7 @@ jobs:
- name: Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution
if: always()
&& (steps.execute_action5.outcome == 'success')
&& (matrix.distributions.distribution5.user-id == 'Ubuntu-22.04')
shell: wsl-bash_Ubuntu-22.04 {0}
run: >
cat
Expand All @@ -1315,9 +1309,10 @@ jobs:
${{ matrix.distributions.distribution5.match-pattern }}
]]
- name: Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should use the correct distribution
- name: Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution
if: always()
&& (steps.execute_action6.outcome == 'success')
&& (steps.execute_action5.outcome == 'success')
&& (matrix.distributions.distribution5.user-id == 'Ubuntu-20.04')
shell: wsl-bash_Ubuntu-20.04 {0}
run: >
cat
Expand All @@ -1335,12 +1330,12 @@ jobs:
<([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true)
<([ -f /proc/version ] && cat /proc/version || true))"
==
${{ matrix.distributions.distribution6.match-pattern }}
${{ matrix.distributions.distribution5.match-pattern }}
]]
- name: Test - wsl-bash_${{ matrix.distributions.distribution7.user-id }} should use the correct distribution
- name: Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should use the correct distribution
if: always()
&& (steps.execute_action7.outcome == 'success')
&& (steps.execute_action6.outcome == 'success')
shell: wsl-bash_Ubuntu-18.04 {0}
run: >
cat
Expand All @@ -1358,12 +1353,12 @@ jobs:
<([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true)
<([ -f /proc/version ] && cat /proc/version || true))"
==
${{ matrix.distributions.distribution7.match-pattern }}
${{ matrix.distributions.distribution6.match-pattern }}
]]
- name: Test - wsl-bash_${{ matrix.distributions.distribution8.user-id }} should use the correct distribution
- name: Test - wsl-bash_${{ matrix.distributions.distribution7.user-id }} should use the correct distribution
if: always()
&& (steps.execute_action8.outcome == 'success')
&& (steps.execute_action7.outcome == 'success')
shell: wsl-bash_Ubuntu-16.04 {0}
run: >
cat
Expand All @@ -1381,19 +1376,25 @@ jobs:
<([ -d /etc/products.d ] && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {} + || true)
<([ -f /proc/version ] && cat /proc/version || true))"
==
${{ matrix.distributions.distribution8.match-pattern }}
${{ matrix.distributions.distribution7.match-pattern }}
]]
strategy:
fail-fast: false
matrix:
environment: *environments
distributions:
- distribution1: *debian
distribution2: *alpine
distribution3: *kali
distribution4: *open_suse_leap_15_2
distribution5: *ubuntu_20_04
distribution6: *ubuntu_18_04
distribution7: *ubuntu_16_04
- distribution1: *debian
distribution2: *alpine
distribution3: *kali
distribution4: *open_suse_leap_15_2
distribution5: *ubuntu_22_04
distribution6: *ubuntu_20_04
distribution7: *ubuntu_18_04
distribution8: *ubuntu_16_04
distribution6: *ubuntu_18_04
distribution7: *ubuntu_16_04
82 changes: 54 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ jobs:
"user-id": "openSUSE-Leap-15.2"
"match-pattern": "*openSUSE*Leap*15.2*"
"default-absent-tool": "which"
- "wsl-id": "Ubuntu-22.04"
- "wsl-id": "Ubuntu"
"user-id": "Ubuntu-22.04"
"match-pattern": "*Ubuntu*22.04*"
"default-absent-tool": "dos2unix"
Expand Down Expand Up @@ -612,7 +612,7 @@ jobs:
"user-id": "openSUSE-Leap-15.2"
"match-pattern": "*openSUSE*Leap*15.2*"
"default-absent-tool": "which"
- "wsl-id": "Ubuntu-22.04"
- "wsl-id": "Ubuntu"
"user-id": "Ubuntu-22.04"
"match-pattern": "*Ubuntu*22.04*"
"default-absent-tool": "dos2unix"
Expand Down Expand Up @@ -708,7 +708,7 @@ jobs:
"user-id": "openSUSE-Leap-15.2"
"match-pattern": "*openSUSE*Leap*15.2*"
"default-absent-tool": "which"
- "wsl-id": "Ubuntu-22.04"
- "wsl-id": "Ubuntu"
"user-id": "Ubuntu-22.04"
"match-pattern": "*Ubuntu*22.04*"
"default-absent-tool": "dos2unix"
Expand Down Expand Up @@ -773,7 +773,7 @@ jobs:
"user-id": "openSUSE-Leap-15.2"
"match-pattern": "*openSUSE*Leap*15.2*"
"default-absent-tool": "which"
- "wsl-id": "Ubuntu-22.04"
- "wsl-id": "Ubuntu"
"user-id": "Ubuntu-22.04"
"match-pattern": "*Ubuntu*22.04*"
"default-absent-tool": "dos2unix"
Expand Down Expand Up @@ -1058,7 +1058,7 @@ jobs:
"user-id": "openSUSE-Leap-15.2"
"match-pattern": "*openSUSE*Leap*15.2*"
"default-absent-tool": "which"
- "wsl-id": "Ubuntu-22.04"
- "wsl-id": "Ubuntu"
"user-id": "Ubuntu-22.04"
"match-pattern": "*Ubuntu*22.04*"
"default-absent-tool": "dos2unix"
Expand Down Expand Up @@ -1199,12 +1199,6 @@ jobs:
with:
"distribution": "${{ matrix.distributions.distribution7.user-id }}"
"set-as-default": "false"
- id: "execute_action8"
name: "Execute action for ${{ matrix.distributions.distribution8.user-id }}"
uses: "./"
with:
"distribution": "${{ matrix.distributions.distribution8.user-id }}"
"set-as-default": "false"
- if: "always() && (steps.execute_action1.outcome == 'success')"
name: "Test - wsl-bash_${{ matrix.distributions.distribution1.user-id }} should\
\ use the correct distribution"
Expand Down Expand Up @@ -1261,7 +1255,8 @@ jobs:
\ + || true) <([ -f /proc/version ] && cat /proc/version || true))\" == ${{\
\ matrix.distributions.distribution4.match-pattern }} ]]\n"
shell: "wsl-bash_openSUSE-Leap-15.2 {0}"
- if: "always() && (steps.execute_action5.outcome == 'success')"
- if: "always() && (steps.execute_action5.outcome == 'success') && (matrix.distributions.distribution5.user-id\
\ == 'Ubuntu-22.04')"
name: "Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should\
\ use the correct distribution"
run: "cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find\
Expand All @@ -1275,8 +1270,9 @@ jobs:
\ + || true) <([ -f /proc/version ] && cat /proc/version || true))\" == ${{\
\ matrix.distributions.distribution5.match-pattern }} ]]\n"
shell: "wsl-bash_Ubuntu-22.04 {0}"
- if: "always() && (steps.execute_action6.outcome == 'success')"
name: "Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should\
- if: "always() && (steps.execute_action5.outcome == 'success') && (matrix.distributions.distribution5.user-id\
\ == 'Ubuntu-20.04')"
name: "Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should\
\ use the correct distribution"
run: "cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find\
\ /etc -maxdepth 1 -type f \\( -name '*release' -or -name 'issue*' \\) -exec\
Expand All @@ -1287,10 +1283,10 @@ jobs:
\ -or -name 'issue*' \\) -exec cat {} + || true) <([ -d /etc/products.d ]\
\ && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {}\
\ + || true) <([ -f /proc/version ] && cat /proc/version || true))\" == ${{\
\ matrix.distributions.distribution6.match-pattern }} ]]\n"
\ matrix.distributions.distribution5.match-pattern }} ]]\n"
shell: "wsl-bash_Ubuntu-20.04 {0}"
- if: "always() && (steps.execute_action7.outcome == 'success')"
name: "Test - wsl-bash_${{ matrix.distributions.distribution7.user-id }} should\
- if: "always() && (steps.execute_action6.outcome == 'success')"
name: "Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should\
\ use the correct distribution"
run: "cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find\
\ /etc -maxdepth 1 -type f \\( -name '*release' -or -name 'issue*' \\) -exec\
Expand All @@ -1301,10 +1297,10 @@ jobs:
\ -or -name 'issue*' \\) -exec cat {} + || true) <([ -d /etc/products.d ]\
\ && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {}\
\ + || true) <([ -f /proc/version ] && cat /proc/version || true))\" == ${{\
\ matrix.distributions.distribution7.match-pattern }} ]]\n"
\ matrix.distributions.distribution6.match-pattern }} ]]\n"
shell: "wsl-bash_Ubuntu-18.04 {0}"
- if: "always() && (steps.execute_action8.outcome == 'success')"
name: "Test - wsl-bash_${{ matrix.distributions.distribution8.user-id }} should\
- if: "always() && (steps.execute_action7.outcome == 'success')"
name: "Test - wsl-bash_${{ matrix.distributions.distribution7.user-id }} should\
\ use the correct distribution"
run: "cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find\
\ /etc -maxdepth 1 -type f \\( -name '*release' -or -name 'issue*' \\) -exec\
Expand All @@ -1315,7 +1311,7 @@ jobs:
\ -or -name 'issue*' \\) -exec cat {} + || true) <([ -d /etc/products.d ]\
\ && find /etc/products.d -maxdepth 1 -type f -name '*.prod' -exec cat {}\
\ + || true) <([ -f /proc/version ] && cat /proc/version || true))\" == ${{\
\ matrix.distributions.distribution8.match-pattern }} ]]\n"
\ matrix.distributions.distribution7.match-pattern }} ]]\n"
shell: "wsl-bash_Ubuntu-16.04 {0}"
strategy:
matrix:
Expand Down Expand Up @@ -1345,23 +1341,53 @@ jobs:
"match-pattern": "*openSUSE*Leap*15.2*"
"default-absent-tool": "which"
"distribution5":
"wsl-id": "Ubuntu-22.04"
"user-id": "Ubuntu-22.04"
"match-pattern": "*Ubuntu*22.04*"
"default-absent-tool": "dos2unix"
"distribution6":
"wsl-id": "Ubuntu"
"user-id": "Ubuntu-20.04"
"match-pattern": "*Ubuntu*20.04*"
"default-absent-tool": "dos2unix"
"distribution6":
"wsl-id": "Ubuntu-18.04"
"user-id": "Ubuntu-18.04"
"match-pattern": "*Ubuntu*18.04*"
"default-absent-tool": "dos2unix"
"distribution7":
"wsl-id": "Ubuntu-16.04"
"user-id": "Ubuntu-16.04"
"match-pattern": "*Ubuntu*16.04*"
"default-absent-tool": "dos2unix"
- "distribution1":
"wsl-id": "Debian"
"user-id": "Debian"
"match-pattern": "*Debian*"
"default-absent-tool": "dos2unix"
"distribution2":
"wsl-id": "Alpine"
"user-id": "Alpine"
"match-pattern": "*Alpine*"
"default-absent-tool": "dos2unix"
"distribution3":
"wsl-id": "kali-linux"
"user-id": "kali-linux"
"match-pattern": "*Kali*"
"default-absent-tool": "dos2unix"
"distribution4":
"wsl-id": "openSUSE-Leap-15.2"
"user-id": "openSUSE-Leap-15.2"
"match-pattern": "*openSUSE*Leap*15.2*"
"default-absent-tool": "which"
"distribution5":
"wsl-id": "Ubuntu"
"user-id": "Ubuntu-22.04"
"match-pattern": "*Ubuntu*22.04*"
"default-absent-tool": "dos2unix"
"distribution6":
"wsl-id": "Ubuntu-18.04"
"user-id": "Ubuntu-18.04"
"match-pattern": "*Ubuntu*18.04*"
"default-absent-tool": "dos2unix"
"distribution8":
"distribution7":
"wsl-id": "Ubuntu-16.04"
"user-id": "Ubuntu-16.04"
"match-pattern": "*Ubuntu*16.04*"
"default-absent-tool": "dos2unix"
fail-fast: false
fail-fast: false
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ inputs:
distribution:
description: |
The WSL distribution to install, update, or configure.
'Ubuntu-22.04' and 'Ubuntu-20.04' can not be used together at the same time.
They use the same WSL distribution ID, so the second that is used will not be installed
as the first one will be found as already installed by WSL distribution ID.
Valid values: 'Alpine', 'Debian', 'kali-linux', 'openSUSE-Leap-15.2', 'Ubuntu-22.04', 'Ubuntu-20.04', 'Ubuntu-18.04', 'Ubuntu-16.04'
required: false
default: Debian
Expand Down
4 changes: 4 additions & 0 deletions readme/README_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ The first installed WSL distribution is automatically the default one, independe

Either way, the wsl-shell wrapper scripts are created or overwritten according to the current action configuration.

`Ubuntu-22.04` and `Ubuntu-20.04` can not be used together at the same time. They use the same WSL distribution ID,
so the second that is used will not be installed as the first one will be found as already installed by
WSL distribution ID.

The values currently supported by this action are:
* `Debian` **(default)**
* `Alpine`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,12 @@ abstract class AptGetBasedDistribution : Distribution {
}

object Ubuntu2204 : AptGetBasedDistribution(
wslId = "Ubuntu-22.04",
wslId = "Ubuntu",
userId = "Ubuntu-22.04",
distributionName = "Ubuntu",
version = SemVer("22.4.0", jsObject<SemVerRangeOptions>()),
downloadUrl = URL("https://aka.ms/wslubuntu2204"),
installerFile = "ubuntu2204.exe"
installerFile = "ubuntu.exe"
)

object Ubuntu2004 : AptGetBasedDistribution(
Expand Down

0 comments on commit 6ae2757

Please sign in to comment.