diff --git a/.github/workflows/foo.main.kts b/.github/workflows/foo.main.kts new file mode 100644 index 00000000..489233dd --- /dev/null +++ b/.github/workflows/foo.main.kts @@ -0,0 +1,112 @@ +#!/usr/bin/env kotlin + +@file:DependsOn("it.krzeminski:github-actions-kotlin-dsl:0.40.0") + +import it.krzeminski.githubactions.actions.actions.CacheRestoreV3 +import it.krzeminski.githubactions.actions.actions.CacheSaveV3 +import it.krzeminski.githubactions.actions.actions.CheckoutV3 +import it.krzeminski.githubactions.actions.actions.SetupJavaV3 +import it.krzeminski.githubactions.actions.actions.SetupJavaV3.Distribution.Temurin +import it.krzeminski.githubactions.actions.burrunan.GradleCacheActionV1 +import it.krzeminski.githubactions.actions.vampire.SetupWslV2 +import it.krzeminski.githubactions.actions.vampire.SetupWslV2.Distribution +import it.krzeminski.githubactions.domain.RunnerType.WindowsLatest +import it.krzeminski.githubactions.domain.Shell +import it.krzeminski.githubactions.domain.actions.CustomAction +import it.krzeminski.githubactions.domain.triggers.Push +import it.krzeminski.githubactions.dsl.expressions.expr +import it.krzeminski.githubactions.dsl.workflow +import it.krzeminski.githubactions.yaml.writeToFile + +workflow( + name = "Debug", + on = listOf(Push()), + sourceFile = __FILE__.toPath() +) { + val builtArtifacts = listOf( + "action.yml", + "build/distributions/" + ) + + val build = job( + id = "build", + name = "Build", + runsOn = WindowsLatest + ) { + run( + name = "Configure Git", + command = "git config --global core.autocrlf input" + ) + uses( + name = "Checkout", + action = CheckoutV3() + ) + uses( + name = "Setup Java 11", + action = SetupJavaV3( + javaVersion = "11", + distribution = Temurin + ) + ) + uses( + name = "Build", + action = GradleCacheActionV1( + arguments = listOf( + "--show-version", + "build", + "--info", + "--stacktrace", + "--scan" + ), + debug = false, + concurrent = true + ) + ) + uses( + name = "Save built artifacts to cache", + action = CacheSaveV3( + path = builtArtifacts, + key = expr { github.run_id } + ) + ) + } + + job( + id = "test", + name = "Test", + needs = listOf(build), + runsOn = WindowsLatest + ) { + uses( + name = "Restore built artifacts from cache", + action = CacheRestoreV3( + path = builtArtifacts, + key = expr { github.run_id }, + failOnCacheMiss = true + ) + ) + uses( + name = "Execute action", + action = SetupWslV2( + distribution = Distribution.Debian + ), + _customArguments = mapOf( + "uses" to "./" + ) + ) + uses( + name = "Setup tmate session", + action = CustomAction( + actionOwner = "mxschmitt", + actionName = "action-tmate", + actionVersion = "v3", + inputs = emptyMap() + ) + ) + run( + name = "Test - action should fail if an invalid distribution is given", + shell = Shell.Custom("wsl-bash {0}"), + command = "true" + ) + } +}.writeToFile() diff --git a/.github/workflows/foo.yaml b/.github/workflows/foo.yaml new file mode 100644 index 00000000..7aeb5356 --- /dev/null +++ b/.github/workflows/foo.yaml @@ -0,0 +1,87 @@ +# This file was generated using Kotlin DSL (.github/workflows/foo.main.kts). +# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file. +# Generated with https://github.com/krzema12/github-workflows-kt + +name: Debug +on: + push: {} +jobs: + check_yaml_consistency: + name: Check YAML consistency + runs-on: ubuntu-latest + steps: + - id: step-0 + name: Check out + uses: actions/checkout@v3 + - id: step-1 + name: Execute script + run: rm '.github/workflows/foo.yaml' && '.github/workflows/foo.main.kts' + - id: step-2 + name: Consistency check + run: git diff --exit-code '.github/workflows/foo.yaml' + build: + name: Build + runs-on: windows-latest + needs: + - check_yaml_consistency + steps: + - id: step-0 + name: Configure Git + run: git config --global core.autocrlf input + - id: step-1 + name: Checkout + uses: actions/checkout@v3 + - id: step-2 + name: Setup Java 11 + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: temurin + - id: step-3 + name: Build + uses: burrunan/gradle-cache-action@v1 + with: + debug: false + concurrent: true + arguments: |- + --show-version + build + --info + --stacktrace + --scan + - id: step-4 + name: Save built artifacts to cache + uses: actions/cache/save@v3 + with: + path: |- + action.yml + build/distributions/ + key: ${{ github.run_id }} + test: + name: Test + runs-on: windows-latest + needs: + - build + - check_yaml_consistency + steps: + - id: step-0 + name: Restore built artifacts from cache + uses: actions/cache/restore@v3 + with: + path: |- + action.yml + build/distributions/ + key: ${{ github.run_id }} + fail-on-cache-miss: true + - id: step-1 + name: Execute action + uses: ./ + with: + distribution: Debian + - id: step-2 + name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - id: step-3 + name: Test - action should fail if an invalid distribution is given + shell: wsl-bash {0} + run: true diff --git a/.github/workflows/test.main.kts b/.github/workflows/test.main.kts index 7d6933d0..c1ec97a8 100755 --- a/.github/workflows/test.main.kts +++ b/.github/workflows/test.main.kts @@ -69,6 +69,20 @@ val kali = mapOf( "default-absent-tool" to "dos2unix" ) +val openSuseTumbleweed = mapOf( + "wsl-id" to "openSUSE-Tumbleweed", + "user-id" to "openSUSE-Tumbleweed", + "match-pattern" to "*openSUSE*Tumbleweed*", + "default-absent-tool" to "zsh" +) + +val openSuseLeap15_3 = mapOf( + "wsl-id" to "openSUSE-Leap-15.3", + "user-id" to "openSUSE-Leap-15.3", + "match-pattern" to "*openSUSE*Leap*15.3*", + "default-absent-tool" to "zsh" +) + val openSuseLeap15_2 = mapOf( "wsl-id" to "openSUSE-Leap-15.2", "user-id" to "openSUSE-Leap-15.2", @@ -108,6 +122,8 @@ val distributions = listOf( debian, alpine, kali, + openSuseTumbleweed, + openSuseLeap15_3, openSuseLeap15_2, ubuntu2204, ubuntu2004, diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3a1f3be2..bf1e13df 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -344,6 +344,14 @@ jobs: user-id: kali-linux match-pattern: '*Kali*' default-absent-tool: dos2unix + - wsl-id: openSUSE-Tumbleweed + user-id: openSUSE-Tumbleweed + match-pattern: '*openSUSE*Tumbleweed*' + default-absent-tool: zsh + - wsl-id: openSUSE-Leap-15.3 + user-id: openSUSE-Leap-15.3 + match-pattern: '*openSUSE*Leap*15.3*' + default-absent-tool: zsh - wsl-id: openSUSE-Leap-15.2 user-id: openSUSE-Leap-15.2 match-pattern: '*openSUSE*Leap*15.2*' @@ -836,6 +844,14 @@ jobs: user-id: kali-linux match-pattern: '*Kali*' default-absent-tool: dos2unix + - wsl-id: openSUSE-Tumbleweed + user-id: openSUSE-Tumbleweed + match-pattern: '*openSUSE*Tumbleweed*' + default-absent-tool: zsh + - wsl-id: openSUSE-Leap-15.3 + user-id: openSUSE-Leap-15.3 + match-pattern: '*openSUSE*Leap*15.3*' + default-absent-tool: zsh - wsl-id: openSUSE-Leap-15.2 user-id: openSUSE-Leap-15.2 match-pattern: '*openSUSE*Leap*15.2*' @@ -936,6 +952,14 @@ jobs: user-id: kali-linux match-pattern: '*Kali*' default-absent-tool: dos2unix + - wsl-id: openSUSE-Tumbleweed + user-id: openSUSE-Tumbleweed + match-pattern: '*openSUSE*Tumbleweed*' + default-absent-tool: zsh + - wsl-id: openSUSE-Leap-15.3 + user-id: openSUSE-Leap-15.3 + match-pattern: '*openSUSE*Leap*15.3*' + default-absent-tool: zsh - wsl-id: openSUSE-Leap-15.2 user-id: openSUSE-Leap-15.2 match-pattern: '*openSUSE*Leap*15.2*' @@ -1069,6 +1093,14 @@ jobs: user-id: kali-linux match-pattern: '*Kali*' default-absent-tool: dos2unix + - wsl-id: openSUSE-Tumbleweed + user-id: openSUSE-Tumbleweed + match-pattern: '*openSUSE*Tumbleweed*' + default-absent-tool: zsh + - wsl-id: openSUSE-Leap-15.3 + user-id: openSUSE-Leap-15.3 + match-pattern: '*openSUSE*Leap*15.3*' + default-absent-tool: zsh - wsl-id: openSUSE-Leap-15.2 user-id: openSUSE-Leap-15.2 match-pattern: '*openSUSE*Leap*15.2*' @@ -1298,6 +1330,14 @@ jobs: user-id: kali-linux match-pattern: '*Kali*' default-absent-tool: dos2unix + - wsl-id: openSUSE-Tumbleweed + user-id: openSUSE-Tumbleweed + match-pattern: '*openSUSE*Tumbleweed*' + default-absent-tool: zsh + - wsl-id: openSUSE-Leap-15.3 + user-id: openSUSE-Leap-15.3 + match-pattern: '*openSUSE*Leap*15.3*' + default-absent-tool: zsh - wsl-id: openSUSE-Leap-15.2 user-id: openSUSE-Leap-15.2 match-pattern: '*openSUSE*Leap*15.2*' @@ -1509,21 +1549,31 @@ jobs: match-pattern: '*Kali*' default-absent-tool: dos2unix distribution4: + wsl-id: openSUSE-Tumbleweed + user-id: openSUSE-Tumbleweed + match-pattern: '*openSUSE*Tumbleweed*' + default-absent-tool: zsh + distribution5: + wsl-id: openSUSE-Leap-15.3 + user-id: openSUSE-Leap-15.3 + match-pattern: '*openSUSE*Leap*15.3*' + default-absent-tool: zsh + distribution6: wsl-id: openSUSE-Leap-15.2 user-id: openSUSE-Leap-15.2 match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: which - distribution5: + distribution7: wsl-id: Ubuntu user-id: Ubuntu-20.04 match-pattern: '*Ubuntu*20.04*' default-absent-tool: dos2unix - distribution6: + distribution8: wsl-id: Ubuntu-18.04 user-id: Ubuntu-18.04 match-pattern: '*Ubuntu*18.04*' default-absent-tool: dos2unix - distribution7: + distribution9: wsl-id: Ubuntu-16.04 user-id: Ubuntu-16.04 match-pattern: '*Ubuntu*16.04*' @@ -1544,21 +1594,31 @@ jobs: match-pattern: '*Kali*' default-absent-tool: dos2unix distribution4: + wsl-id: openSUSE-Tumbleweed + user-id: openSUSE-Tumbleweed + match-pattern: '*openSUSE*Tumbleweed*' + default-absent-tool: zsh + distribution5: + wsl-id: openSUSE-Leap-15.3 + user-id: openSUSE-Leap-15.3 + match-pattern: '*openSUSE*Leap*15.3*' + default-absent-tool: zsh + distribution6: wsl-id: openSUSE-Leap-15.2 user-id: openSUSE-Leap-15.2 match-pattern: '*openSUSE*Leap*15.2*' default-absent-tool: which - distribution5: + distribution7: wsl-id: Ubuntu user-id: Ubuntu-22.04 match-pattern: '*Ubuntu*22.04*' default-absent-tool: dos2unix - distribution6: + distribution8: wsl-id: Ubuntu-18.04 user-id: Ubuntu-18.04 match-pattern: '*Ubuntu*18.04*' default-absent-tool: dos2unix - distribution7: + distribution9: wsl-id: Ubuntu-16.04 user-id: Ubuntu-16.04 match-pattern: '*Ubuntu*16.04*' @@ -1615,6 +1675,18 @@ jobs: distribution: ${{ matrix.distributions.distribution7.user-id }} set-as-default: false - id: step-8 + name: Execute action for ${{ matrix.distributions.distribution8.user-id }} + uses: ./ + with: + distribution: ${{ matrix.distributions.distribution8.user-id }} + set-as-default: false + - id: step-9 + name: Execute action for ${{ matrix.distributions.distribution9.user-id }} + uses: ./ + with: + distribution: ${{ matrix.distributions.distribution9.user-id }} + set-as-default: false + - id: step-10 name: Test - wsl-bash_${{ matrix.distributions.distribution1.user-id }} should use the correct distribution shell: wsl-bash_Debian {0} run: |- @@ -1623,7 +1695,7 @@ jobs: if: |- always() && (steps.step-1.outcome == 'success') - - id: step-9 + - id: step-11 name: Test - wsl-bash_${{ matrix.distributions.distribution2.user-id }} should use the correct distribution shell: wsl-bash_Alpine {0} run: |- @@ -1632,7 +1704,7 @@ jobs: if: |- always() && (steps.step-2.outcome == 'success') - - id: step-10 + - id: step-12 name: Test - wsl-bash_${{ matrix.distributions.distribution3.user-id }} should use the correct distribution shell: wsl-bash_kali-linux {0} run: |- @@ -1641,18 +1713,18 @@ jobs: if: |- always() && (steps.step-3.outcome == 'success') - - id: step-11 + - id: step-13 name: Test - wsl-bash_${{ matrix.distributions.distribution4.user-id }} should use the correct distribution - shell: wsl-bash_openSUSE-Leap-15.2 {0} + shell: wsl-bash_openSUSE-Tumbleweed {0} run: |- cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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) [[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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.distribution4.match-pattern }} ]] if: |- always() && (steps.step-4.outcome == 'success') - - id: step-12 + - id: step-14 name: Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution - shell: wsl-bash_Ubuntu-22.04 {0} + shell: wsl-bash_openSUSE-Leap-15.3 {0} run: |- cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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) [[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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.distribution5.match-pattern }} ]] @@ -1660,9 +1732,9 @@ jobs: always() && (steps.step-5.outcome == 'success') && (matrix.distributions.distribution5.user-id != 'Ubuntu-20.04') - - id: step-13 + - id: step-15 name: Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution - shell: wsl-bash_Ubuntu-20.04 {0} + shell: wsl-bash_openSUSE-Leap-15.2 {0} run: |- cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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) [[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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.distribution5.match-pattern }} ]] @@ -1670,21 +1742,39 @@ jobs: always() && (steps.step-5.outcome == 'success') && (matrix.distributions.distribution5.user-id != 'Ubuntu-22.04') - - id: step-14 + - id: step-16 name: Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should use the correct distribution - shell: wsl-bash_Ubuntu-18.04 {0} + shell: wsl-bash_Ubuntu-22.04 {0} run: |- cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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) [[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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 }} ]] if: |- always() && (steps.step-6.outcome == 'success') - - id: step-15 + - id: step-17 name: Test - wsl-bash_${{ matrix.distributions.distribution7.user-id }} should use the correct distribution - shell: wsl-bash_Ubuntu-16.04 {0} + shell: wsl-bash_Ubuntu-20.04 {0} run: |- cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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) [[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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 }} ]] if: |- always() && (steps.step-7.outcome == 'success') + - id: step-18 + name: Test - wsl-bash_${{ matrix.distributions.distribution8.user-id }} should use the correct distribution + shell: wsl-bash_Ubuntu-18.04 {0} + run: |- + cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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) + [[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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 }} ]] + if: |- + always() + && (steps.step-8.outcome == 'success') + - id: step-19 + name: Test - wsl-bash_${{ matrix.distributions.distribution9.user-id }} should use the correct distribution + shell: wsl-bash_Ubuntu-16.04 {0} + run: |- + cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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) + [[ "$(cat <(lsb_release -a || true) <(uname -a || true) <([ -d /etc ] && find /etc -maxdepth 1 -type f \( -name '*release' -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.distribution9.match-pattern }} ]] + if: |- + always() + && (steps.step-9.outcome == 'success') diff --git a/README.md b/README.md index b6c793cd..f4a6d29b 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,8 @@ The values currently supported by this action are: * `Debian` **(default)** * `Alpine` * `kali-linux` +* `openSUSE-Tumbleweed` +* `openSUSE-Leap-15.3` * `openSUSE-Leap-15.2` * `Ubuntu-22.04` * `Ubuntu-20.04` diff --git a/action-types.yml b/action-types.yml index 2a8a10b7..78f9324c 100644 --- a/action-types.yml +++ b/action-types.yml @@ -20,6 +20,8 @@ inputs: - Alpine - Debian - kali-linux + - openSUSE-Tumbleweed + - openSUSE-Leap-15.3 - openSUSE-Leap-15.2 - Ubuntu-22.04 - Ubuntu-20.04 diff --git a/action.yml b/action.yml index ca6c59ec..12429d4c 100644 --- a/action.yml +++ b/action.yml @@ -27,7 +27,7 @@ inputs: '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' + Valid values: 'Alpine', 'Debian', 'kali-linux', 'openSUSE-Tumbleweed', 'openSUSE-Leap-15.3', 'openSUSE-Leap-15.2', 'Ubuntu-22.04', 'Ubuntu-20.04', 'Ubuntu-18.04', 'Ubuntu-16.04' required: false default: Debian diff --git a/readme/README.md.sha256 b/readme/README.md.sha256 index f290951d..a19c3834 100644 --- a/readme/README.md.sha256 +++ b/readme/README.md.sha256 @@ -1 +1 @@ -6e918171450049acd2499bb0cb4984d897b5f3fc04842865cd2b78eb39f15642 \ No newline at end of file +18f532831612fe81b01d3c7bf784b80845f45e177e814bd2f52c53b67b31d92d \ No newline at end of file diff --git a/readme/README_template.md b/readme/README_template.md index a2dd9867..4cd069ce 100644 --- a/readme/README_template.md +++ b/readme/README_template.md @@ -155,6 +155,8 @@ The values currently supported by this action are: * `Debian` **(default)** * `Alpine` * `kali-linux` +* `openSUSE-Tumbleweed` +* `openSUSE-Leap-15.3` * `openSUSE-Leap-15.2` * `Ubuntu-22.04` * `Ubuntu-20.04` diff --git a/src/main/kotlin/net/kautler/github/action/setup_wsl/Distribution.kt b/src/main/kotlin/net/kautler/github/action/setup_wsl/Distribution.kt index fefc7cc9..1d4acb23 100644 --- a/src/main/kotlin/net/kautler/github/action/setup_wsl/Distribution.kt +++ b/src/main/kotlin/net/kautler/github/action/setup_wsl/Distribution.kt @@ -35,6 +35,8 @@ val distributions = listOf( Alpine, Debian, Kali, + OpenSuseTumbleweed, + OpenSuseLeap15_3, OpenSuseLeap15_2, Ubuntu1604, Ubuntu1804, @@ -260,7 +262,7 @@ object Kali : AptGetBasedDistribution( wslId = "kali-linux", distributionName = "Kali", version = SemVer("1.0.0", jso()), - productId = "9pkr34tncv07", + downloadUrl = URL("https://aka.ms/wsl-kali-linux-new"), installerFile = "kali.exe" ) @@ -307,6 +309,7 @@ abstract class ZypperBasedDistribution : Distribution { wslId, "zypper", "--non-interactive", + "--gpg-auto-import-keys", "refresh" ) ) @@ -342,11 +345,51 @@ abstract class ZypperBasedDistribution : Distribution { } } +object OpenSuseTumbleweed : ZypperBasedDistribution( + wslId = "openSUSE-Tumbleweed", + distributionName = "openSUSE Tumbleweed", + version = SemVer("15.2.0", jso()), + downloadUrl = URL("https://aka.ms/wsl-opensuse-tumbleweed"), + installerFile = "openSUSE-Tumbleweed.exe" +) { + override suspend fun refresh() { + retry(5) { + super.refresh() + } + } + + override suspend fun update() { + retry(5) { + super.update() + } + } +} + +object OpenSuseLeap15_3 : ZypperBasedDistribution( + wslId = "openSUSE-Leap-15.3", + distributionName = "openSUSE Leap", + version = SemVer("15.3.0", jso()), + downloadUrl = URL("https://aka.ms/wsl-opensuseleap15-3"), + installerFile = "openSUSE-Leap-15.3.exe" +) { + override suspend fun refresh() { + retry(5) { + super.refresh() + } + } + + override suspend fun update() { + retry(5) { + super.update() + } + } +} + object OpenSuseLeap15_2 : ZypperBasedDistribution( wslId = "openSUSE-Leap-15.2", distributionName = "openSUSE Leap", version = SemVer("15.2.0", jso()), - productId = "9mzd0n9z4m4h", + downloadUrl = URL("https://aka.ms/wsl-opensuseleap15-2"), installerFile = "openSUSE-Leap-15.2.exe" ) { override suspend fun refresh() {