diff --git a/.github/workflows/check-action-typing.main.kts b/.github/workflows/check-action-typing.main.kts index 8fd3788d7..2631d1139 100755 --- a/.github/workflows/check-action-typing.main.kts +++ b/.github/workflows/check-action-typing.main.kts @@ -18,11 +18,11 @@ @file:Import("workflow-with-copyright.main.kts") -import it.krzeminski.githubactions.actions.actions.CheckoutV3 -import it.krzeminski.githubactions.actions.krzema12.GithubActionsTypingV1 -import it.krzeminski.githubactions.domain.RunnerType.UbuntuLatest -import it.krzeminski.githubactions.domain.triggers.PullRequest -import it.krzeminski.githubactions.domain.triggers.Push +import io.github.typesafegithub.workflows.actions.actions.CheckoutV3 +import io.github.typesafegithub.workflows.actions.typesafegithub.GithubActionsTypingV1 +import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest +import io.github.typesafegithub.workflows.domain.triggers.PullRequest +import io.github.typesafegithub.workflows.domain.triggers.Push workflowWithCopyright( name = "Check Action Typing", diff --git a/.github/workflows/check-action-typing.yaml b/.github/workflows/check-action-typing.yaml index 3801329e6..e8afd0420 100644 --- a/.github/workflows/check-action-typing.yaml +++ b/.github/workflows/check-action-typing.yaml @@ -14,38 +14,38 @@ # This file was generated using Kotlin DSL (.github/workflows/check-action-typing.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 +# Generated with https://github.com/typesafegithub/github-workflows-kt -name: Check Action Typing +name: 'Check Action Typing' on: push: {} pull_request: {} jobs: check_yaml_consistency: - name: Check YAML consistency - runs-on: ubuntu-latest + 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/check-action-typing.yaml' && '.github/workflows/check-action-typing.main.kts' - - id: step-2 - name: Consistency check - run: git diff --exit-code '.github/workflows/check-action-typing.yaml' + - id: 'step-0' + name: 'Check out' + uses: 'actions/checkout@v4' + - id: 'step-1' + name: 'Execute script' + run: 'rm ''.github/workflows/check-action-typing.yaml'' && ''.github/workflows/check-action-typing.main.kts''' + - id: 'step-2' + name: 'Consistency check' + run: 'git diff --exit-code ''.github/workflows/check-action-typing.yaml''' check_action_typing: - name: Check Action Typing - runs-on: ubuntu-latest + name: 'Check Action Typing' + runs-on: 'ubuntu-latest' needs: - - check_yaml_consistency + - '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: Check Action Typing - uses: krzema12/github-actions-typing@v1 + - 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: 'Check Action Typing' + uses: 'typesafegithub/github-actions-typing@v1' diff --git a/.github/workflows/check-dependency-versions.main.kts b/.github/workflows/check-dependency-versions.main.kts index 75cce4c75..27705d447 100755 --- a/.github/workflows/check-dependency-versions.main.kts +++ b/.github/workflows/check-dependency-versions.main.kts @@ -18,13 +18,13 @@ @file:Import("workflow-with-copyright.main.kts") -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.domain.RunnerType.WindowsLatest -import it.krzeminski.githubactions.domain.triggers.Cron -import it.krzeminski.githubactions.domain.triggers.Schedule +import io.github.typesafegithub.workflows.actions.actions.CheckoutV3 +import io.github.typesafegithub.workflows.actions.actions.SetupJavaV3 +import io.github.typesafegithub.workflows.actions.actions.SetupJavaV3.Distribution.Temurin +import io.github.typesafegithub.workflows.actions.burrunan.GradleCacheActionV1 +import io.github.typesafegithub.workflows.domain.RunnerType.WindowsLatest +import io.github.typesafegithub.workflows.domain.triggers.Cron +import io.github.typesafegithub.workflows.domain.triggers.Schedule workflowWithCopyright( name = "Check Dependency Versions", diff --git a/.github/workflows/check-dependency-versions.yaml b/.github/workflows/check-dependency-versions.yaml index e7d59370d..8704107e2 100644 --- a/.github/workflows/check-dependency-versions.yaml +++ b/.github/workflows/check-dependency-versions.yaml @@ -14,50 +14,50 @@ # This file was generated using Kotlin DSL (.github/workflows/check-dependency-versions.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 +# Generated with https://github.com/typesafegithub/github-workflows-kt -name: Check Dependency Versions +name: 'Check Dependency Versions' on: schedule: - - cron: 0 0 * * FRI + - cron: '0 0 * * FRI' jobs: check_yaml_consistency: - name: Check YAML consistency - runs-on: ubuntu-latest + 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/check-dependency-versions.yaml' && '.github/workflows/check-dependency-versions.main.kts' - - id: step-2 - name: Consistency check - run: git diff --exit-code '.github/workflows/check-dependency-versions.yaml' + - id: 'step-0' + name: 'Check out' + uses: 'actions/checkout@v4' + - id: 'step-1' + name: 'Execute script' + run: 'rm ''.github/workflows/check-dependency-versions.yaml'' && ''.github/workflows/check-dependency-versions.main.kts''' + - id: 'step-2' + name: 'Consistency check' + run: 'git diff --exit-code ''.github/workflows/check-dependency-versions.yaml''' check_dependency_versions: - name: Check Dependency Versions - runs-on: windows-latest + name: 'Check Dependency Versions' + runs-on: 'windows-latest' needs: - - check_yaml_consistency + - '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 + - 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: Check Dependency Versions - uses: burrunan/gradle-cache-action@v1 + java-version: '11' + distribution: 'temurin' + - id: 'step-3' + name: 'Check Dependency Versions' + uses: 'burrunan/gradle-cache-action@v1' with: - debug: false - concurrent: true + debug: 'false' + concurrent: 'true' arguments: |- --show-version dependencyUpdates diff --git a/.github/workflows/test.main.kts b/.github/workflows/test.main.kts index a27609746..b3e80f1d5 100755 --- a/.github/workflows/test.main.kts +++ b/.github/workflows/test.main.kts @@ -18,29 +18,30 @@ @file:Import("workflow-with-copyright.main.kts") -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.SetupWslV1 -import it.krzeminski.githubactions.actions.vampire.SetupWslV1.Distribution -import it.krzeminski.githubactions.domain.CommandStep -import it.krzeminski.githubactions.domain.ExternalActionStep -import it.krzeminski.githubactions.domain.JobOutputs.EMPTY -import it.krzeminski.githubactions.domain.RunnerType -import it.krzeminski.githubactions.domain.RunnerType.WindowsLatest -import it.krzeminski.githubactions.domain.Shell -import it.krzeminski.githubactions.domain.Shell.Cmd -import it.krzeminski.githubactions.domain.Step -import it.krzeminski.githubactions.domain.triggers.Cron -import it.krzeminski.githubactions.domain.triggers.PullRequest -import it.krzeminski.githubactions.domain.triggers.Push -import it.krzeminski.githubactions.domain.triggers.Schedule -import it.krzeminski.githubactions.dsl.JobBuilder -import it.krzeminski.githubactions.dsl.WorkflowBuilder -import it.krzeminski.githubactions.dsl.expressions.expr +import io.github.typesafegithub.workflows.actions.actions.CacheRestoreV4 +import io.github.typesafegithub.workflows.actions.actions.CacheSaveV4 +import io.github.typesafegithub.workflows.actions.actions.CheckoutV4 +import io.github.typesafegithub.workflows.actions.actions.SetupJavaV4 +import io.github.typesafegithub.workflows.actions.actions.SetupJavaV4.Distribution.Temurin +import io.github.typesafegithub.workflows.actions.burrunan.GradleCacheActionV1 +import io.github.typesafegithub.workflows.actions.vampire.SetupWslV3 +import io.github.typesafegithub.workflows.actions.vampire.SetupWslV3.Distribution +import io.github.typesafegithub.workflows.domain.CommandStep +import io.github.typesafegithub.workflows.domain.ActionStep +import io.github.typesafegithub.workflows.domain.JobOutputs.EMPTY +import io.github.typesafegithub.workflows.domain.AbstractResult.Status.Success +import io.github.typesafegithub.workflows.domain.RunnerType +import io.github.typesafegithub.workflows.domain.RunnerType.WindowsLatest +import io.github.typesafegithub.workflows.domain.Shell +import io.github.typesafegithub.workflows.domain.Shell.Cmd +import io.github.typesafegithub.workflows.domain.Step +import io.github.typesafegithub.workflows.domain.triggers.Cron +import io.github.typesafegithub.workflows.domain.triggers.PullRequest +import io.github.typesafegithub.workflows.domain.triggers.Push +import io.github.typesafegithub.workflows.domain.triggers.Schedule +import io.github.typesafegithub.workflows.dsl.JobBuilder +import io.github.typesafegithub.workflows.dsl.WorkflowBuilder +import io.github.typesafegithub.workflows.dsl.expressions.expr import kotlin.math.min val environments = listOf( @@ -77,6 +78,13 @@ val openSuseLeap15_2 = mapOf( "default-absent-tool" to "which" ) +val ubuntu2404 = mapOf( + "wsl-id" to "Ubuntu-24.04", + "user-id" to "Ubuntu-24.04", + "match-pattern" to "*Ubuntu*24.04*", + "default-absent-tool" to "dos2unix" +) + val ubuntu2204 = mapOf( "wsl-id" to "Ubuntu", "user-id" to "Ubuntu-22.04", @@ -107,10 +115,10 @@ val ubuntu1604 = mapOf( val distributions = listOf( debian, - // disable testing on Alpine for the time being due to https://github.com/Vampire/setup-wsl/issues/50 - //alpine, + alpine, kali, openSuseLeap15_2, + ubuntu2404, ubuntu2204, ubuntu2004, ubuntu1804, @@ -121,7 +129,7 @@ val wslBash = Shell.Custom("wsl-bash {0}") val wslSh = Shell.Custom("wsl-sh {0}") -lateinit var executeActionStep: ExternalActionStep +lateinit var executeActionStep: ActionStep workflowWithCopyright( name = "Build and Test", @@ -137,7 +145,7 @@ workflowWithCopyright( "build/distributions/" ) - val executeAction = SetupWslV1( + val executeAction = SetupWslV3( distribution = Distribution.Custom(expr("matrix.distribution.user-id")) ) @@ -152,11 +160,11 @@ workflowWithCopyright( ) uses( name = "Checkout", - action = CheckoutV3() + action = CheckoutV4() ) uses( name = "Setup Java 11", - action = SetupJavaV3( + action = SetupJavaV4( javaVersion = "11", distribution = Temurin ) @@ -177,7 +185,7 @@ workflowWithCopyright( ) uses( name = "Save built artifacts to cache", - action = CacheSaveV3( + action = CacheSaveV4( path = builtArtifacts, key = expr { github.run_id } ) @@ -198,7 +206,7 @@ workflowWithCopyright( ) { uses( name = "Restore built artifacts from cache", - action = CacheRestoreV3( + action = CacheRestoreV4( path = builtArtifacts, key = expr { github.run_id }, failOnCacheMiss = true @@ -240,7 +248,7 @@ workflowWithCopyright( run( name = "Test - action should fail if an invalid distribution is given", shell = Cmd, - command = "if '${expr(executeActionStep.outcome)}' NEQ 'failure' exit 1" + command = "if '${expr("${executeActionStep.outcome}")}' NEQ 'failure' exit 1" ) } @@ -258,7 +266,7 @@ workflowWithCopyright( ) ) { executeActionStep = usesSelf( - action = SetupWslV1( + action = SetupWslV3( update = true ) ) @@ -554,7 +562,8 @@ workflowWithCopyright( ) runAfterSuccess( name = "Test - /etc/wsl.conf should not exist", - command = "[ ! -f /etc/wsl.conf ]" + command = "[ ! -f /etc/wsl.conf ] || { cat /etc/wsl.conf; false; }", + conditionTransformer = { executeActionStep.successNotOnUbuntu2404Condition } ) runAfterSuccess( name = "Test - C: should be mounted at /mnt/c", @@ -677,26 +686,26 @@ workflowWithCopyright( ) { usesSelf( name = "Execute action for ${expr("matrix.distributions.distribution1.user-id")}", - action = SetupWslV1( + action = SetupWslV3( distribution = Distribution.Custom(expr("matrix.distributions.distribution1.user-id")) ) ) usesSelf( name = "Execute action for ${expr("matrix.distributions.distribution2.user-id")}", - action = SetupWslV1( + action = SetupWslV3( distribution = Distribution.Custom(expr("matrix.distributions.distribution2.user-id")) ) ) usesSelf( name = "Execute action for ${expr("matrix.distributions.distribution3.user-id")}", - action = SetupWslV1( + action = SetupWslV3( distribution = Distribution.Custom(expr("matrix.distributions.distribution3.user-id")), setAsDefault = false ) ) executeActionStep = usesSelf( name = "Execute action for ${expr("matrix.distributions.distribution1.user-id")} again", - action = SetupWslV1( + action = SetupWslV3( distribution = Distribution.Custom(expr("matrix.distributions.distribution1.user-id")) ) ) @@ -770,7 +779,7 @@ workflowWithCopyright( ) executeActionStep = usesSelfAfterSuccess( name = "Execute action for ${expr("matrix.distribution2.user-id")}", - action = SetupWslV1( + action = SetupWslV3( distribution = Distribution.Custom(expr("matrix.distribution2.user-id")) ) ) @@ -799,7 +808,7 @@ workflowWithCopyright( testJob( id = "test_distribution_specific_wsl_bash_scripts", - name = "Test distribution specific wsl-bash scripts on ${expr("matrix.environment")}", + name = "Test distribution specific wsl-bash scripts on ${expr("matrix.environment")} (without ${expr("matrix.distributions.incompatibleUbuntu")})", _customArguments = mapOf( "strategy" to mapOf( "fail-fast" to false, @@ -812,9 +821,13 @@ workflowWithCopyright( .map { incompatibleUbuntu -> distributions .filter { it != incompatibleUbuntu } - .mapIndexed { i, distribution -> + .mapIndexed, Pair> { i, distribution -> "distribution${i + 1}" to distribution } + .toMutableList() + .apply { + add(0, "incompatibleUbuntu" to incompatibleUbuntu["user-id"]!!) + } .toMap() } ) @@ -825,7 +838,7 @@ workflowWithCopyright( .associateWith { usesSelf( name = "Execute action for ${expr("matrix.distributions.distribution$it.user-id")}", - action = SetupWslV1( + action = SetupWslV3( distribution = Distribution.Custom(expr("matrix.distributions.distribution$it.user-id")), additionalPackages = if (it == 2) listOf("bash") else null, setAsDefault = if (it >= 3) false else null @@ -837,7 +850,7 @@ workflowWithCopyright( verifyInstalledDistribution( name = "Test - wsl-bash_${expr("matrix.distributions.distribution$i.user-id")} should use the correct distribution", conditionTransformer = if (distributions[i] == ubuntu2004) { - { executeActionStep.getSuccessNotOnUbuntu2004Condition(i) } + { executeActionStep.getSuccessNotOnDistributionCondition(i, "Ubuntu-20.04") } } else { { it } }, @@ -849,7 +862,7 @@ workflowWithCopyright( if (distributions[i] == ubuntu2004) { verifyInstalledDistribution( name = "Test - wsl-bash_${expr("matrix.distributions.distribution$i.user-id")} should use the correct distribution", - conditionTransformer = { executeActionStep.getSuccessNotOnUbuntu2204Condition(i) }, + conditionTransformer = { executeActionStep.getSuccessNotOnDistributionCondition(i, "Ubuntu-22.04") }, shell = Shell.Custom("wsl-bash_${distributions[i]["user-id"]} {0}"), expectedPatternExpression = "matrix.distributions.distribution$i.match-pattern" ) @@ -871,7 +884,7 @@ fun JobBuilder<*>.commonTests() { // do not just rely on false here, but explicitly use exit // in case failing commands do not make the script fail // and use "shell = Cmd" to capture that the wrapper script is hiding errors - "IF '${expr(provocationStep.outcome)}' NEQ 'failure' EXIT /B 1" + "IF '${expr("${provocationStep.outcome}") }' NEQ 'failure' EXIT /B 1" } ) verifyFailure( @@ -917,7 +930,7 @@ fun JobBuilder<*>.commonTests() { fun JobBuilder<*>.usesSelfAfterSuccess( name: String = "Execute action", - action: SetupWslV1 + action: SetupWslV3 ) = usesSelf( name = name, action = action, @@ -926,7 +939,7 @@ fun JobBuilder<*>.usesSelfAfterSuccess( fun JobBuilder<*>.usesSelf( name: String = "Execute action", - action: SetupWslV1, + action: SetupWslV3, condition: String? = null, continueOnError: Boolean? = null ) = uses( @@ -988,7 +1001,7 @@ fun JobBuilder<*>.verifyFailure( shell = verificationShell, command = verificationTransformer( provocationStep, - "[ '${expr(provocationStep.outcome)}' == 'failure' ]" + "[ '${expr("${provocationStep.outcome}")}' == 'failure' ]" ) ) } @@ -1047,26 +1060,25 @@ fun JobBuilder<*>.verifyCommandResult( val Step.successCondition get() = """ always() - && ($outcome == 'success') + && (${outcome.eq(Success)}) """.trimIndent() val Step.successOnAlpineCondition get() = """ always() - && ($outcome == 'success') + && (${outcome.eq(Success)}) && (matrix.distribution.user-id == 'Alpine') """.trimIndent() -fun Step.getSuccessNotOnUbuntu2004Condition(i: Int) = """ - always() - && ($outcome == 'success') - && (matrix.distributions.distribution$i.user-id != 'Ubuntu-20.04') -""".trimIndent() +val Step.successNotOnUbuntu2404Condition + get() = """ + always() + && (${outcome.eq(Success)}) + && (matrix.distribution.user-id != 'Ubuntu-24.04') + """.trimIndent() -fun Step.getSuccessNotOnUbuntu2204Condition(i: Int) = """ +fun Step.getSuccessNotOnDistributionCondition(i: Int, distribution: String) = """ always() - && ($outcome == 'success') - && (matrix.distributions.distribution$i.user-id != 'Ubuntu-22.04') + && (${outcome.eq(Success)}) + && (matrix.distributions.distribution$i.user-id != '$distribution') """.trimIndent() - -val Step.outcome get() = "steps.$id.outcome" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 61e63ac6f..8c1fec5f4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,792 +14,800 @@ # This file was generated using Kotlin DSL (.github/workflows/test.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 +# Generated with https://github.com/typesafegithub/github-workflows-kt -name: Build and Test +name: 'Build and Test' on: push: {} pull_request: {} schedule: - - cron: 0 0 * * * + - cron: '0 0 * * *' jobs: check_yaml_consistency: - name: Check YAML consistency - runs-on: ubuntu-latest + 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/test.yaml' && '.github/workflows/test.main.kts' - - id: step-2 - name: Consistency check - run: git diff --exit-code '.github/workflows/test.yaml' + - id: 'step-0' + name: 'Check out' + uses: 'actions/checkout@v4' + - id: 'step-1' + name: 'Execute script' + run: 'rm ''.github/workflows/test.yaml'' && ''.github/workflows/test.main.kts''' + - id: 'step-2' + name: 'Consistency check' + run: 'git diff --exit-code ''.github/workflows/test.yaml''' build: - name: Build - runs-on: windows-latest + name: 'Build' + runs-on: 'windows-latest' needs: - - check_yaml_consistency + - '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 + - id: 'step-0' + name: 'Configure Git' + run: 'git config --global core.autocrlf input' + - id: 'step-1' + name: 'Checkout' + uses: 'actions/checkout@v4' + - id: 'step-2' + name: 'Setup Java 11' + uses: 'actions/setup-java@v4' with: - java-version: 11 - distribution: temurin - - id: step-3 - name: Build - uses: burrunan/gradle-cache-action@v1 + java-version: '11' + distribution: 'temurin' + - id: 'step-3' + name: 'Build' + uses: 'burrunan/gradle-cache-action@v1' with: - debug: false - concurrent: true + 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 + - id: 'step-4' + name: 'Save built artifacts to cache' + uses: 'actions/cache/save@v4' with: path: |- action.yml build/distributions/ - key: ${{ github.run_id }} + key: '${{ github.run_id }}' test_invalid_distribution: - name: Test "${{ matrix.distribution.label }}" distribution on ${{ matrix.environment }} - runs-on: ${{ matrix.environment }} + name: 'Test "${{ matrix.distribution.label }}" distribution on ${{ matrix.environment }}' + runs-on: '${{ matrix.environment }}' needs: - - build - - check_yaml_consistency + - 'build' + - 'check_yaml_consistency' strategy: fail-fast: false matrix: environment: - - windows-2019 - - windows-2022 - - windows-latest + - 'windows-2019' + - 'windows-2022' + - 'windows-latest' distribution: - - user-id: invalid - label: invalid + - user-id: 'invalid' + label: 'invalid' - user-id: '' label: '' - user-id: null label: 'null' steps: - - id: step-0 - name: Restore built artifacts from cache - uses: actions/cache/restore@v3 + - id: 'step-0' + name: 'Restore built artifacts from cache' + uses: 'actions/cache/restore@v4' with: path: |- action.yml build/distributions/ - key: ${{ github.run_id }} - fail-on-cache-miss: true - - id: step-1 - name: Execute action + key: '${{ github.run_id }}' + fail-on-cache-miss: 'true' + - id: 'step-1' + name: 'Execute action' continue-on-error: true - uses: ./ + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - - id: step-2 - name: Test - action should fail if an invalid distribution is given - shell: cmd - run: if '${{ steps.step-1.outcome }}' NEQ 'failure' exit 1 + distribution: '${{ matrix.distribution.user-id }}' + - id: 'step-2' + name: 'Test - action should fail if an invalid distribution is given' + shell: 'cmd' + run: 'if ''${{ steps.step-1.outcome }}'' NEQ ''failure'' exit 1' test_default_distribution: - name: Test default distribution on ${{ matrix.environment }} - runs-on: ${{ matrix.environment }} + name: 'Test default distribution on ${{ matrix.environment }}' + runs-on: '${{ matrix.environment }}' needs: - - build - - check_yaml_consistency + - 'build' + - 'check_yaml_consistency' strategy: fail-fast: false matrix: environment: - - windows-2019 - - windows-2022 - - windows-latest + - 'windows-2019' + - 'windows-2022' + - 'windows-latest' distribution: - - wsl-id: Debian - user-id: Debian + - wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' steps: - - id: step-0 - name: Restore built artifacts from cache - uses: actions/cache/restore@v3 + - id: 'step-0' + name: 'Restore built artifacts from cache' + uses: 'actions/cache/restore@v4' with: path: |- action.yml build/distributions/ - key: ${{ github.run_id }} - fail-on-cache-miss: true - - id: step-1 - name: Execute action - uses: ./ + key: '${{ github.run_id }}' + fail-on-cache-miss: 'true' + - id: 'step-1' + name: 'Execute action' + uses: './' with: - update: true - - id: step-2 - name: Test - wsl-bash should be available as custom shell - shell: wsl-bash {0} + update: 'true' + - id: 'step-2' + name: 'Test - wsl-bash should be available as custom shell' + shell: 'wsl-bash {0}' run: ':' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-3 - name: Test - wsl-bash should fail if the script fails (provocation) + - id: 'step-3' + name: 'Test - wsl-bash should fail if the script fails (provocation)' continue-on-error: true - shell: wsl-bash {0} - run: false + shell: 'wsl-bash {0}' + run: 'false' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-4 - name: Test - wsl-bash should fail if the script fails (verification) - shell: cmd - run: IF '${{ steps.step-3.outcome }}' NEQ 'failure' EXIT /B 1 + - id: 'step-4' + name: 'Test - wsl-bash should fail if the script fails (verification)' + shell: 'cmd' + run: 'IF ''${{ steps.step-3.outcome }}'' NEQ ''failure'' EXIT /B 1' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-5 - name: Test - wsl-bash should fail if one of the commands fails (provocation) + - id: 'step-5' + name: 'Test - wsl-bash should fail if one of the commands fails (provocation)' continue-on-error: true - shell: wsl-bash {0} + shell: 'wsl-bash {0}' run: |- false : if: |- always() && (steps.step-1.outcome == 'success') - - id: step-6 - name: Test - wsl-bash should fail if one of the commands fails (verification) - shell: wsl-bash {0} + - id: 'step-6' + name: 'Test - wsl-bash should fail if one of the commands fails (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-5.outcome }}'' == ''failure'' ] || exit 1' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-7 - name: Test - wsl-bash should fail if an undefined variable is used (provocation) + - id: 'step-7' + name: 'Test - wsl-bash should fail if an undefined variable is used (provocation)' continue-on-error: true - shell: wsl-bash {0} - run: $foo + shell: 'wsl-bash {0}' + run: '$foo' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-8 - name: Test - wsl-bash should fail if an undefined variable is used (verification) - shell: wsl-bash {0} + - id: 'step-8' + name: 'Test - wsl-bash should fail if an undefined variable is used (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-7.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-9 - name: Test - wsl-bash should fail if any command in a pipe fails (provocation) + - id: 'step-9' + name: 'Test - wsl-bash should fail if any command in a pipe fails (provocation)' continue-on-error: true - shell: wsl-bash {0} - run: false | true + shell: 'wsl-bash {0}' + run: 'false | true' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-10 - name: Test - wsl-bash should fail if any command in a pipe fails (verification) - shell: wsl-bash {0} + - id: 'step-10' + name: 'Test - wsl-bash should fail if any command in a pipe fails (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-9.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-11 - name: Test - the default distribution should be correct - shell: wsl-bash {0} + - id: 'step-11' + name: 'Test - the default distribution should be correct' + shell: 'wsl-bash {0}' run: |- cat <(wsl.exe --list || true) <(wsl.exe --list || true | iconv -f UTF-16LE -t UTF-8) <(wslconfig.exe /list || true) <(wslconfig.exe /list || true | iconv -f UTF-16LE -t UTF-8) [[ "$(cat <(wsl.exe --list || true) <(wsl.exe --list || true | iconv -f UTF-16LE -t UTF-8) <(wslconfig.exe /list || true) <(wslconfig.exe /list || true | iconv -f UTF-16LE -t UTF-8))" == *${{ matrix.distribution.wsl-id }}\ \(Default\)* ]] if: |- always() && (steps.step-1.outcome == 'success') - - id: step-12 - name: Test - wsl-bash should use the correct distribution - shell: wsl-bash {0} + - id: 'step-12' + name: 'Test - wsl-bash should use the correct distribution' + shell: 'wsl-bash {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.distribution.match-pattern }} ]] if: |- always() && (steps.step-1.outcome == 'success') - - id: step-13 - name: Test - multi-line commands should not be disturbed by CRLF line endings - shell: wsl-bash {0} + - id: 'step-13' + name: 'Test - multi-line commands should not be disturbed by CRLF line endings' + shell: 'wsl-bash {0}' run: |- : # this comment catches the CR if present ! grep -q $'\r' "$0" # this comment catches the CR if present if: |- always() && (steps.step-1.outcome == 'success') - - id: step-14 - name: Test - wsl-bash should fail if no script file is given (provocation) + - id: 'step-14' + name: 'Test - wsl-bash should fail if no script file is given (provocation)' continue-on-error: true - shell: wsl-bash + shell: 'wsl-bash' run: ':' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-15 - name: Test - wsl-bash should fail if no script file is given (verification) - shell: wsl-bash {0} + - id: 'step-15' + name: 'Test - wsl-bash should fail if no script file is given (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-14.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-16 - name: Test - wsl-bash should fail if more than one parameter is given and first is not -u (provocation) + - id: 'step-16' + name: 'Test - wsl-bash should fail if more than one parameter is given and first is not -u (provocation)' continue-on-error: true - shell: wsl-bash user {0} + shell: 'wsl-bash user {0}' run: ':' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-17 - name: Test - wsl-bash should fail if more than one parameter is given and first is not -u (verification) - shell: wsl-bash {0} + - id: 'step-17' + name: 'Test - wsl-bash should fail if more than one parameter is given and first is not -u (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-16.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-18 - name: Test - wsl-bash should fail if only user is given (provocation) + - id: 'step-18' + name: 'Test - wsl-bash should fail if only user is given (provocation)' continue-on-error: true - shell: wsl-bash -u {0} + shell: 'wsl-bash -u {0}' run: ':' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-19 - name: Test - wsl-bash should fail if only user is given (verification) - shell: wsl-bash {0} + - id: 'step-19' + name: 'Test - wsl-bash should fail if only user is given (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-18.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-20 - name: Test - wsl-bash should fail if excess argument is given (provocation) + - id: 'step-20' + name: 'Test - wsl-bash should fail if excess argument is given (provocation)' continue-on-error: true - shell: wsl-bash -u user {0} foo + shell: 'wsl-bash -u user {0} foo' run: ':' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-21 - name: Test - wsl-bash should fail if excess argument is given (verification) - shell: wsl-bash {0} + - id: 'step-21' + name: 'Test - wsl-bash should fail if excess argument is given (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-20.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-22 - name: Test - wsl-bash should fail if given script file does not exist (provocation) + - id: 'step-22' + name: 'Test - wsl-bash should fail if given script file does not exist (provocation)' continue-on-error: true - shell: wsl-bash -u user {0}foo + shell: 'wsl-bash -u user {0}foo' run: ':' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-23 - name: Test - wsl-bash should fail if given script file does not exist (verification) - shell: wsl-bash {0} + - id: 'step-23' + name: 'Test - wsl-bash should fail if given script file does not exist (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-22.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') test: - name: Test "${{ matrix.distribution.user-id }}" distribution on ${{ matrix.environment }} - runs-on: ${{ matrix.environment }} + name: 'Test "${{ matrix.distribution.user-id }}" distribution on ${{ matrix.environment }}' + runs-on: '${{ matrix.environment }}' needs: - - build - - check_yaml_consistency + - 'build' + - 'check_yaml_consistency' strategy: fail-fast: false matrix: environment: - - windows-2019 - - windows-2022 - - windows-latest + - 'windows-2019' + - 'windows-2022' + - 'windows-latest' distribution: - - wsl-id: Debian - user-id: Debian + - wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix - - wsl-id: kali-linux - user-id: kali-linux + default-absent-tool: 'dos2unix' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*' + default-absent-tool: 'dos2unix' + - wsl-id: 'kali-linux' + user-id: 'kali-linux' match-pattern: '*Kali*' - default-absent-tool: dos2unix - - wsl-id: openSUSE-Leap-15.2 - user-id: openSUSE-Leap-15.2 + default-absent-tool: 'dos2unix' + - wsl-id: 'openSUSE-Leap-15.2' + user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' - default-absent-tool: which - - wsl-id: Ubuntu - user-id: Ubuntu-22.04 + default-absent-tool: 'which' + - wsl-id: 'Ubuntu-24.04' + user-id: 'Ubuntu-24.04' + match-pattern: '*Ubuntu*24.04*' + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu' + user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu-16.04 - user-id: Ubuntu-16.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu-16.04' + user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' steps: - - id: step-0 - name: Restore built artifacts from cache - uses: actions/cache/restore@v3 + - id: 'step-0' + name: 'Restore built artifacts from cache' + uses: 'actions/cache/restore@v4' with: path: |- action.yml build/distributions/ - key: ${{ github.run_id }} - fail-on-cache-miss: true - - id: step-1 - name: Execute action - uses: ./ + key: '${{ github.run_id }}' + fail-on-cache-miss: 'true' + - id: 'step-1' + name: 'Execute action' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - use-cache: false - - id: step-2 - name: Test - wsl-bash should fail if bash is not present by default (provocation) + distribution: '${{ matrix.distribution.user-id }}' + use-cache: 'false' + - id: 'step-2' + name: 'Test - wsl-bash should fail if bash is not present by default (provocation)' continue-on-error: true - shell: wsl-bash {0} + shell: 'wsl-bash {0}' run: ':' if: |- always() && (steps.step-1.outcome == 'success') && (matrix.distribution.user-id == 'Alpine') - - id: step-3 - name: Test - wsl-bash should fail if bash is not present by default (verification) - run: wsl sh -euc "[ '${{ steps.step-2.outcome }}' = 'failure' ]" + - id: 'step-3' + name: 'Test - wsl-bash should fail if bash is not present by default (verification)' + run: 'wsl sh -euc "[ ''${{ steps.step-2.outcome }}'' = ''failure'' ]"' if: |- always() && (steps.step-1.outcome == 'success') && (matrix.distribution.user-id == 'Alpine') - - id: step-4 - name: Delete wsl-bash - shell: cmd - run: DEL /F "${{ steps.step-1.outputs.wsl-shell-wrapper-path }}" + - id: 'step-4' + name: 'Delete wsl-bash' + shell: 'cmd' + run: 'DEL /F "${{ steps.step-1.outputs.wsl-shell-wrapper-path }}"' if: |- always() && (steps.step-1.outcome == 'success') && (matrix.distribution.user-id == 'Alpine') - - id: step-5 - name: Install Bash on Alpine - uses: ./ + - id: 'step-5' + name: 'Install Bash on Alpine' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - additional-packages: bash + distribution: '${{ matrix.distribution.user-id }}' + additional-packages: 'bash' if: |- always() && (steps.step-1.outcome == 'success') && (matrix.distribution.user-id == 'Alpine') - - id: step-6 - name: Test - wsl-bash should be available as custom shell - shell: wsl-bash {0} + - id: 'step-6' + name: 'Test - wsl-bash should be available as custom shell' + shell: 'wsl-bash {0}' run: ':' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-7 - name: Test - wsl-bash should fail if the script fails (provocation) + - id: 'step-7' + name: 'Test - wsl-bash should fail if the script fails (provocation)' continue-on-error: true - shell: wsl-bash {0} - run: false + shell: 'wsl-bash {0}' + run: 'false' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-8 - name: Test - wsl-bash should fail if the script fails (verification) - shell: cmd - run: IF '${{ steps.step-7.outcome }}' NEQ 'failure' EXIT /B 1 + - id: 'step-8' + name: 'Test - wsl-bash should fail if the script fails (verification)' + shell: 'cmd' + run: 'IF ''${{ steps.step-7.outcome }}'' NEQ ''failure'' EXIT /B 1' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-9 - name: Test - wsl-bash should fail if one of the commands fails (provocation) + - id: 'step-9' + name: 'Test - wsl-bash should fail if one of the commands fails (provocation)' continue-on-error: true - shell: wsl-bash {0} + shell: 'wsl-bash {0}' run: |- false : if: |- always() && (steps.step-1.outcome == 'success') - - id: step-10 - name: Test - wsl-bash should fail if one of the commands fails (verification) - shell: wsl-bash {0} + - id: 'step-10' + name: 'Test - wsl-bash should fail if one of the commands fails (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-9.outcome }}'' == ''failure'' ] || exit 1' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-11 - name: Test - wsl-bash should fail if an undefined variable is used (provocation) + - id: 'step-11' + name: 'Test - wsl-bash should fail if an undefined variable is used (provocation)' continue-on-error: true - shell: wsl-bash {0} - run: $foo + shell: 'wsl-bash {0}' + run: '$foo' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-12 - name: Test - wsl-bash should fail if an undefined variable is used (verification) - shell: wsl-bash {0} + - id: 'step-12' + name: 'Test - wsl-bash should fail if an undefined variable is used (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-11.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-13 - name: Test - wsl-bash should fail if any command in a pipe fails (provocation) + - id: 'step-13' + name: 'Test - wsl-bash should fail if any command in a pipe fails (provocation)' continue-on-error: true - shell: wsl-bash {0} - run: false | true + shell: 'wsl-bash {0}' + run: 'false | true' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-14 - name: Test - wsl-bash should fail if any command in a pipe fails (verification) - shell: wsl-bash {0} + - id: 'step-14' + name: 'Test - wsl-bash should fail if any command in a pipe fails (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-13.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-15 - name: Test - the default distribution should be correct - shell: wsl-bash {0} + - id: 'step-15' + name: 'Test - the default distribution should be correct' + shell: 'wsl-bash {0}' run: |- cat <(wsl.exe --list || true) <(wsl.exe --list || true | iconv -f UTF-16LE -t UTF-8) <(wslconfig.exe /list || true) <(wslconfig.exe /list || true | iconv -f UTF-16LE -t UTF-8) [[ "$(cat <(wsl.exe --list || true) <(wsl.exe --list || true | iconv -f UTF-16LE -t UTF-8) <(wslconfig.exe /list || true) <(wslconfig.exe /list || true | iconv -f UTF-16LE -t UTF-8))" == *${{ matrix.distribution.wsl-id }}\ \(Default\)* ]] if: |- always() && (steps.step-1.outcome == 'success') - - id: step-16 - name: Test - wsl-bash should use the correct distribution - shell: wsl-bash {0} + - id: 'step-16' + name: 'Test - wsl-bash should use the correct distribution' + shell: 'wsl-bash {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.distribution.match-pattern }} ]] if: |- always() && (steps.step-1.outcome == 'success') - - id: step-17 - name: Test - multi-line commands should not be disturbed by CRLF line endings - shell: wsl-bash {0} + - id: 'step-17' + name: 'Test - multi-line commands should not be disturbed by CRLF line endings' + shell: 'wsl-bash {0}' run: |- : # this comment catches the CR if present ! grep -q $'\r' "$0" # this comment catches the CR if present if: |- always() && (steps.step-1.outcome == 'success') - - id: step-18 - name: Test - ${{ matrix.distribution.default-absent-tool }} should not be installed by default (provocation) + - id: 'step-18' + name: 'Test - ${{ matrix.distribution.default-absent-tool }} should not be installed by default (provocation)' continue-on-error: true - shell: wsl-bash {0} - run: ${{ matrix.distribution.default-absent-tool }} --version + shell: 'wsl-bash {0}' + run: '${{ matrix.distribution.default-absent-tool }} --version' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-19 - name: Test - ${{ matrix.distribution.default-absent-tool }} should not be installed by default (verification) - shell: wsl-bash {0} + - id: 'step-19' + name: 'Test - ${{ matrix.distribution.default-absent-tool }} should not be installed by default (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-18.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-20 - name: Test - bash should be installed by default - shell: wsl-bash {0} - run: bash -c true + - id: 'step-20' + name: 'Test - bash should be installed by default' + shell: 'wsl-bash {0}' + run: 'bash -c true' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-21 - name: Test - sh should be installed by default - shell: wsl-bash {0} - run: sh -c true + - id: 'step-21' + name: 'Test - sh should be installed by default' + shell: 'wsl-bash {0}' + run: 'sh -c true' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-22 - name: Test - wsl-sh should not be present (provocation) + - id: 'step-22' + name: 'Test - wsl-sh should not be present (provocation)' continue-on-error: true - shell: wsl-sh {0} + shell: 'wsl-sh {0}' run: ':' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-23 - name: Test - wsl-sh should not be present (verification) - shell: wsl-bash {0} + - id: 'step-23' + name: 'Test - wsl-sh should not be present (verification)' + shell: 'wsl-bash {0}' run: '[ ''${{ steps.step-22.outcome }}'' == ''failure'' ]' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-24 - name: Add wsl-sh wrapper - uses: ./ + - id: 'step-24' + name: 'Add wsl-sh wrapper' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - wsl-shell-command: sh -eu + distribution: '${{ matrix.distribution.user-id }}' + wsl-shell-command: 'sh -eu' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-25 - name: Test - wsl-sh should be present - shell: wsl-sh {0} + - id: 'step-25' + name: 'Test - wsl-sh should be present' + shell: 'wsl-sh {0}' run: ':' if: |- always() && (steps.step-24.outcome == 'success') - - id: step-26 - name: Test - wsl-bash should use bash - shell: wsl-bash {0} + - id: 'step-26' + name: 'Test - wsl-bash should use bash' + shell: 'wsl-bash {0}' run: |- ps -o pid='' -o comm='' | grep "^\s\+$$\s\+" | grep -o '\S\+$' [ "$(ps -o pid='' -o comm='' 2>/dev/null | grep "^\s\+$$\s\+" | grep -o '\S\+$')" == 'bash' ] if: |- always() && (steps.step-24.outcome == 'success') - - id: step-27 - name: Test - wsl-sh should use sh - shell: wsl-sh {0} + - id: 'step-27' + name: 'Test - wsl-sh should use sh' + shell: 'wsl-sh {0}' run: |- ps -o pid='' -o comm='' | grep "^\s\+$$\s\+" | grep -o '\S\+$' [ "$(ps -o pid='' -o comm='' 2>/dev/null | grep "^\s\+$$\s\+" | grep -o '\S\+$')" = 'sh' ] if: |- always() && (steps.step-24.outcome == 'success') - - id: step-28 - name: Delete wsl-bash - shell: cmd - run: DEL /F "${{ steps.step-1.outputs.wsl-shell-wrapper-path }}" + - id: 'step-28' + name: 'Delete wsl-bash' + shell: 'cmd' + run: 'DEL /F "${{ steps.step-1.outputs.wsl-shell-wrapper-path }}"' if: |- always() && (steps.step-24.outcome == 'success') - - id: step-29 - name: Test - wsl-bash should not be present (provocation) + - id: 'step-29' + name: 'Test - wsl-bash should not be present (provocation)' continue-on-error: true - shell: wsl-bash {0} + shell: 'wsl-bash {0}' run: ':' if: |- always() && (steps.step-24.outcome == 'success') - - id: step-30 - name: Test - wsl-bash should not be present (verification) - shell: wsl-sh {0} + - id: 'step-30' + name: 'Test - wsl-bash should not be present (verification)' + shell: 'wsl-sh {0}' run: '[ ''${{ steps.step-29.outcome }}'' = ''failure'' ]' if: |- always() && (steps.step-24.outcome == 'success') - - id: step-31 - name: Re-add wsl-bash wrapper - uses: ./ + - id: 'step-31' + name: 'Re-add wsl-bash wrapper' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} + distribution: '${{ matrix.distribution.user-id }}' if: |- always() && (steps.step-24.outcome == 'success') - - id: step-32 - name: Test - wsl-bash should be present - shell: wsl-bash {0} + - id: 'step-32' + name: 'Test - wsl-bash should be present' + shell: 'wsl-bash {0}' run: ':' if: |- always() && (steps.step-31.outcome == 'success') - - id: step-33 - name: Test - wsl-bash should use bash - shell: wsl-bash {0} + - id: 'step-33' + name: 'Test - wsl-bash should use bash' + shell: 'wsl-bash {0}' run: |- ps -o pid='' -o comm='' | grep "^\s\+$$\s\+" | grep -o '\S\+$' [ "$(ps -o pid='' -o comm='' 2>/dev/null | grep "^\s\+$$\s\+" | grep -o '\S\+$')" == 'bash' ] if: |- always() && (steps.step-31.outcome == 'success') - - id: step-34 - name: Test - wsl-bash should use root as default user - shell: wsl-bash {0} + - id: 'step-34' + name: 'Test - wsl-bash should use root as default user' + shell: 'wsl-bash {0}' run: |- whoami [ "$(whoami)" == 'root' ] if: |- always() && (steps.step-31.outcome == 'success') - - id: step-35 - name: Add user test - shell: wsl-bash {0} - run: useradd -m -p 4qBD5NWD3IkbU test + - id: 'step-35' + name: 'Add user test' + shell: 'wsl-bash {0}' + run: 'useradd -m -p 4qBD5NWD3IkbU test' if: |- always() && (steps.step-31.outcome == 'success') - - id: step-36 - name: Set wsl-bash wrapper to use user test by default - uses: ./ + - id: 'step-36' + name: 'Set wsl-bash wrapper to use user test by default' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - additional-packages: sudo - wsl-shell-command: bash -c "sudo -u test bash --noprofile --norc -euo pipefail "\ + distribution: '${{ matrix.distribution.user-id }}' + additional-packages: 'sudo' + wsl-shell-command: 'bash -c "sudo -u test bash --noprofile --norc -euo pipefail "\' if: |- always() && (steps.step-31.outcome == 'success') - - id: step-37 - name: Test - wsl-bash should use test as default user - shell: wsl-bash {0} + - id: 'step-37' + name: 'Test - wsl-bash should use test as default user' + shell: 'wsl-bash {0}' run: |- whoami [ "$(whoami)" == 'test' ] if: |- always() && (steps.step-36.outcome == 'success') - - id: step-38 - name: Set wsl-bash wrapper to use user test by default with inline script usage - uses: ./ + - id: 'step-38' + name: 'Set wsl-bash wrapper to use user test by default with inline script usage' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - wsl-shell-command: bash -c "sudo -u test bash --noprofile --norc -euo pipefail '{0}'" + distribution: '${{ matrix.distribution.user-id }}' + wsl-shell-command: 'bash -c "sudo -u test bash --noprofile --norc -euo pipefail ''{0}''"' if: |- always() && (steps.step-36.outcome == 'success') - - id: step-39 - name: Test - wsl-bash should use test as default user with inline script usage - shell: wsl-bash {0} + - id: 'step-39' + name: 'Test - wsl-bash should use test as default user with inline script usage' + shell: 'wsl-bash {0}' run: |- whoami [ "$(whoami)" == 'test' ] if: |- always() && (steps.step-38.outcome == 'success') - - id: step-40 - name: Delete wsl-bash - shell: cmd - run: DEL /F "${{ steps.step-38.outputs.wsl-shell-wrapper-path }}" + - id: 'step-40' + name: 'Delete wsl-bash' + shell: 'cmd' + run: 'DEL /F "${{ steps.step-38.outputs.wsl-shell-wrapper-path }}"' if: |- always() && (steps.step-38.outcome == 'success') - - id: step-41 - name: Set wsl-bash wrapper to use default user by default - uses: ./ + - id: 'step-41' + name: 'Set wsl-bash wrapper to use default user by default' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} + distribution: '${{ matrix.distribution.user-id }}' if: |- always() && (steps.step-38.outcome == 'success') - - id: step-42 - name: Test - wsl-bash should use root as default user - shell: wsl-bash {0} + - id: 'step-42' + name: 'Test - wsl-bash should use root as default user' + shell: 'wsl-bash {0}' run: |- whoami [ "$(whoami)" == 'root' ] if: |- always() && (steps.step-41.outcome == 'success') - - id: step-43 - name: Test - test user does already exist - shell: wsl-bash {0} - run: id -u test + - id: 'step-43' + name: 'Test - test user does already exist' + shell: 'wsl-bash {0}' + run: 'id -u test' if: |- always() && (steps.step-41.outcome == 'success') - - id: step-44 - name: Delete wsl-bash - shell: cmd - run: DEL /F "${{ steps.step-41.outputs.wsl-shell-wrapper-path }}" + - id: 'step-44' + name: 'Delete wsl-bash' + shell: 'cmd' + run: 'DEL /F "${{ steps.step-41.outputs.wsl-shell-wrapper-path }}"' if: |- always() && (steps.step-41.outcome == 'success') - - id: step-45 - name: Set wsl-bash wrapper to use existing user test by default with extra parameter - uses: ./ + - id: 'step-45' + name: 'Set wsl-bash wrapper to use existing user test by default with extra parameter' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - wsl-shell-user: test + distribution: '${{ matrix.distribution.user-id }}' + wsl-shell-user: 'test' if: |- always() && (steps.step-41.outcome == 'success') - - id: step-46 - name: Test - wsl-bash should use existing user test as default user with extra parameter - shell: wsl-bash {0} + - id: 'step-46' + name: 'Test - wsl-bash should use existing user test as default user with extra parameter' + shell: 'wsl-bash {0}' run: |- whoami [ "$(whoami)" == 'test' ] if: |- always() && (steps.step-45.outcome == 'success') - - id: step-47 - name: Test - test2 user does not exist - shell: wsl-bash {0} + - id: 'step-47' + name: 'Test - test2 user does not exist' + shell: 'wsl-bash {0}' run: '! id -u test2' if: |- always() && (steps.step-45.outcome == 'success') - - id: step-48 - name: Delete wsl-bash - shell: cmd - run: DEL /F "${{ steps.step-45.outputs.wsl-shell-wrapper-path }}" + - id: 'step-48' + name: 'Delete wsl-bash' + shell: 'cmd' + run: 'DEL /F "${{ steps.step-45.outputs.wsl-shell-wrapper-path }}"' if: |- always() && (steps.step-45.outcome == 'success') - - id: step-49 - name: Set wsl-bash wrapper to use non-existing user test2 by default with extra parameter - uses: ./ + - id: 'step-49' + name: 'Set wsl-bash wrapper to use non-existing user test2 by default with extra parameter' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - wsl-shell-user: test2 + distribution: '${{ matrix.distribution.user-id }}' + wsl-shell-user: 'test2' if: |- always() && (steps.step-45.outcome == 'success') - - id: step-50 - name: Test - wsl-bash should use auto-generated user test2 as default user - shell: wsl-bash {0} + - id: 'step-50' + name: 'Test - wsl-bash should use auto-generated user test2 as default user' + shell: 'wsl-bash {0}' run: |- whoami [ "$(whoami)" == 'test2' ] if: |- always() && (steps.step-49.outcome == 'success') - - id: step-51 - name: Test - wsl-bash should use ad-hoc user test - shell: wsl-bash -u test {0} + - id: 'step-51' + name: 'Test - wsl-bash should use ad-hoc user test' + shell: 'wsl-bash -u test {0}' run: |- whoami [ "$(whoami)" == 'test' ] if: |- always() && (steps.step-49.outcome == 'success') - - id: step-52 - name: Test - wsl-bash should use ad-hoc user root - shell: wsl-bash -u root {0} + - id: 'step-52' + name: 'Test - wsl-bash should use ad-hoc user root' + shell: 'wsl-bash -u root {0}' run: |- whoami [ "$(whoami)" == 'root' ] if: |- always() && (steps.step-49.outcome == 'success') - - id: step-53 - name: Make a no-op execution of the action - uses: ./ + - id: 'step-53' + name: 'Make a no-op execution of the action' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} + distribution: '${{ matrix.distribution.user-id }}' if: |- always() && (steps.step-49.outcome == 'success') - - id: step-54 - name: Test - wsl-bash should still use test2 as default user - shell: wsl-bash {0} + - id: 'step-54' + name: 'Test - wsl-bash should still use test2 as default user' + shell: 'wsl-bash {0}' run: |- whoami [ "$(whoami)" == 'test2' ] @@ -807,95 +815,103 @@ jobs: always() && (steps.step-53.outcome == 'success') test_wsl-conf_on_initial_execution: - name: Test /etc/wsl.conf handling on initial execution for "${{ matrix.distribution.user-id }}" distribution on ${{ matrix.environment }} - runs-on: ${{ matrix.environment }} + name: 'Test /etc/wsl.conf handling on initial execution for "${{ matrix.distribution.user-id }}" distribution on ${{ matrix.environment }}' + runs-on: '${{ matrix.environment }}' needs: - - build - - check_yaml_consistency + - 'build' + - 'check_yaml_consistency' strategy: fail-fast: false matrix: environment: - - windows-2019 - - windows-2022 - - windows-latest + - 'windows-2019' + - 'windows-2022' + - 'windows-latest' distribution: - - wsl-id: Debian - user-id: Debian + - wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix - - wsl-id: kali-linux - user-id: kali-linux + default-absent-tool: 'dos2unix' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*' + default-absent-tool: 'dos2unix' + - wsl-id: 'kali-linux' + user-id: 'kali-linux' match-pattern: '*Kali*' - default-absent-tool: dos2unix - - wsl-id: openSUSE-Leap-15.2 - user-id: openSUSE-Leap-15.2 + default-absent-tool: 'dos2unix' + - wsl-id: 'openSUSE-Leap-15.2' + user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' - default-absent-tool: which - - wsl-id: Ubuntu - user-id: Ubuntu-22.04 + default-absent-tool: 'which' + - wsl-id: 'Ubuntu-24.04' + user-id: 'Ubuntu-24.04' + match-pattern: '*Ubuntu*24.04*' + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu' + user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu-16.04 - user-id: Ubuntu-16.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu-16.04' + user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' steps: - - id: step-0 - name: Restore built artifacts from cache - uses: actions/cache/restore@v3 + - id: 'step-0' + name: 'Restore built artifacts from cache' + uses: 'actions/cache/restore@v4' with: path: |- action.yml build/distributions/ - key: ${{ github.run_id }} - fail-on-cache-miss: true - - id: step-1 - name: Execute action - uses: ./ + key: '${{ github.run_id }}' + fail-on-cache-miss: 'true' + - id: 'step-1' + name: 'Execute action' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} + distribution: '${{ matrix.distribution.user-id }}' wsl-conf: |- [automount] options = uid=1000 - - id: step-2 - name: Delete wsl-bash - shell: cmd - run: DEL /F "${{ steps.step-1.outputs.wsl-shell-wrapper-path }}" + - id: 'step-2' + name: 'Delete wsl-bash' + shell: 'cmd' + run: 'DEL /F "${{ steps.step-1.outputs.wsl-shell-wrapper-path }}"' if: |- always() && (steps.step-1.outcome == 'success') && (matrix.distribution.user-id == 'Alpine') - - id: step-3 - name: Install Bash on Alpine - uses: ./ + - id: 'step-3' + name: 'Install Bash on Alpine' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - additional-packages: bash + distribution: '${{ matrix.distribution.user-id }}' + additional-packages: 'bash' if: |- always() && (steps.step-1.outcome == 'success') && (matrix.distribution.user-id == 'Alpine') - - id: step-4 - name: Test - /etc/wsl.conf should exist - shell: wsl-bash {0} + - id: 'step-4' + name: 'Test - /etc/wsl.conf should exist' + shell: 'wsl-bash {0}' run: |- [ -f /etc/wsl.conf ] cat /etc/wsl.conf if: |- always() && (steps.step-1.outcome == 'success') - - id: step-5 - name: Test - /mnt/c should be mounted with uid 1000 - shell: wsl-bash {0} + - id: 'step-5' + name: 'Test - /mnt/c should be mounted with uid 1000' + shell: 'wsl-bash {0}' run: |- ls -alh /mnt [[ "$(stat -c %u /mnt/c)" == 1000 ]] @@ -903,128 +919,137 @@ jobs: always() && (steps.step-1.outcome == 'success') test_wsl-conf_on_subsequent_execution: - name: Test /etc/wsl.conf handling on subsequent execution for "${{ matrix.distribution.user-id }}" distribution on ${{ matrix.environment }} - runs-on: ${{ matrix.environment }} + name: 'Test /etc/wsl.conf handling on subsequent execution for "${{ matrix.distribution.user-id }}" distribution on ${{ matrix.environment }}' + runs-on: '${{ matrix.environment }}' needs: - - build - - check_yaml_consistency + - 'build' + - 'check_yaml_consistency' strategy: fail-fast: false matrix: environment: - - windows-2019 - - windows-2022 - - windows-latest + - 'windows-2019' + - 'windows-2022' + - 'windows-latest' distribution: - - wsl-id: Debian - user-id: Debian + - wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix - - wsl-id: kali-linux - user-id: kali-linux + default-absent-tool: 'dos2unix' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*' + default-absent-tool: 'dos2unix' + - wsl-id: 'kali-linux' + user-id: 'kali-linux' match-pattern: '*Kali*' - default-absent-tool: dos2unix - - wsl-id: openSUSE-Leap-15.2 - user-id: openSUSE-Leap-15.2 + default-absent-tool: 'dos2unix' + - wsl-id: 'openSUSE-Leap-15.2' + user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' - default-absent-tool: which - - wsl-id: Ubuntu - user-id: Ubuntu-22.04 + default-absent-tool: 'which' + - wsl-id: 'Ubuntu-24.04' + user-id: 'Ubuntu-24.04' + match-pattern: '*Ubuntu*24.04*' + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu' + user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu-16.04 - user-id: Ubuntu-16.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu-16.04' + user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' steps: - - id: step-0 - name: Restore built artifacts from cache - uses: actions/cache/restore@v3 + - id: 'step-0' + name: 'Restore built artifacts from cache' + uses: 'actions/cache/restore@v4' with: path: |- action.yml build/distributions/ - key: ${{ github.run_id }} - fail-on-cache-miss: true - - id: step-1 - name: Execute action - uses: ./ + key: '${{ github.run_id }}' + fail-on-cache-miss: 'true' + - id: 'step-1' + name: 'Execute action' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - - id: step-2 - name: Delete wsl-bash - shell: cmd - run: DEL /F "${{ steps.step-1.outputs.wsl-shell-wrapper-path }}" + distribution: '${{ matrix.distribution.user-id }}' + - id: 'step-2' + name: 'Delete wsl-bash' + shell: 'cmd' + run: 'DEL /F "${{ steps.step-1.outputs.wsl-shell-wrapper-path }}"' if: |- always() && (steps.step-1.outcome == 'success') && (matrix.distribution.user-id == 'Alpine') - - id: step-3 - name: Install Bash on Alpine - uses: ./ + - id: 'step-3' + name: 'Install Bash on Alpine' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - additional-packages: bash + distribution: '${{ matrix.distribution.user-id }}' + additional-packages: 'bash' if: |- always() && (steps.step-1.outcome == 'success') && (matrix.distribution.user-id == 'Alpine') - - id: step-4 - name: Test - /etc/wsl.conf should not exist - shell: wsl-bash {0} - run: '[ ! -f /etc/wsl.conf ]' + - id: 'step-4' + name: 'Test - /etc/wsl.conf should not exist' + shell: 'wsl-bash {0}' + run: '[ ! -f /etc/wsl.conf ] || { cat /etc/wsl.conf; false; }' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-5 + && (matrix.distribution.user-id != 'Ubuntu-24.04') + - id: 'step-5' name: 'Test - C: should be mounted at /mnt/c' - shell: wsl-bash {0} + shell: 'wsl-bash {0}' run: |- mount mount | grep 'C:.* on /mnt/c' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-6 - name: Test - /mnt/c should be mounted with uid 0 - shell: wsl-bash {0} + - id: 'step-6' + name: 'Test - /mnt/c should be mounted with uid 0' + shell: 'wsl-bash {0}' run: |- ls -alh /mnt [[ "$(stat -c %u /mnt/c)" == 0 ]] if: |- always() && (steps.step-1.outcome == 'success') - - id: step-7 - name: Execute action - uses: ./ + - id: 'step-7' + name: 'Execute action' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} + distribution: '${{ matrix.distribution.user-id }}' wsl-conf: |- [automount] root = / if: |- always() && (steps.step-1.outcome == 'success') - - id: step-8 - name: Test - /etc/wsl.conf should exist - shell: wsl-bash {0} + - id: 'step-8' + name: 'Test - /etc/wsl.conf should exist' + shell: 'wsl-bash {0}' run: |- [ -f /etc/wsl.conf ] cat /etc/wsl.conf if: |- always() && (steps.step-7.outcome == 'success') - - id: step-9 + - id: 'step-9' name: 'Test - C: should be mounted at /c' - shell: wsl-bash {0} + shell: 'wsl-bash {0}' run: |- mount mount | grep 'C:.* on /c' @@ -1032,224 +1057,232 @@ jobs: always() && (steps.step-7.outcome == 'success') test_additional_packages: - name: Test additional packages for "${{ matrix.distribution.user-id }}" distribution on ${{ matrix.environment }} - runs-on: ${{ matrix.environment }} + name: 'Test additional packages for "${{ matrix.distribution.user-id }}" distribution on ${{ matrix.environment }}' + runs-on: '${{ matrix.environment }}' needs: - - build - - check_yaml_consistency + - 'build' + - 'check_yaml_consistency' strategy: fail-fast: false matrix: environment: - - windows-2019 - - windows-2022 - - windows-latest + - 'windows-2019' + - 'windows-2022' + - 'windows-latest' distribution: - - wsl-id: Debian - user-id: Debian + - wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix - - wsl-id: kali-linux - user-id: kali-linux + default-absent-tool: 'dos2unix' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*' + default-absent-tool: 'dos2unix' + - wsl-id: 'kali-linux' + user-id: 'kali-linux' match-pattern: '*Kali*' - default-absent-tool: dos2unix - - wsl-id: openSUSE-Leap-15.2 - user-id: openSUSE-Leap-15.2 + default-absent-tool: 'dos2unix' + - wsl-id: 'openSUSE-Leap-15.2' + user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' - default-absent-tool: which - - wsl-id: Ubuntu - user-id: Ubuntu-22.04 + default-absent-tool: 'which' + - wsl-id: 'Ubuntu-24.04' + user-id: 'Ubuntu-24.04' + match-pattern: '*Ubuntu*24.04*' + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu' + user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu-16.04 - user-id: Ubuntu-16.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu-16.04' + user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' steps: - - id: step-0 - name: Restore built artifacts from cache - uses: actions/cache/restore@v3 + - id: 'step-0' + name: 'Restore built artifacts from cache' + uses: 'actions/cache/restore@v4' with: path: |- action.yml build/distributions/ - key: ${{ github.run_id }} - fail-on-cache-miss: true - - id: step-1 - name: Execute action - uses: ./ + key: '${{ github.run_id }}' + fail-on-cache-miss: 'true' + - id: 'step-1' + name: 'Execute action' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - additional-packages: ${{ matrix.distribution.default-absent-tool }} bash - - id: step-2 - name: Test - ${{ matrix.distribution.default-absent-tool }} should be installed - shell: wsl-bash {0} - run: ${{ matrix.distribution.default-absent-tool }} --version + distribution: '${{ matrix.distribution.user-id }}' + additional-packages: '${{ matrix.distribution.default-absent-tool }} bash' + - id: 'step-2' + name: 'Test - ${{ matrix.distribution.default-absent-tool }} should be installed' + shell: 'wsl-bash {0}' + run: '${{ matrix.distribution.default-absent-tool }} --version' if: |- always() && (steps.step-1.outcome == 'success') - - id: step-3 - name: Test - bash should be installed - shell: wsl-bash {0} - run: bash -c true + - id: 'step-3' + name: 'Test - bash should be installed' + shell: 'wsl-bash {0}' + run: 'bash -c true' if: |- always() && (steps.step-1.outcome == 'success') test_multiple_usage_with_different_distributions: - name: Test multiple usage with different distributions ("${{ matrix.distributions.distribution1.user-id }}" / "${{ matrix.distributions.distribution2.user-id }}" / "${{ matrix.distributions.distribution3.user-id }}") on ${{ matrix.environment }} - runs-on: ${{ matrix.environment }} + name: 'Test multiple usage with different distributions ("${{ matrix.distributions.distribution1.user-id }}" / "${{ matrix.distributions.distribution2.user-id }}" / "${{ matrix.distributions.distribution3.user-id }}") on ${{ matrix.environment }}' + runs-on: '${{ matrix.environment }}' needs: - - build - - check_yaml_consistency + - 'build' + - 'check_yaml_consistency' strategy: fail-fast: false matrix: environment: - - windows-2019 - - windows-2022 - - windows-latest + - 'windows-2019' + - 'windows-2022' + - 'windows-latest' distributions: - distribution1: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution3: - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' - distribution1: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution3: - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' - distribution1: - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution3: - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' - distribution1: - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution3: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' - distribution1: - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution3: - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' - distribution1: - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution3: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' steps: - - id: step-0 - name: Restore built artifacts from cache - uses: actions/cache/restore@v3 + - id: 'step-0' + name: 'Restore built artifacts from cache' + uses: 'actions/cache/restore@v4' with: path: |- action.yml build/distributions/ - key: ${{ github.run_id }} - fail-on-cache-miss: true - - id: step-1 - name: Execute action for ${{ matrix.distributions.distribution1.user-id }} - uses: ./ + key: '${{ github.run_id }}' + fail-on-cache-miss: 'true' + - id: 'step-1' + name: 'Execute action for ${{ matrix.distributions.distribution1.user-id }}' + uses: './' with: - distribution: ${{ matrix.distributions.distribution1.user-id }} - - id: step-2 - name: Execute action for ${{ matrix.distributions.distribution2.user-id }} - uses: ./ + distribution: '${{ matrix.distributions.distribution1.user-id }}' + - id: 'step-2' + name: 'Execute action for ${{ matrix.distributions.distribution2.user-id }}' + uses: './' with: - distribution: ${{ matrix.distributions.distribution2.user-id }} - - id: step-3 - name: Execute action for ${{ matrix.distributions.distribution3.user-id }} - uses: ./ + distribution: '${{ matrix.distributions.distribution2.user-id }}' + - id: 'step-3' + name: 'Execute action for ${{ matrix.distributions.distribution3.user-id }}' + uses: './' with: - distribution: ${{ matrix.distributions.distribution3.user-id }} - set-as-default: false - - id: step-4 - name: Execute action for ${{ matrix.distributions.distribution1.user-id }} again - uses: ./ + distribution: '${{ matrix.distributions.distribution3.user-id }}' + set-as-default: 'false' + - id: 'step-4' + name: 'Execute action for ${{ matrix.distributions.distribution1.user-id }} again' + uses: './' with: - distribution: ${{ matrix.distributions.distribution1.user-id }} - - id: step-5 - name: Test - the default distribution should be the last installed distribution with set-as-default true - shell: wsl-bash {0} + distribution: '${{ matrix.distributions.distribution1.user-id }}' + - id: 'step-5' + name: 'Test - the default distribution should be the last installed distribution with set-as-default true' + shell: 'wsl-bash {0}' run: |- cat <(wsl.exe --list || true) <(wsl.exe --list || true | iconv -f UTF-16LE -t UTF-8) <(wslconfig.exe /list || true) <(wslconfig.exe /list || true | iconv -f UTF-16LE -t UTF-8) [[ "$(cat <(wsl.exe --list || true) <(wsl.exe --list || true | iconv -f UTF-16LE -t UTF-8) <(wslconfig.exe /list || true) <(wslconfig.exe /list || true | iconv -f UTF-16LE -t UTF-8))" == *${{ matrix.distributions.distribution2.wsl-id }}\ \(Default\)* ]] if: |- always() && (steps.step-4.outcome == 'success') - - id: step-6 - name: Test - wsl-bash should use the last installed distribution with set-as-default true - shell: wsl-bash {0} + - id: 'step-6' + name: 'Test - wsl-bash should use the last installed distribution with set-as-default true' + shell: 'wsl-bash {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.distribution2.match-pattern }} ]] @@ -1257,202 +1290,210 @@ jobs: always() && (steps.step-4.outcome == 'success') test_multiple_usage_with_same_distribution: - name: Test multiple usage with "${{ matrix.distribution.user-id }}" distribution on ${{ matrix.environment }} - runs-on: ${{ matrix.environment }} + name: 'Test multiple usage with "${{ matrix.distribution.user-id }}" distribution on ${{ matrix.environment }}' + runs-on: '${{ matrix.environment }}' needs: - - build - - check_yaml_consistency + - 'build' + - 'check_yaml_consistency' strategy: fail-fast: false matrix: environment: - - windows-2019 - - windows-2022 - - windows-latest + - 'windows-2019' + - 'windows-2022' + - 'windows-latest' distribution: - - wsl-id: Debian - user-id: Debian + - wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix - - wsl-id: kali-linux - user-id: kali-linux + default-absent-tool: 'dos2unix' + - wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*' + default-absent-tool: 'dos2unix' + - wsl-id: 'kali-linux' + user-id: 'kali-linux' match-pattern: '*Kali*' - default-absent-tool: dos2unix - - wsl-id: openSUSE-Leap-15.2 - user-id: openSUSE-Leap-15.2 + default-absent-tool: 'dos2unix' + - wsl-id: 'openSUSE-Leap-15.2' + user-id: 'openSUSE-Leap-15.2' match-pattern: '*openSUSE*Leap*15.2*' - default-absent-tool: which - - wsl-id: Ubuntu - user-id: Ubuntu-22.04 + default-absent-tool: 'which' + - wsl-id: 'Ubuntu-24.04' + user-id: 'Ubuntu-24.04' + match-pattern: '*Ubuntu*24.04*' + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu' + user-id: 'Ubuntu-22.04' match-pattern: '*Ubuntu*22.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu-18.04 - user-id: Ubuntu-18.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix - - wsl-id: Ubuntu-16.04 - user-id: Ubuntu-16.04 + default-absent-tool: 'dos2unix' + - wsl-id: 'Ubuntu-16.04' + user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - - wsl-id: Debian - user-id: Debian + - wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' exclude: - - environment: windows-2019 + - environment: 'windows-2019' distribution: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix - - environment: windows-2022 + default-absent-tool: 'dos2unix' + - environment: 'windows-2022' distribution: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix - - environment: windows-latest + default-absent-tool: 'dos2unix' + - environment: 'windows-latest' distribution: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' include: - - environment: windows-2019 + - environment: 'windows-2019' distribution: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix - - environment: windows-2022 + default-absent-tool: 'dos2unix' + - environment: 'windows-2022' distribution: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix - - environment: windows-latest + default-absent-tool: 'dos2unix' + - environment: 'windows-latest' distribution: - wsl-id: Debian - user-id: Debian + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: Ubuntu - user-id: Ubuntu-20.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' steps: - - id: step-0 - name: Restore built artifacts from cache - uses: actions/cache/restore@v3 + - id: 'step-0' + name: 'Restore built artifacts from cache' + uses: 'actions/cache/restore@v4' with: path: |- action.yml build/distributions/ - key: ${{ github.run_id }} - fail-on-cache-miss: true - - id: step-1 - name: Execute action - uses: ./ + key: '${{ github.run_id }}' + fail-on-cache-miss: 'true' + - id: 'step-1' + name: 'Execute action' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - additional-packages: bash - - id: step-2 - name: Update distribution - uses: ./ + distribution: '${{ matrix.distribution.user-id }}' + additional-packages: 'bash' + - id: 'step-2' + name: 'Update distribution' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - update: true - if: matrix.distribution.user-id != 'kali-linux' - - id: step-3 - name: Install default absent tool - uses: ./ + distribution: '${{ matrix.distribution.user-id }}' + update: 'true' + if: 'matrix.distribution.user-id != ''kali-linux''' + - id: 'step-3' + name: 'Install default absent tool' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - additional-packages: ${{ matrix.distribution.default-absent-tool }} - - id: step-4 - name: Test - ${{ matrix.distribution.default-absent-tool }} should be installed - shell: wsl-bash {0} - run: ${{ matrix.distribution.default-absent-tool }} --version + distribution: '${{ matrix.distribution.user-id }}' + additional-packages: '${{ matrix.distribution.default-absent-tool }}' + - id: 'step-4' + name: 'Test - ${{ matrix.distribution.default-absent-tool }} should be installed' + shell: 'wsl-bash {0}' + run: '${{ matrix.distribution.default-absent-tool }} --version' if: |- always() && (steps.step-3.outcome == 'success') - - id: step-5 - name: Execute action for ${{ matrix.distribution2.user-id }} - uses: ./ + - id: 'step-5' + name: 'Execute action for ${{ matrix.distribution2.user-id }}' + uses: './' with: - distribution: ${{ matrix.distribution2.user-id }} + distribution: '${{ matrix.distribution2.user-id }}' if: |- always() && (steps.step-3.outcome == 'success') - - id: step-6 - name: Test - "${{ matrix.distribution2.user-id }}" should be the default distribution after installation - shell: wsl-bash {0} + - id: 'step-6' + name: 'Test - "${{ matrix.distribution2.user-id }}" should be the default distribution after installation' + shell: 'wsl-bash {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.distribution2.match-pattern }} ]] if: |- always() && (steps.step-5.outcome == 'success') - - id: step-7 - name: Re-execute action - uses: ./ + - id: 'step-7' + name: 'Re-execute action' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} + distribution: '${{ matrix.distribution.user-id }}' if: |- always() && (steps.step-5.outcome == 'success') - - id: step-8 - name: Test - "${{ matrix.distribution2.user-id }}" should still be the default distribution after re-running for "${{ matrix.distribution.user-id }}" - shell: wsl-bash {0} + - id: 'step-8' + name: 'Test - "${{ matrix.distribution2.user-id }}" should still be the default distribution after re-running for "${{ matrix.distribution.user-id }}"' + shell: 'wsl-bash {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.distribution2.match-pattern }} ]] if: |- always() && (steps.step-7.outcome == 'success') - - id: step-9 - name: Set as default - uses: ./ + - id: 'step-9' + name: 'Set as default' + uses: './' with: - distribution: ${{ matrix.distribution.user-id }} - set-as-default: true + distribution: '${{ matrix.distribution.user-id }}' + set-as-default: 'true' if: |- always() && (steps.step-7.outcome == 'success') - - id: step-10 - name: Test - "${{ matrix.distribution.user-id }}" should be the default distribution after re-running with set-as-default true - shell: wsl-bash {0} + - id: 'step-10' + name: 'Test - "${{ matrix.distribution.user-id }}" should be the default distribution after re-running with set-as-default true' + shell: 'wsl-bash {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.distribution.match-pattern }} ]] @@ -1460,186 +1501,238 @@ jobs: always() && (steps.step-9.outcome == 'success') test_distribution_specific_wsl_bash_scripts: - name: Test distribution specific wsl-bash scripts on ${{ matrix.environment }} - runs-on: ${{ matrix.environment }} + name: 'Test distribution specific wsl-bash scripts on ${{ matrix.environment }} (without ${{ matrix.distributions.incompatibleUbuntu }})' + runs-on: '${{ matrix.environment }}' needs: - - build - - check_yaml_consistency + - 'build' + - 'check_yaml_consistency' strategy: fail-fast: false matrix: environment: - - windows-2019 - - windows-2022 - - windows-latest + - 'windows-2019' + - 'windows-2022' + - 'windows-latest' distributions: - - distribution1: - wsl-id: Debian - user-id: Debian + - incompatibleUbuntu: 'Ubuntu-22.04' + distribution1: + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: kali-linux - user-id: kali-linux - match-pattern: '*Kali*' - default-absent-tool: dos2unix + wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*' + default-absent-tool: 'dos2unix' distribution3: - wsl-id: openSUSE-Leap-15.2 - user-id: openSUSE-Leap-15.2 - match-pattern: '*openSUSE*Leap*15.2*' - default-absent-tool: which + wsl-id: 'kali-linux' + user-id: 'kali-linux' + match-pattern: '*Kali*' + default-absent-tool: 'dos2unix' distribution4: - wsl-id: Ubuntu - user-id: Ubuntu-20.04 - match-pattern: '*Ubuntu*20.04*' - default-absent-tool: dos2unix + 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-18.04 - user-id: Ubuntu-18.04 - match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix + wsl-id: 'Ubuntu-24.04' + user-id: 'Ubuntu-24.04' + match-pattern: '*Ubuntu*24.04*' + default-absent-tool: 'dos2unix' distribution6: - wsl-id: Ubuntu-16.04 - user-id: Ubuntu-16.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-20.04' + match-pattern: '*Ubuntu*20.04*' + default-absent-tool: 'dos2unix' + distribution7: + wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' + match-pattern: '*Ubuntu*18.04*' + default-absent-tool: 'dos2unix' + distribution8: + 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 + default-absent-tool: 'dos2unix' + - incompatibleUbuntu: 'Ubuntu-20.04' + distribution1: + wsl-id: 'Debian' + user-id: 'Debian' match-pattern: '*Debian*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' distribution2: - wsl-id: kali-linux - user-id: kali-linux - match-pattern: '*Kali*' - default-absent-tool: dos2unix + wsl-id: 'Alpine' + user-id: 'Alpine' + match-pattern: '*Alpine*' + default-absent-tool: 'dos2unix' distribution3: - wsl-id: openSUSE-Leap-15.2 - user-id: openSUSE-Leap-15.2 - match-pattern: '*openSUSE*Leap*15.2*' - default-absent-tool: which + wsl-id: 'kali-linux' + user-id: 'kali-linux' + match-pattern: '*Kali*' + default-absent-tool: 'dos2unix' distribution4: - wsl-id: Ubuntu - user-id: Ubuntu-22.04 - match-pattern: '*Ubuntu*22.04*' - default-absent-tool: dos2unix + 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-18.04 - user-id: Ubuntu-18.04 - match-pattern: '*Ubuntu*18.04*' - default-absent-tool: dos2unix + wsl-id: 'Ubuntu-24.04' + user-id: 'Ubuntu-24.04' + match-pattern: '*Ubuntu*24.04*' + default-absent-tool: 'dos2unix' distribution6: - wsl-id: Ubuntu-16.04 - user-id: Ubuntu-16.04 + wsl-id: 'Ubuntu' + user-id: 'Ubuntu-22.04' + match-pattern: '*Ubuntu*22.04*' + default-absent-tool: 'dos2unix' + distribution7: + wsl-id: 'Ubuntu-18.04' + user-id: 'Ubuntu-18.04' + match-pattern: '*Ubuntu*18.04*' + default-absent-tool: 'dos2unix' + distribution8: + wsl-id: 'Ubuntu-16.04' + user-id: 'Ubuntu-16.04' match-pattern: '*Ubuntu*16.04*' - default-absent-tool: dos2unix + default-absent-tool: 'dos2unix' steps: - - id: step-0 - name: Restore built artifacts from cache - uses: actions/cache/restore@v3 + - id: 'step-0' + name: 'Restore built artifacts from cache' + uses: 'actions/cache/restore@v4' with: path: |- action.yml build/distributions/ - key: ${{ github.run_id }} - fail-on-cache-miss: true - - id: step-1 - name: Execute action for ${{ matrix.distributions.distribution1.user-id }} - uses: ./ + key: '${{ github.run_id }}' + fail-on-cache-miss: 'true' + - id: 'step-1' + name: 'Execute action for ${{ matrix.distributions.distribution1.user-id }}' + uses: './' + with: + distribution: '${{ matrix.distributions.distribution1.user-id }}' + - id: 'step-2' + name: 'Execute action for ${{ matrix.distributions.distribution2.user-id }}' + uses: './' with: - distribution: ${{ matrix.distributions.distribution1.user-id }} - - id: step-2 - name: Execute action for ${{ matrix.distributions.distribution2.user-id }} - uses: ./ + distribution: '${{ matrix.distributions.distribution2.user-id }}' + additional-packages: 'bash' + - id: 'step-3' + name: 'Execute action for ${{ matrix.distributions.distribution3.user-id }}' + uses: './' with: - distribution: ${{ matrix.distributions.distribution2.user-id }} - additional-packages: bash - - id: step-3 - name: Execute action for ${{ matrix.distributions.distribution3.user-id }} - uses: ./ + distribution: '${{ matrix.distributions.distribution3.user-id }}' + set-as-default: 'false' + - id: 'step-4' + name: 'Execute action for ${{ matrix.distributions.distribution4.user-id }}' + uses: './' with: - distribution: ${{ matrix.distributions.distribution3.user-id }} - set-as-default: false - - id: step-4 - name: Execute action for ${{ matrix.distributions.distribution4.user-id }} - uses: ./ + distribution: '${{ matrix.distributions.distribution4.user-id }}' + set-as-default: 'false' + - id: 'step-5' + name: 'Execute action for ${{ matrix.distributions.distribution5.user-id }}' + uses: './' with: - distribution: ${{ matrix.distributions.distribution4.user-id }} - set-as-default: false - - id: step-5 - name: Execute action for ${{ matrix.distributions.distribution5.user-id }} - uses: ./ + distribution: '${{ matrix.distributions.distribution5.user-id }}' + set-as-default: 'false' + - id: 'step-6' + name: 'Execute action for ${{ matrix.distributions.distribution6.user-id }}' + uses: './' with: - distribution: ${{ matrix.distributions.distribution5.user-id }} - set-as-default: false - - id: step-6 - name: Execute action for ${{ matrix.distributions.distribution6.user-id }} - uses: ./ + distribution: '${{ matrix.distributions.distribution6.user-id }}' + set-as-default: 'false' + - id: 'step-7' + name: 'Execute action for ${{ matrix.distributions.distribution7.user-id }}' + uses: './' with: - distribution: ${{ matrix.distributions.distribution6.user-id }} - set-as-default: false - - id: step-7 - name: Test - wsl-bash_${{ matrix.distributions.distribution1.user-id }} should use the correct distribution - shell: wsl-bash_Debian {0} + 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: 'Test - wsl-bash_${{ matrix.distributions.distribution1.user-id }} should use the correct distribution' + shell: 'wsl-bash_Debian {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.distribution1.match-pattern }} ]] if: |- always() && (steps.step-1.outcome == 'success') - - id: step-8 - name: Test - wsl-bash_${{ matrix.distributions.distribution2.user-id }} should use the correct distribution - shell: wsl-bash_kali-linux {0} + - id: 'step-10' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution2.user-id }} should use the correct distribution' + shell: 'wsl-bash_Alpine {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.distribution2.match-pattern }} ]] if: |- always() && (steps.step-2.outcome == 'success') - - id: step-9 - name: Test - wsl-bash_${{ matrix.distributions.distribution3.user-id }} should use the correct distribution - shell: wsl-bash_openSUSE-Leap-15.2 {0} + - id: 'step-11' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution3.user-id }} should use the correct distribution' + shell: 'wsl-bash_kali-linux {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.distribution3.match-pattern }} ]] if: |- always() && (steps.step-3.outcome == 'success') - - id: step-10 - name: Test - wsl-bash_${{ matrix.distributions.distribution4.user-id }} should use the correct distribution - shell: wsl-bash_Ubuntu-22.04 {0} + - id: 'step-12' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution4.user-id }} should use the correct distribution' + 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.distribution4.match-pattern }} ]] if: |- always() && (steps.step-4.outcome == 'success') - && (matrix.distributions.distribution4.user-id != 'Ubuntu-20.04') - - id: step-11 - name: Test - wsl-bash_${{ matrix.distributions.distribution4.user-id }} should use the correct distribution - shell: wsl-bash_Ubuntu-20.04 {0} + - id: 'step-13' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution' + shell: 'wsl-bash_Ubuntu-24.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.distribution4.match-pattern }} ]] + [[ "$(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 }} ]] if: |- always() - && (steps.step-4.outcome == 'success') - && (matrix.distributions.distribution4.user-id != 'Ubuntu-22.04') - - id: step-12 - name: Test - wsl-bash_${{ matrix.distributions.distribution5.user-id }} should use the correct distribution - shell: wsl-bash_Ubuntu-18.04 {0} + && (steps.step-5.outcome == 'success') + - id: 'step-14' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should use the correct distribution' + 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.distribution5.match-pattern }} ]] + [[ "$(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-5.outcome == 'success') - - id: step-13 - name: Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should use the correct distribution - shell: wsl-bash_Ubuntu-16.04 {0} + && (steps.step-6.outcome == 'success') + && (matrix.distributions.distribution6.user-id != 'Ubuntu-20.04') + - id: 'step-15' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution6.user-id }} should use the correct distribution' + 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.distribution6.match-pattern }} ]] if: |- always() && (steps.step-6.outcome == 'success') + && (matrix.distributions.distribution6.user-id != 'Ubuntu-22.04') + - id: 'step-16' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution7.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.distribution7.match-pattern }} ]] + if: |- + always() + && (steps.step-7.outcome == 'success') + - id: 'step-17' + name: 'Test - wsl-bash_${{ matrix.distributions.distribution8.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.distribution8.match-pattern }} ]] + if: |- + always() + && (steps.step-8.outcome == 'success') diff --git a/.github/workflows/validate-gradle-wrapper.main.kts b/.github/workflows/validate-gradle-wrapper.main.kts index 46e7a58d2..91fa1ad48 100755 --- a/.github/workflows/validate-gradle-wrapper.main.kts +++ b/.github/workflows/validate-gradle-wrapper.main.kts @@ -18,11 +18,11 @@ @file:Import("workflow-with-copyright.main.kts") -import it.krzeminski.githubactions.actions.actions.CheckoutV3 -import it.krzeminski.githubactions.actions.gradle.WrapperValidationActionV1 -import it.krzeminski.githubactions.domain.RunnerType.UbuntuLatest -import it.krzeminski.githubactions.domain.triggers.PullRequest -import it.krzeminski.githubactions.domain.triggers.Push +import io.github.typesafegithub.workflows.actions.actions.CheckoutV3 +import io.github.typesafegithub.workflows.actions.gradle.WrapperValidationActionV1 +import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest +import io.github.typesafegithub.workflows.domain.triggers.PullRequest +import io.github.typesafegithub.workflows.domain.triggers.Push workflowWithCopyright( name = "Validate Gradle Wrapper", diff --git a/.github/workflows/validate-gradle-wrapper.yaml b/.github/workflows/validate-gradle-wrapper.yaml index f17f20b03..9c956b953 100644 --- a/.github/workflows/validate-gradle-wrapper.yaml +++ b/.github/workflows/validate-gradle-wrapper.yaml @@ -14,38 +14,38 @@ # This file was generated using Kotlin DSL (.github/workflows/validate-gradle-wrapper.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 +# Generated with https://github.com/typesafegithub/github-workflows-kt -name: Validate Gradle Wrapper +name: 'Validate Gradle Wrapper' on: push: {} pull_request: {} jobs: check_yaml_consistency: - name: Check YAML consistency - runs-on: ubuntu-latest + 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/validate-gradle-wrapper.yaml' && '.github/workflows/validate-gradle-wrapper.main.kts' - - id: step-2 - name: Consistency check - run: git diff --exit-code '.github/workflows/validate-gradle-wrapper.yaml' + - id: 'step-0' + name: 'Check out' + uses: 'actions/checkout@v4' + - id: 'step-1' + name: 'Execute script' + run: 'rm ''.github/workflows/validate-gradle-wrapper.yaml'' && ''.github/workflows/validate-gradle-wrapper.main.kts''' + - id: 'step-2' + name: 'Consistency check' + run: 'git diff --exit-code ''.github/workflows/validate-gradle-wrapper.yaml''' validate_gradle_wrapper: - name: Validate Gradle Wrapper - runs-on: ubuntu-latest + name: 'Validate Gradle Wrapper' + runs-on: 'ubuntu-latest' needs: - - check_yaml_consistency + - '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: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 + - 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: 'Validate Gradle Wrapper' + uses: 'gradle/wrapper-validation-action@v1' diff --git a/.github/workflows/workflow-with-copyright.main.kts b/.github/workflows/workflow-with-copyright.main.kts index 351f1e7fe..b636366e7 100644 --- a/.github/workflows/workflow-with-copyright.main.kts +++ b/.github/workflows/workflow-with-copyright.main.kts @@ -14,33 +14,29 @@ * limitations under the License. */ -@file:DependsOn("it.krzeminski:github-actions-kotlin-dsl:0.40.0") +@file:DependsOn("io.github.typesafegithub:github-workflows-kt:2.0.0") -import it.krzeminski.githubactions.domain.Concurrency -import it.krzeminski.githubactions.domain.triggers.Trigger -import it.krzeminski.githubactions.dsl.WorkflowBuilder -import it.krzeminski.githubactions.dsl.workflow -import it.krzeminski.githubactions.yaml.Preamble.WithOriginalAfter -import it.krzeminski.githubactions.yaml.writeToFile +import io.github.typesafegithub.workflows.domain.Concurrency +import io.github.typesafegithub.workflows.domain.triggers.Trigger +import io.github.typesafegithub.workflows.dsl.WorkflowBuilder +import io.github.typesafegithub.workflows.dsl.workflow +import io.github.typesafegithub.workflows.yaml.Preamble.WithOriginalAfter import java.io.File fun workflowWithCopyright( name: String, on: List, - env: LinkedHashMap = linkedMapOf(), + env: Map = mapOf(), sourceFile: File, concurrency: Concurrency? = null, block: WorkflowBuilder.() -> Unit ) { - val sourceFilePath = sourceFile.toPath() workflow( name = name, on = on, env = env, - sourceFile = sourceFilePath, + sourceFile = sourceFile, concurrency = concurrency, - block = block - ).writeToFile( preamble = WithOriginalAfter( """ Copyright 2020-2023 Björn Kautler @@ -57,6 +53,7 @@ fun workflowWithCopyright( See the License for the specific language governing permissions and limitations under the License. """.trimIndent() - ) + ), + block = block ) } diff --git a/README.md b/README.md index 8516aca61..adff93c53 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,7 @@ The values currently supported by this action are: * `Alpine` * `kali-linux` * `openSUSE-Leap-15.2` +* `Ubuntu-24.04` * `Ubuntu-22.04` * `Ubuntu-20.04` * `Ubuntu-18.04` @@ -192,6 +193,11 @@ This can be used to adjust various settings as documented at https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configuration-settings-for-wslconf. This can also be used if the distribution is installed already. +**WARNING:** Setting this option will overwrite any existing content of the file. +Some distributions like Ubuntu-24.04 might already ship with a wsl.conf file. +Make sure to check whether a file exists by default and whether you want to included +its contents in your configured value. + **Default value:** none _**Example:**_ diff --git a/action-types.yml b/action-types.yml index 2a8a10b72..cafaa2186 100644 --- a/action-types.yml +++ b/action-types.yml @@ -21,6 +21,7 @@ inputs: - Debian - kali-linux - openSUSE-Leap-15.2 + - Ubuntu-24.04 - Ubuntu-22.04 - Ubuntu-20.04 - Ubuntu-18.04 diff --git a/action.yml b/action.yml index ea82c69d5..39532a503 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-Leap-15.2', 'Ubuntu-24.04', 'Ubuntu-22.04', 'Ubuntu-20.04', 'Ubuntu-18.04', 'Ubuntu-16.04' required: false default: Debian diff --git a/build/distributions/index.js b/build/distributions/index.js index a026df7c2..020d1f35f 100644 --- a/build/distributions/index.js +++ b/build/distributions/index.js @@ -283,8 +283,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.saveCache = exports.reserveCache = exports.downloadCache = exports.getCacheEntry = exports.getCacheVersion = void 0; const core = __importStar(__nccwpck_require__(7117)); -const http_client_1 = __nccwpck_require__(7301); -const auth_1 = __nccwpck_require__(9873); +const http_client_1 = __nccwpck_require__(8119); +const auth_1 = __nccwpck_require__(1677); const crypto = __importStar(__nccwpck_require__(6113)); const fs = __importStar(__nccwpck_require__(7147)); const url_1 = __nccwpck_require__(7310); @@ -791,7 +791,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.downloadCacheStorageSDK = exports.downloadCacheHttpClient = exports.DownloadProgress = void 0; const core = __importStar(__nccwpck_require__(7117)); -const http_client_1 = __nccwpck_require__(7301); +const http_client_1 = __nccwpck_require__(8119); const storage_blob_1 = __nccwpck_require__(3625); const buffer = __importStar(__nccwpck_require__(4300)); const fs = __importStar(__nccwpck_require__(7147)); @@ -1067,7 +1067,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", ({ value: true })); exports.retryHttpClientResponse = exports.retryTypedResponse = exports.retry = exports.isRetryableStatusCode = exports.isServerErrorStatusCode = exports.isSuccessStatusCode = void 0; const core = __importStar(__nccwpck_require__(7117)); -const http_client_1 = __nccwpck_require__(7301); +const http_client_1 = __nccwpck_require__(8119); const constants_1 = __nccwpck_require__(648); function isSuccessStatusCode(statusCode) { if (!statusCode) { @@ -2616,6 +2616,842 @@ exports.SearchState = SearchState; /***/ }), +/***/ 1677: +/***/ (function(__unused_webpack_module, exports) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; + } + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } +} +exports.BasicCredentialHandler = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Bearer ${this.token}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } +} +exports.BearerCredentialHandler = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + if (!options.headers) { + throw Error('The request has no headers'); + } + options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; + } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + throw new Error('not implemented'); + }); + } +} +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; +//# sourceMappingURL=auth.js.map + +/***/ }), + +/***/ 8119: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* eslint-disable @typescript-eslint/no-explicit-any */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; +const http = __importStar(__nccwpck_require__(3685)); +const https = __importStar(__nccwpck_require__(5687)); +const pm = __importStar(__nccwpck_require__(1762)); +const tunnel = __importStar(__nccwpck_require__(9382)); +const undici_1 = __nccwpck_require__(2009); +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes || (exports.HttpCodes = HttpCodes = {})); +var Headers; +(function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers || (exports.Headers = Headers = {})); +var MediaTypes; +(function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes || (exports.MediaTypes = MediaTypes = {})); +/** + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ +function getProxyUrl(serverUrl) { + const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; +} +exports.getProxyUrl = getProxyUrl; +const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); + } +} +exports.HttpClientError = HttpClientError; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { + const chunks = []; + this.message.on('data', (chunk) => { + chunks.push(chunk); + }); + this.message.on('end', () => { + resolve(Buffer.concat(chunks)); + }); + })); + }); + } +} +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === 'https:'; +} +exports.isHttps = isHttps; +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; + } + } + } + options(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + }); + } + get(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + }); + } + del(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + }); + } + post(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + }); + } + patch(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + }); + } + put(requestUrl, data, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + }); + } + head(requestUrl, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + }); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); + } + /** + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + */ + getJson(requestUrl, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + const res = yield this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + postJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + putJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + patchJson(requestUrl, obj, additionalHeaders = {}) { + return __awaiter(this, void 0, void 0, function* () { + const data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + const res = yield this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + }); + } + /** + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch + */ + request(verb, requestUrl, data, headers) { + return __awaiter(this, void 0, void 0, function* () { + if (this._disposed) { + throw new Error('Client has already been disposed.'); + } + const parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + do { + response = yield this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (response.message.statusCode && + HttpRedirectCodes.includes(response.message.statusCode) && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + const parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol === 'https:' && + parsedUrl.protocol !== parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + yield response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info, data); + redirectsRemaining--; + } + if (!response.message.statusCode || + !HttpResponseRetryCodes.includes(response.message.statusCode)) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); + } + } while (numTries < maxTries); + return response; + }); + } + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info, data) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } + else if (!res) { + // If `err` is not passed, then `res` must be passed. + reject(new Error('Unknown error')); + } + else { + resolve(res); + } + } + this.requestRawWithCallback(info, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info, data, onResult) { + if (typeof data === 'string') { + if (!info.options.headers) { + info.options.headers = {}; + } + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info.httpModule.request(info.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(undefined, res); + }); + let socket; + req.on('socket', sock => { + socket = sock; + }); + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info.options.path}`)); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } + else { + req.end(); + } + } + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + const parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); + } + getAgentDispatcher(serverUrl) { + const parsedUrl = new URL(serverUrl); + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (!useProxy) { + return; + } + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port + ? parseInt(info.parsedUrl.port) + : defaultPort; + info.options.path = + (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info.options); + } + } + return info; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; + } + if (!useProxy) { + agent = this._agent; + } + // if agent is already assigned use that agent. + if (agent) { + return agent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + } + // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. + if (proxyUrl && proxyUrl.hostname) { + const agentOptions = { + maxSockets, + keepAlive: this._keepAlive, + proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + })), { host: proxyUrl.hostname, port: proxyUrl.port }) + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; + } + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + // if tunneling agent isn't assigned create a new agent + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; + } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; + } + // if agent is already assigned use that agent. + if (proxyAgent) { + return proxyAgent; + } + const usingSsl = parsedUrl.protocol === 'https:'; + proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { + token: `${proxyUrl.username}:${proxyUrl.password}` + }))); + this._proxyAgentDispatcher = proxyAgent; + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { + rejectUnauthorized: false + }); + } + return proxyAgent; + } + _performExponentialBackoff(retryNumber) { + return __awaiter(this, void 0, void 0, function* () { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode === HttpCodes.NotFound) { + resolve(response); + } + // get the result from the body + function dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; + } + let obj; + let contents; + try { + contents = yield res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; + } + response.headers = res.message.headers; + } + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; + } + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; + } + else { + msg = `Failed request: (${statusCode})`; + } + const err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); + } + else { + resolve(response); + } + })); + }); + } +} +exports.HttpClient = HttpClient; +const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 1762: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.checkBypass = exports.getProxyUrl = void 0; +function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === 'https:'; + if (checkBypass(reqUrl)) { + return undefined; + } + const proxyVar = (() => { + if (usingSsl) { + return process.env['https_proxy'] || process.env['HTTPS_PROXY']; + } + else { + return process.env['http_proxy'] || process.env['HTTP_PROXY']; + } + })(); + if (proxyVar) { + try { + return new URL(proxyVar); + } + catch (_a) { + if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) + return new URL(`http://${proxyVar}`); + } + } + else { + return undefined; + } +} +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; + } + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; + } + const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; + } + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } + else if (reqUrl.protocol === 'http:') { + reqPort = 80; + } + else if (reqUrl.protocol === 'https:') { + reqPort = 443; + } + // Format the request hostname and hostname with port + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + } + // Compare request host against noproxy + for (const upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperNoProxyItem === '*' || + upperReqHosts.some(x => x === upperNoProxyItem || + x.endsWith(`.${upperNoProxyItem}`) || + (upperNoProxyItem.startsWith('.') && + x.endsWith(`${upperNoProxyItem}`)))) { + return true; + } + } + return false; +} +exports.checkBypass = checkBypass; +function isLoopbackAddress(host) { + const hostLower = host.toLowerCase(); + return (hostLower === 'localhost' || + hostLower.startsWith('127.') || + hostLower.startsWith('[::1]') || + hostLower.startsWith('[0:0:0:0:0:0:0:1]')); +} +//# sourceMappingURL=proxy.js.map + +/***/ }), + /***/ 3438: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { @@ -58702,11 +59538,11 @@ if (typeof Math.imul === 'undefined') { var downloadTool = $module$_actions_tool_cache_bge9h1.downloadTool; var extractZip = $module$_actions_tool_cache_bge9h1.extractZip; var HttpClient = $module$_actions_http_client_ma87oy.HttpClient; + var isDebug = $module$_actions_core_fx0i1v.isDebug; var debug = $module$_actions_core_fx0i1v.debug; var info = $module$_actions_core_fx0i1v.info; var NullWritable = $module$null_writable_7iy9le.NullWritable; var getInput = $module$_actions_core_fx0i1v.getInput; - var isDebug = $module$_actions_core_fx0i1v.isDebug; var tmpdir = $module$node_os_4svwl4.tmpdir; var isFeatureAvailable = $module$_actions_cache_3s3lfo.isFeatureAvailable; var warning = $module$_actions_core_fx0i1v.warning; @@ -59003,6 +59839,7 @@ if (typeof Math.imul === 'undefined') { setMetadataFor($updateCOROUTINE$1, '$updateCOROUTINE$1', classMeta, CoroutineImpl); setMetadataFor($installCOROUTINE$2, '$installCOROUTINE$2', classMeta, CoroutineImpl); setMetadataFor(AptGetBasedDistribution, 'AptGetBasedDistribution', classMeta, Distribution, VOID, VOID, VOID, [0, 1]); + setMetadataFor(Ubuntu2404, 'Ubuntu2404', objectMeta, AptGetBasedDistribution, VOID, VOID, VOID, [0, 1]); setMetadataFor(Ubuntu2204, 'Ubuntu2204', objectMeta, AptGetBasedDistribution, VOID, VOID, VOID, [0, 1]); setMetadataFor(Ubuntu2004, 'Ubuntu2004', objectMeta, AptGetBasedDistribution, VOID, VOID, VOID, [0, 1]); setMetadataFor(Ubuntu1804, 'Ubuntu1804', objectMeta, AptGetBasedDistribution, VOID, VOID, VOID, [0, 1]); @@ -59036,7 +59873,7 @@ if (typeof Math.imul === 'undefined') { setMetadataFor(setAsDefault$slambda, 'setAsDefault$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, [1]); setMetadataFor(verifyWindowsEnvironment$ref, 'verifyWindowsEnvironment$ref', classMeta, VOID, VOID, VOID, VOID, [0]); setMetadataFor(installDistribution$ref, 'installDistribution$ref', classMeta, VOID, VOID, VOID, VOID, [0]); - setMetadataFor(createWslConf$ref, 'createWslConf$ref', classMeta, VOID, VOID, VOID, VOID, [0]); + setMetadataFor(adjustWslConf$ref, 'adjustWslConf$ref', classMeta, VOID, VOID, VOID, VOID, [0]); setMetadataFor(setDistributionAsDefault$ref, 'setDistributionAsDefault$ref', classMeta, VOID, VOID, VOID, VOID, [0]); setMetadataFor(Distribution$update$ref, 'Distribution$update$ref', classMeta, VOID, VOID, VOID, VOID, [0]); setMetadataFor(main$slambda, 'main$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, [0]); @@ -59047,7 +59884,7 @@ if (typeof Math.imul === 'undefined') { setMetadataFor($groupCOROUTINE$14, '$groupCOROUTINE$14', classMeta, CoroutineImpl); setMetadataFor($verifyWindowsEnvironmentCOROUTINE$15, '$verifyWindowsEnvironmentCOROUTINE$15', classMeta, CoroutineImpl); setMetadataFor($installDistributionCOROUTINE$16, '$installDistributionCOROUTINE$16', classMeta, CoroutineImpl); - setMetadataFor($createWslConfCOROUTINE$17, '$createWslConfCOROUTINE$17', classMeta, CoroutineImpl); + setMetadataFor($adjustWslConfCOROUTINE$17, '$adjustWslConfCOROUTINE$17', classMeta, CoroutineImpl); setMetadataFor($setDistributionAsDefaultCOROUTINE$18, '$setDistributionAsDefaultCOROUTINE$18', classMeta, CoroutineImpl); setMetadataFor($writeWslShellWrapperCOROUTINE$19, '$writeWslShellWrapperCOROUTINE$19', classMeta, CoroutineImpl); //endregion @@ -70423,14 +71260,14 @@ if (typeof Math.imul === 'undefined') { this.dq_1 = this$0; CoroutineImpl.call(this, resultContinuation); } - protoOf(Distribution$downloadUrl$slambda).nq = function ($this$async, $completion) { - var tmp = this.oq($this$async, $completion); + protoOf(Distribution$downloadUrl$slambda).ar = function ($this$async, $completion) { + var tmp = this.br($this$async, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); }; protoOf(Distribution$downloadUrl$slambda).jc = function (p1, $completion) { - return this.nq((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); + return this.ar((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); }; protoOf(Distribution$downloadUrl$slambda).xb = function () { var suspendResult = this.rb_1; @@ -70439,9 +71276,9 @@ if (typeof Math.imul === 'undefined') { var tmp = this.pb_1; switch (tmp) { case 0: - this.qb_1 = 9; - if (!(this.dq_1.sq_1 == null)) { - return this.dq_1.sq_1; + this.qb_1 = 15; + if (!(this.dq_1.fr_1 == null)) { + return this.dq_1.fr_1; } this.pb_1 = 1; @@ -70456,16 +71293,16 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 2: if (!this.iq_1.d()) { - this.pb_1 = 7; + this.pb_1 = 13; continue $sm; } this.jq_1 = this.iq_1.e(); - this.qb_1 = 5; + this.qb_1 = 11; var tmp_2 = this; tmp_2.lq_1 = Companion_getInstance_4(); this.pb_1 = 3; - suspendResult = await_0((new HttpClient()).post('https://store.rg-adguard.net/api/GetFiles', 'type=ProductId&url=' + this.dq_1.tq_1, recordOf([to('Content-Type', 'application/x-www-form-urlencoded')])), this); + suspendResult = await_0((new HttpClient()).post('https://store.rg-adguard.net/api/GetFiles', 'type=ProductId&url=' + this.dq_1.gr_1, recordOf([to('Content-Type', 'application/x-www-form-urlencoded'), to('User-Agent', 'Setup WSL GitHub Action')])), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -70474,50 +71311,124 @@ if (typeof Math.imul === 'undefined') { case 3: this.mq_1 = suspendResult; if (!equals_0(this.mq_1.message.statusCode, 200)) { - var tmp0_error = 'Could not determine download URL (statusCode: ' + toString_1(this.mq_1.message.statusCode) + ' / statusMessage: ' + this.mq_1.message.statusMessage + ')'; - throw IllegalStateException_init_$Create$(toString_2(tmp0_error)); + if (isDebug()) { + this.pb_1 = 6; + suspendResult = await_0((new HttpClient()).post('https://echo.free.beeceptor.com/api/GetFiles', 'type=ProductId&url=' + this.dq_1.gr_1, recordOf([to('Content-Type', 'application/x-www-form-urlencoded'), to('User-Agent', 'Setup WSL GitHub Action')])), this); + if (suspendResult === get_COROUTINE_SUSPENDED()) { + return suspendResult; + } + continue $sm; + } else { + this.pb_1 = 10; + continue $sm; + } + } else { + this.pb_1 = 4; + continue $sm; } - this.pb_1 = 4; + break; + case 4: + this.pb_1 = 5; suspendResult = await_0(this.mq_1.readBody(), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; - case 4: - var body = suspendResult; - var tmp0_elvis_lhs = Regex_init_$Create$(']*href="(?[^"]+)"[^>]*>[^<]*\\.appx(?:bundle)?<\/a>').g9(body); - var tmp_3; - if (tmp0_elvis_lhs == null) { - var tmp1_error = 'Could not determine download URL from:\n' + body; + case 5: + this.nq_1 = suspendResult; + var tmp_3 = this; + var tmp4_elvis_lhs = Regex_init_$Create$(']*href="(?[^"]+)"[^>]*>[^<]*\\.appx(?:bundle)?<\/a>').g9(this.nq_1); + var tmp_4; + if (tmp4_elvis_lhs == null) { + var tmp1_error = 'Could not determine download URL from:\n' + this.nq_1; throw IllegalStateException_init_$Create$(toString_2(tmp1_error)); } else { - tmp_3 = tmp0_elvis_lhs; + tmp_4 = tmp4_elvis_lhs; } - var downloadLinkAnchorMatch = tmp_3; - this.fq_1 = new URL(ensureNotNull(downloadLinkAnchorMatch.o9().g(1)).n9_1); - this.qb_1 = 9; + tmp_3.oq_1 = tmp_4; + this.fq_1 = new URL(ensureNotNull(this.oq_1.o9().g(1)).n9_1); + this.qb_1 = 15; + this.pb_1 = 14; + var tmp_5 = this; + continue $sm; + case 6: + this.pq_1 = suspendResult; + if (equals_0(this.pq_1.message.statusCode, 200)) { + this.pb_1 = 7; + suspendResult = await_0(this.pq_1.readBody(), this); + if (suspendResult === get_COROUTINE_SUSPENDED()) { + return suspendResult; + } + continue $sm; + } else { + debug('Could not get echo response (statusCode: ' + toString_1(this.pq_1.message.statusCode) + ' / statusMessage: ' + this.pq_1.message.statusMessage + ')'); + this.pb_1 = 8; + continue $sm; + } + + break; + case 7: + this.qq_1 = suspendResult; + this.rq_1 = 'Request:\n' + this.qq_1; + debug(this.rq_1); this.pb_1 = 8; continue $sm; - case 5: - this.qb_1 = 9; - var tmp_4 = this.sb_1; - if (tmp_4 instanceof Error) { + case 8: + this.sq_1 = JSON; + this.tq_1 = to('httpVersion', this.mq_1.message.httpVersion); + this.uq_1 = to('headers', this.mq_1.message.headers); + this.vq_1 = to('trailers', this.mq_1.message.trailers); + var tmp_6 = this; + var tmp0_elvis_lhs = this.mq_1.message.method; + tmp_6.wq_1 = to('method', tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs); + var tmp_7 = this; + var tmp1_elvis_lhs = this.mq_1.message.url; + tmp_7.xq_1 = to('url', tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs); + var tmp_8 = this; + var tmp2_elvis_lhs = this.mq_1.message.statusCode; + tmp_8.yq_1 = to('statusCode', tmp2_elvis_lhs == null ? '' : tmp2_elvis_lhs); + var tmp_9 = this; + var tmp3_elvis_lhs = this.mq_1.message.statusMessage; + tmp_9.zq_1 = to('statusMessage', tmp3_elvis_lhs == null ? '' : tmp3_elvis_lhs); + this.pb_1 = 9; + suspendResult = await_0(this.mq_1.readBody(), this); + if (suspendResult === get_COROUTINE_SUSPENDED()) { + return suspendResult; + } + + continue $sm; + case 9: + var ARGUMENT = suspendResult; + var ARGUMENT_0 = to('body', ARGUMENT); + var ARGUMENT_1 = [this.tq_1, this.uq_1, this.vq_1, this.wq_1, this.xq_1, this.yq_1, this.zq_1, ARGUMENT_0]; + var ARGUMENT_2 = recordOf(ARGUMENT_1); + var responseMessage = this.sq_1.stringify(ARGUMENT_2, VOID, 2); + debug('Response:\n' + responseMessage); + this.pb_1 = 10; + continue $sm; + case 10: + var tmp0_error = 'Could not determine download URL (statusCode: ' + toString_1(this.mq_1.message.statusCode) + ' / statusMessage: ' + this.mq_1.message.statusMessage + ')'; + throw IllegalStateException_init_$Create$(toString_2(tmp0_error)); + case 11: + this.qb_1 = 15; + var tmp_10 = this.sb_1; + if (tmp_10 instanceof Error) { var e = this.sb_1; - var tmp_5 = this; + var tmp_11 = this; var tmp2_failure = Companion_getInstance_4(); - tmp_5.kq_1 = _Result___init__impl__xyqfz8(createFailure(e)); - this.pb_1 = 6; + tmp_11.kq_1 = _Result___init__impl__xyqfz8(createFailure(e)); + this.pb_1 = 12; continue $sm; } else { throw this.sb_1; } break; - case 6: - this.qb_1 = 9; + case 12: + this.qb_1 = 15; var tmp3_onFailure = this.kq_1; var tmp0_safe_receiver = Result__exceptionOrNull_impl_p6xea9(tmp3_onFailure); if (tmp0_safe_receiver == null) @@ -70531,32 +71442,32 @@ if (typeof Math.imul === 'undefined') { } ; - var ARGUMENT = tmp3_onFailure; - this.hq_1.a(new Result(ARGUMENT)); + var ARGUMENT_3 = tmp3_onFailure; + this.hq_1.a(new Result(ARGUMENT_3)); ; this.pb_1 = 2; continue $sm; - case 7: - var ARGUMENT_0 = this.hq_1; - var tmp2_getOrThrow = last(ARGUMENT_0).l4_1; + case 13: + var ARGUMENT_4 = this.hq_1; + var tmp2_getOrThrow = last(ARGUMENT_4).l4_1; throwOnFailure(tmp2_getOrThrow); - var tmp_6 = _Result___get_value__impl__bjfvqg(tmp2_getOrThrow); - if (tmp_6 == null ? true : isObject(tmp_6)) - tmp_6; + var tmp_12 = _Result___get_value__impl__bjfvqg(tmp2_getOrThrow); + if (tmp_12 == null ? true : isObject(tmp_12)) + tmp_12; else THROW_CCE(); if (false) {} - this.pb_1 = 8; + this.pb_1 = 14; continue $sm; - case 8: + case 14: return this.fq_1; - case 9: + case 15: throw this.sb_1; } } catch ($p) { var e_0 = $p; - if (this.qb_1 === 9) { + if (this.qb_1 === 15) { throw e_0; } else { this.pb_1 = this.qb_1; @@ -70565,7 +71476,7 @@ if (typeof Math.imul === 'undefined') { } while (true); }; - protoOf(Distribution$downloadUrl$slambda).oq = function ($this$async, completion) { + protoOf(Distribution$downloadUrl$slambda).br = function ($this$async, completion) { var i = new Distribution$downloadUrl$slambda(this.dq_1, completion); i.eq_1 = $this$async; return i; @@ -70573,24 +71484,24 @@ if (typeof Math.imul === 'undefined') { function Distribution$downloadUrl$slambda_0(this$0, resultContinuation) { var i = new Distribution$downloadUrl$slambda(this$0, resultContinuation); var l = function ($this$async, $completion) { - return i.nq($this$async, $completion); + return i.ar($this$async, $completion); }; l.$arity = 1; return l; } function Distribution(wslId, distributionName, version, _downloadUrl, productId, installerFile, userId) { userId = userId === VOID ? wslId : userId; - this.pq_1 = wslId; - this.qq_1 = distributionName; - this.rq_1 = version; - this.sq_1 = _downloadUrl; - this.tq_1 = productId; - this.uq_1 = installerFile; - this.vq_1 = userId; + this.cr_1 = wslId; + this.dr_1 = distributionName; + this.er_1 = version; + this.fr_1 = _downloadUrl; + this.gr_1 = productId; + this.hr_1 = installerFile; + this.ir_1 = userId; var tmp = this; var tmp_0 = GlobalScope_getInstance(); var tmp_1 = CoroutineStart_LAZY_getInstance(); - tmp.wq_1 = async(tmp_0, VOID, tmp_1, Distribution$downloadUrl$slambda_0(this, null)); + tmp.jr_1 = async(tmp_0, VOID, tmp_1, Distribution$downloadUrl$slambda_0(this, null)); } function AptGetBasedDistribution_init_$Init$(wslId, distributionName, version, downloadUrl, installerFile, $this) { Distribution_init_$Init$(wslId, distributionName, version, downloadUrl, installerFile, $this); @@ -70602,6 +71513,11 @@ if (typeof Math.imul === 'undefined') { AptGetBasedDistribution.call($this); return $this; } + function AptGetBasedDistribution_init_$Init$_1(wslId, distributionName, version, productId, installerFile, $this) { + Distribution_init_$Init$_1(wslId, distributionName, version, productId, installerFile, $this); + AptGetBasedDistribution.call($this); + return $this; + } function refresh($this, $completion) { var tmp = new $refreshCOROUTINE$0($this, $completion); tmp.rb_1 = Unit_getInstance(); @@ -70610,7 +71526,7 @@ if (typeof Math.imul === 'undefined') { } function $refreshCOROUTINE$0(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.hr_1 = _this__u8e3s4; + this.ur_1 = _this__u8e3s4; } protoOf($refreshCOROUTINE$0).xb = function () { var suspendResult = this.rb_1; @@ -70621,7 +71537,7 @@ if (typeof Math.imul === 'undefined') { case 0: this.qb_1 = 2; this.pb_1 = 1; - var tmp0_arrayOf = ['--distribution', this.hr_1.pq_1, 'apt-get', 'update']; + var tmp0_arrayOf = ['--distribution', this.ur_1.cr_1, 'apt-get', 'update']; var tmp1_apply = {}; tmp1_apply.env = recordOf([to('DEBIAN_FRONTEND', 'noninteractive'), to('WSLENV', 'DEBIAN_FRONTEND/u')]); ; @@ -70650,7 +71566,7 @@ if (typeof Math.imul === 'undefined') { }; function $updateCOROUTINE$1(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.qr_1 = _this__u8e3s4; + this.ds_1 = _this__u8e3s4; } protoOf($updateCOROUTINE$1).xb = function () { var suspendResult = this.rb_1; @@ -70661,7 +71577,7 @@ if (typeof Math.imul === 'undefined') { case 0: this.qb_1 = 3; this.pb_1 = 1; - suspendResult = refresh(this.qr_1, this); + suspendResult = refresh(this.ds_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -70669,7 +71585,7 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: this.pb_1 = 2; - var tmp0_arrayOf = ['--distribution', this.qr_1.pq_1, 'apt-get', 'upgrade', '--yes']; + var tmp0_arrayOf = ['--distribution', this.ds_1.cr_1, 'apt-get', 'upgrade', '--yes']; var tmp1_apply = {}; tmp1_apply.env = recordOf([to('DEBIAN_FRONTEND', 'noninteractive'), to('WSLENV', 'DEBIAN_FRONTEND/u')]); ; @@ -70698,8 +71614,8 @@ if (typeof Math.imul === 'undefined') { }; function $installCOROUTINE$2(_this__u8e3s4, packages, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.zr_1 = _this__u8e3s4; - this.as_1 = packages; + this.ms_1 = _this__u8e3s4; + this.ns_1 = packages; } protoOf($installCOROUTINE$2).xb = function () { var suspendResult = this.rb_1; @@ -70710,7 +71626,7 @@ if (typeof Math.imul === 'undefined') { case 0: this.qb_1 = 3; this.pb_1 = 1; - suspendResult = refresh(this.zr_1, this); + suspendResult = refresh(this.ms_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -70718,7 +71634,7 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: this.pb_1 = 2; - var tmp0_arrayOf = arrayConcat([['--distribution', this.zr_1.pq_1, 'apt-get', 'install', '--yes', '--no-install-recommends'], this.as_1]); + var tmp0_arrayOf = arrayConcat([['--distribution', this.ms_1.cr_1, 'apt-get', 'install', '--yes', '--no-install-recommends'], this.ns_1]); var tmp1_apply = {}; tmp1_apply.env = recordOf([to('DEBIAN_FRONTEND', 'noninteractive'), to('WSLENV', 'DEBIAN_FRONTEND/u')]); ; @@ -70745,13 +71661,13 @@ if (typeof Math.imul === 'undefined') { } while (true); }; - protoOf(AptGetBasedDistribution).xq = function ($completion) { + protoOf(AptGetBasedDistribution).kr = function ($completion) { var tmp = new $updateCOROUTINE$1(this, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); }; - protoOf(AptGetBasedDistribution).yq = function (packages, $completion) { + protoOf(AptGetBasedDistribution).lr = function (packages, $completion) { var tmp = new $installCOROUTINE$2(this, packages, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; @@ -70759,6 +71675,19 @@ if (typeof Math.imul === 'undefined') { }; function AptGetBasedDistribution() { } + function Ubuntu2404() { + Ubuntu2404_instance = this; + var tmp$ret$0; + // Inline function 'js.core.jso' call + tmp$ret$0 = {}; + AptGetBasedDistribution_init_$Init$_1('Ubuntu-24.04', 'Ubuntu', new SemVer('24.4.0', tmp$ret$0), '9nz3klhxdjp5', 'ubuntu2404.exe', this); + } + var Ubuntu2404_instance; + function Ubuntu2404_getInstance() { + if (Ubuntu2404_instance == null) + new Ubuntu2404(); + return Ubuntu2404_instance; + } function Ubuntu2204() { Ubuntu2204_instance = this; var tmp$ret$0; @@ -70844,7 +71773,7 @@ if (typeof Math.imul === 'undefined') { } function $refreshCOROUTINE$3(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.rs_1 = _this__u8e3s4; + this.et_1 = _this__u8e3s4; } protoOf($refreshCOROUTINE$3).xb = function () { var suspendResult = this.rb_1; @@ -70855,7 +71784,7 @@ if (typeof Math.imul === 'undefined') { case 0: this.qb_1 = 2; this.pb_1 = 1; - var tmp0_arrayOf = ['--distribution', this.rs_1.pq_1, 'zypper', '--non-interactive', 'refresh']; + var tmp0_arrayOf = ['--distribution', this.et_1.cr_1, 'zypper', '--non-interactive', 'refresh']; suspendResult = exec_1('wsl', tmp0_arrayOf, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; @@ -70881,7 +71810,7 @@ if (typeof Math.imul === 'undefined') { }; function $updateCOROUTINE$4(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.at_1 = _this__u8e3s4; + this.nt_1 = _this__u8e3s4; } protoOf($updateCOROUTINE$4).xb = function () { var suspendResult = this.rb_1; @@ -70892,7 +71821,7 @@ if (typeof Math.imul === 'undefined') { case 0: this.qb_1 = 3; this.pb_1 = 1; - suspendResult = this.at_1.jt(this); + suspendResult = this.nt_1.wt(this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -70900,7 +71829,7 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: this.pb_1 = 2; - var tmp0_arrayOf = ['--distribution', this.at_1.pq_1, 'zypper', '--non-interactive', 'update']; + var tmp0_arrayOf = ['--distribution', this.nt_1.cr_1, 'zypper', '--non-interactive', 'update']; suspendResult = exec_1('wsl', tmp0_arrayOf, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; @@ -70926,8 +71855,8 @@ if (typeof Math.imul === 'undefined') { }; function $installCOROUTINE$5(_this__u8e3s4, packages, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.st_1 = _this__u8e3s4; - this.tt_1 = packages; + this.fu_1 = _this__u8e3s4; + this.gu_1 = packages; } protoOf($installCOROUTINE$5).xb = function () { var suspendResult = this.rb_1; @@ -70938,7 +71867,7 @@ if (typeof Math.imul === 'undefined') { case 0: this.qb_1 = 3; this.pb_1 = 1; - suspendResult = this.st_1.jt(this); + suspendResult = this.fu_1.wt(this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -70946,7 +71875,7 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: this.pb_1 = 2; - var tmp0_arrayOf = arrayConcat([['--distribution', this.st_1.pq_1, 'zypper', '--non-interactive', 'install'], this.tt_1]); + var tmp0_arrayOf = arrayConcat([['--distribution', this.fu_1.cr_1, 'zypper', '--non-interactive', 'install'], this.gu_1]); suspendResult = exec_1('wsl', tmp0_arrayOf, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; @@ -70970,19 +71899,19 @@ if (typeof Math.imul === 'undefined') { } while (true); }; - protoOf(ZypperBasedDistribution).jt = function ($completion) { + protoOf(ZypperBasedDistribution).wt = function ($completion) { var tmp = new $refreshCOROUTINE$3(this, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); }; - protoOf(ZypperBasedDistribution).xq = function ($completion) { + protoOf(ZypperBasedDistribution).kr = function ($completion) { var tmp = new $updateCOROUTINE$4(this, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); }; - protoOf(ZypperBasedDistribution).yq = function (packages, $completion) { + protoOf(ZypperBasedDistribution).lr = function (packages, $completion) { var tmp = new $installCOROUTINE$5(this, packages, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; @@ -70992,7 +71921,7 @@ if (typeof Math.imul === 'undefined') { } function $refreshCOROUTINE$6(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.cu_1 = _this__u8e3s4; + this.pu_1 = _this__u8e3s4; } protoOf($refreshCOROUTINE$6).xb = function () { var suspendResult = this.rb_1; @@ -71006,31 +71935,31 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: var tmp_0 = this; - tmp_0.eu_1 = numberRangeToNumber(1, 5); + tmp_0.ru_1 = numberRangeToNumber(1, 5); var tmp_1 = this; - tmp_1.fu_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this.eu_1, 10)); - this.gu_1 = this.eu_1.c(); + tmp_1.su_1 = ArrayList_init_$Create$_0(collectionSizeOrDefault(this.ru_1, 10)); + this.tu_1 = this.ru_1.c(); this.pb_1 = 2; continue $sm; case 2: - if (!this.gu_1.d()) { + if (!this.tu_1.d()) { this.pb_1 = 6; continue $sm; } - this.hu_1 = this.gu_1.e(); + this.uu_1 = this.tu_1.e(); this.qb_1 = 4; var tmp_2 = this; - tmp_2.ju_1 = Companion_getInstance_4(); + tmp_2.wu_1 = Companion_getInstance_4(); this.pb_1 = 3; - suspendResult = protoOf(ZypperBasedDistribution).jt.call(this.cu_1, this); + suspendResult = protoOf(ZypperBasedDistribution).wt.call(this.pu_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 3: - this.du_1 = suspendResult; + this.qu_1 = suspendResult; this.qb_1 = 8; this.pb_1 = 7; continue $sm; @@ -71041,7 +71970,7 @@ if (typeof Math.imul === 'undefined') { var e = this.sb_1; var tmp_4 = this; var tmp2_failure = Companion_getInstance_4(); - tmp_4.iu_1 = _Result___init__impl__xyqfz8(createFailure(e)); + tmp_4.vu_1 = _Result___init__impl__xyqfz8(createFailure(e)); this.pb_1 = 5; continue $sm; } else { @@ -71051,12 +71980,12 @@ if (typeof Math.imul === 'undefined') { break; case 5: this.qb_1 = 8; - var tmp3_onFailure = this.iu_1; + var tmp3_onFailure = this.vu_1; var tmp0_safe_receiver = Result__exceptionOrNull_impl_p6xea9(tmp3_onFailure); if (tmp0_safe_receiver == null) null; else { - if (!(this.hu_1 === 5)) { + if (!(this.uu_1 === 5)) { debug(stackTraceToString(tmp0_safe_receiver)); var tmp0_elvis_lhs = tmp0_safe_receiver.message; info('Failure happened, retrying (' + toString_2(tmp0_elvis_lhs == null ? tmp0_safe_receiver : tmp0_elvis_lhs) + ')'); @@ -71065,12 +71994,12 @@ if (typeof Math.imul === 'undefined') { ; var ARGUMENT = tmp3_onFailure; - this.fu_1.a(new Result(ARGUMENT)); + this.su_1.a(new Result(ARGUMENT)); ; this.pb_1 = 2; continue $sm; case 6: - var ARGUMENT_0 = this.fu_1; + var ARGUMENT_0 = this.su_1; var tmp2_getOrThrow = last(ARGUMENT_0).l4_1; throwOnFailure(tmp2_getOrThrow); var tmp_5 = _Result___get_value__impl__bjfvqg(tmp2_getOrThrow); @@ -71105,7 +72034,7 @@ if (typeof Math.imul === 'undefined') { tmp$ret$0 = {}; ZypperBasedDistribution_init_$Init$('openSUSE-Leap-15.2', 'openSUSE Leap', new SemVer('15.2.0', tmp$ret$0), new URL('https://aka.ms/wsl-opensuseleap15-2'), 'openSUSE-Leap-15.2.exe', this); } - protoOf(OpenSuseLeap15_2).jt = function ($completion) { + protoOf(OpenSuseLeap15_2).wt = function ($completion) { var tmp = new $refreshCOROUTINE$6(this, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; @@ -71130,7 +72059,7 @@ if (typeof Math.imul === 'undefined') { } function $refreshCOROUTINE$7(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.av_1 = _this__u8e3s4; + this.nv_1 = _this__u8e3s4; } protoOf($refreshCOROUTINE$7).xb = function () { var suspendResult = this.rb_1; @@ -71141,7 +72070,7 @@ if (typeof Math.imul === 'undefined') { case 0: this.qb_1 = 2; this.pb_1 = 1; - var tmp0_arrayOf = ['--distribution', this.av_1.pq_1, 'apk', 'update']; + var tmp0_arrayOf = ['--distribution', this.nv_1.cr_1, 'apk', 'update']; suspendResult = exec_1('wsl', tmp0_arrayOf, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; @@ -71167,7 +72096,7 @@ if (typeof Math.imul === 'undefined') { }; function $updateCOROUTINE$8(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.jv_1 = _this__u8e3s4; + this.wv_1 = _this__u8e3s4; } protoOf($updateCOROUTINE$8).xb = function () { var suspendResult = this.rb_1; @@ -71178,7 +72107,7 @@ if (typeof Math.imul === 'undefined') { case 0: this.qb_1 = 3; this.pb_1 = 1; - suspendResult = refresh_0(this.jv_1, this); + suspendResult = refresh_0(this.wv_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -71186,7 +72115,7 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: this.pb_1 = 2; - var tmp0_arrayOf = ['--distribution', this.jv_1.pq_1, 'apk', 'upgrade']; + var tmp0_arrayOf = ['--distribution', this.wv_1.cr_1, 'apk', 'upgrade']; suspendResult = exec_1('wsl', tmp0_arrayOf, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; @@ -71212,8 +72141,8 @@ if (typeof Math.imul === 'undefined') { }; function $installCOROUTINE$9(_this__u8e3s4, packages, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.sv_1 = _this__u8e3s4; - this.tv_1 = packages; + this.fw_1 = _this__u8e3s4; + this.gw_1 = packages; } protoOf($installCOROUTINE$9).xb = function () { var suspendResult = this.rb_1; @@ -71224,7 +72153,7 @@ if (typeof Math.imul === 'undefined') { case 0: this.qb_1 = 3; this.pb_1 = 1; - suspendResult = refresh_0(this.sv_1, this); + suspendResult = refresh_0(this.fw_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -71232,7 +72161,7 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: this.pb_1 = 2; - var tmp0_arrayOf = arrayConcat([['--distribution', this.sv_1.pq_1, 'apk', 'add'], this.tv_1]); + var tmp0_arrayOf = arrayConcat([['--distribution', this.fw_1.cr_1, 'apk', 'add'], this.gw_1]); suspendResult = exec_1('wsl', tmp0_arrayOf, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; @@ -71256,13 +72185,13 @@ if (typeof Math.imul === 'undefined') { } while (true); }; - protoOf(ApkBasedDistribution).xq = function ($completion) { + protoOf(ApkBasedDistribution).kr = function ($completion) { var tmp = new $updateCOROUTINE$8(this, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); }; - protoOf(ApkBasedDistribution).yq = function (packages, $completion) { + protoOf(ApkBasedDistribution).lr = function (packages, $completion) { var tmp = new $installCOROUTINE$9(this, packages, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; @@ -71290,7 +72219,7 @@ if (typeof Math.imul === 'undefined') { properties_initialized_Distribution_kt_qdwpiy = true; var tmp$ret$2; // Inline function 'kotlin.collections.associateBy' call - var tmp1_associateBy = listOf([Alpine_getInstance(), Debian_getInstance(), Kali_getInstance(), OpenSuseLeap15_2_getInstance(), Ubuntu1604_getInstance(), Ubuntu1804_getInstance(), Ubuntu2004_getInstance(), Ubuntu2204_getInstance()]); + var tmp1_associateBy = listOf([Alpine_getInstance(), Debian_getInstance(), Kali_getInstance(), OpenSuseLeap15_2_getInstance(), Ubuntu1604_getInstance(), Ubuntu1804_getInstance(), Ubuntu2004_getInstance(), Ubuntu2204_getInstance(), Ubuntu2404_getInstance()]); var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(tmp1_associateBy, 10)), 16); var tmp$ret$1; // Inline function 'kotlin.collections.associateByTo' call @@ -71300,7 +72229,7 @@ if (typeof Math.imul === 'undefined') { var element = tmp0_iterator.e(); var tmp$ret$0; // Inline function 'net.kautler.github.action.setup_wsl.distributions.' call - tmp$ret$0 = element.vq_1; + tmp$ret$0 = element.ir_1; tmp0_associateByTo.o5(tmp$ret$0, element); } tmp$ret$1 = tmp0_associateByTo; @@ -71470,8 +72399,8 @@ if (typeof Math.imul === 'undefined') { tmp.sb_1 = null; return tmp.xb(); } - function createWslConf($completion) { - var tmp = new $createWslConfCOROUTINE$17($completion); + function adjustWslConf($completion) { + var tmp = new $adjustWslConfCOROUTINE$17($completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); @@ -71505,14 +72434,14 @@ if (typeof Math.imul === 'undefined') { function wslHelp$slambda(resultContinuation) { CoroutineImpl.call(this, resultContinuation); } - protoOf(wslHelp$slambda).r11 = function ($this$async, $completion) { - var tmp = this.oq($this$async, $completion); + protoOf(wslHelp$slambda).e12 = function ($this$async, $completion) { + var tmp = this.br($this$async, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); }; protoOf(wslHelp$slambda).jc = function (p1, $completion) { - return this.r11((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); + return this.e12((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); }; protoOf(wslHelp$slambda).xb = function () { var suspendResult = this.rb_1; @@ -71522,18 +72451,18 @@ if (typeof Math.imul === 'undefined') { switch (tmp) { case 0: this.qb_1 = 2; - this.n11_1 = StringBuilder_init_$Create$_0(); - this.o11_1 = StringBuilder_init_$Create$_0(); - this.p11_1 = StringBuilder_init_$Create$_0(); - this.q11_1 = StringBuilder_init_$Create$_0(); + this.a12_1 = StringBuilder_init_$Create$_0(); + this.b12_1 = StringBuilder_init_$Create$_0(); + this.c12_1 = StringBuilder_init_$Create$_0(); + this.d12_1 = StringBuilder_init_$Create$_0(); this.pb_1 = 1; var tmp0_apply = {}; tmp0_apply.ignoreReturnCode = true; tmp0_apply.outStream = new NullWritable(); tmp0_apply.errStream = new NullWritable(); var tmp0_apply_0 = {}; - tmp0_apply_0.stdout = wslHelp$slambda$lambda(this.n11_1, this.o11_1); - tmp0_apply_0.stderr = wslHelp$slambda$lambda_0(this.p11_1, this.q11_1); + tmp0_apply_0.stdout = wslHelp$slambda$lambda(this.a12_1, this.b12_1); + tmp0_apply_0.stderr = wslHelp$slambda$lambda_0(this.c12_1, this.d12_1); ; tmp0_apply.listeners = tmp0_apply_0; ; @@ -71545,13 +72474,13 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: ; - this.n11_1.b(this.o11_1); + this.a12_1.b(this.b12_1); ; - this.n11_1.b(this.p11_1); + this.a12_1.b(this.c12_1); ; - this.n11_1.b(this.q11_1); + this.a12_1.b(this.d12_1); ; - return this.n11_1.toString(); + return this.a12_1.toString(); case 2: throw this.sb_1; } @@ -71566,15 +72495,15 @@ if (typeof Math.imul === 'undefined') { } while (true); }; - protoOf(wslHelp$slambda).oq = function ($this$async, completion) { + protoOf(wslHelp$slambda).br = function ($this$async, completion) { var i = new wslHelp$slambda(completion); - i.m11_1 = $this$async; + i.z11_1 = $this$async; return i; }; function wslHelp$slambda_0(resultContinuation) { var i = new wslHelp$slambda(resultContinuation); var l = function ($this$async, $completion) { - return i.r11($this$async, $completion); + return i.e12($this$async, $completion); }; l.$arity = 1; return l; @@ -71616,14 +72545,14 @@ if (typeof Math.imul === 'undefined') { function wslId$slambda(resultContinuation) { CoroutineImpl.call(this, resultContinuation); } - protoOf(wslId$slambda).r11 = function ($this$async, $completion) { - var tmp = this.oq($this$async, $completion); + protoOf(wslId$slambda).e12 = function ($this$async, $completion) { + var tmp = this.br($this$async, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); }; protoOf(wslId$slambda).jc = function (p1, $completion) { - return this.r11((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); + return this.e12((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); }; protoOf(wslId$slambda).xb = function () { var suspendResult = this.rb_1; @@ -71650,7 +72579,7 @@ if (typeof Math.imul === 'undefined') { this.pb_1 = 2; continue $sm; case 2: - return get_distribution().pq_1; + return get_distribution().cr_1; case 3: throw this.sb_1; } @@ -71665,15 +72594,15 @@ if (typeof Math.imul === 'undefined') { } while (true); }; - protoOf(wslId$slambda).oq = function ($this$async, completion) { + protoOf(wslId$slambda).br = function ($this$async, completion) { var i = new wslId$slambda(completion); - i.a12_1 = $this$async; + i.n12_1 = $this$async; return i; }; function wslId$slambda_0(resultContinuation) { var i = new wslId$slambda(resultContinuation); var l = function ($this$async, $completion) { - return i.r11($this$async, $completion); + return i.e12($this$async, $completion); }; l.$arity = 1; return l; @@ -71681,14 +72610,14 @@ if (typeof Math.imul === 'undefined') { function installationNeeded$slambda(resultContinuation) { CoroutineImpl.call(this, resultContinuation); } - protoOf(installationNeeded$slambda).k12 = function ($this$async, $completion) { - var tmp = this.oq($this$async, $completion); + protoOf(installationNeeded$slambda).x12 = function ($this$async, $completion) { + var tmp = this.br($this$async, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); }; protoOf(installationNeeded$slambda).jc = function (p1, $completion) { - return this.k12((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); + return this.x12((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); }; protoOf(installationNeeded$slambda).xb = function () { var suspendResult = this.rb_1; @@ -71699,7 +72628,7 @@ if (typeof Math.imul === 'undefined') { case 0: this.qb_1 = 2; this.pb_1 = 1; - var tmp0_arrayOf = ['--distribution', get_distribution().pq_1, 'true']; + var tmp0_arrayOf = ['--distribution', get_distribution().cr_1, 'true']; var tmp1_apply = {}; tmp1_apply.ignoreReturnCode = true; tmp1_apply.outStream = new NullWritable(); @@ -71729,15 +72658,15 @@ if (typeof Math.imul === 'undefined') { } while (true); }; - protoOf(installationNeeded$slambda).oq = function ($this$async, completion) { + protoOf(installationNeeded$slambda).br = function ($this$async, completion) { var i = new installationNeeded$slambda(completion); - i.j12_1 = $this$async; + i.w12_1 = $this$async; return i; }; function installationNeeded$slambda_0(resultContinuation) { var i = new installationNeeded$slambda(resultContinuation); var l = function ($this$async, $completion) { - return i.k12($this$async, $completion); + return i.x12($this$async, $completion); }; l.$arity = 1; return l; @@ -71745,14 +72674,14 @@ if (typeof Math.imul === 'undefined') { function toolCacheDir$slambda(resultContinuation) { CoroutineImpl.call(this, resultContinuation); } - protoOf(toolCacheDir$slambda).r11 = function ($this$async, $completion) { - var tmp = this.oq($this$async, $completion); + protoOf(toolCacheDir$slambda).e12 = function ($this$async, $completion) { + var tmp = this.br($this$async, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); }; protoOf(toolCacheDir$slambda).jc = function (p1, $completion) { - return this.r11((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); + return this.e12((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); }; protoOf(toolCacheDir$slambda).xb = function () { var suspendResult = this.rb_1; @@ -71770,9 +72699,9 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: - this.u12_1 = suspendResult; + this.h13_1 = suspendResult; this.pb_1 = 2; - suspendResult = cacheDir_0(this.u12_1, get_distribution().qq_1, '' + get_distribution().rq_1, this); + suspendResult = cacheDir_0(this.h13_1, get_distribution().dr_1, '' + get_distribution().er_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -71794,15 +72723,15 @@ if (typeof Math.imul === 'undefined') { } while (true); }; - protoOf(toolCacheDir$slambda).oq = function ($this$async, completion) { + protoOf(toolCacheDir$slambda).br = function ($this$async, completion) { var i = new toolCacheDir$slambda(completion); - i.t12_1 = $this$async; + i.g13_1 = $this$async; return i; }; function toolCacheDir$slambda_0(resultContinuation) { var i = new toolCacheDir$slambda(resultContinuation); var l = function ($this$async, $completion) { - return i.r11($this$async, $completion); + return i.e12($this$async, $completion); }; l.$arity = 1; return l; @@ -71860,17 +72789,17 @@ if (typeof Math.imul === 'undefined') { return result; } function distributionDirectory$slambda$o$collect$slambda($collector, resultContinuation) { - this.d13_1 = $collector; + this.q13_1 = $collector; CoroutineImpl.call(this, resultContinuation); } - protoOf(distributionDirectory$slambda$o$collect$slambda).g13 = function (value, $completion) { - var tmp = this.h13(value, $completion); + protoOf(distributionDirectory$slambda$o$collect$slambda).t13 = function (value, $completion) { + var tmp = this.u13(value, $completion); tmp.rb_1 = Unit_getInstance(); tmp.sb_1 = null; return tmp.xb(); }; protoOf(distributionDirectory$slambda$o$collect$slambda).jc = function (p1, $completion) { - return this.g13((!(p1 == null) ? typeof p1 === 'string' : false) ? p1 : THROW_CCE(), $completion); + return this.t13((!(p1 == null) ? typeof p1 === 'string' : false) ? p1 : THROW_CCE(), $completion); }; protoOf(distributionDirectory$slambda$o$collect$slambda).xb = function () { var suspendResult = this.rb_1; @@ -71884,9 +72813,9 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: var tmp0_contains = Regex_init_$Create$('(? 0) { this.pb_1 = 5; - suspendResult = group('Create /etc/wsl.conf', createWslConf$ref_0(), this); + suspendResult = group('Create or overwrite /etc/wsl.conf', adjustWslConf$ref_0(), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -72882,7 +73811,7 @@ if (typeof Math.imul === 'undefined') { case 13: var tmp4_isNotEmpty = get_wslShellCommand(); if (charSequenceLength(tmp4_isNotEmpty) > 0) { - this.nw_1 = true; + this.ax_1 = true; this.pb_1 = 15; continue $sm; } else { @@ -72896,13 +73825,13 @@ if (typeof Math.imul === 'undefined') { break; case 14: - this.ow_1 = suspendResult; - this.nw_1 = !this.ow_1; + this.bx_1 = suspendResult; + this.ax_1 = !this.bx_1; this.pb_1 = 15; continue $sm; case 15: - if (this.nw_1) { - this.mw_1 = true; + if (this.ax_1) { + this.zw_1 = true; this.pb_1 = 17; continue $sm; } else { @@ -72917,12 +73846,12 @@ if (typeof Math.imul === 'undefined') { ; break; case 16: - this.pw_1 = suspendResult; - this.mw_1 = !this.pw_1; + this.cx_1 = suspendResult; + this.zw_1 = !this.cx_1; this.pb_1 = 17; continue $sm; case 17: - if (this.mw_1) { + if (this.zw_1) { this.pb_1 = 18; suspendResult = group('Write WSL Shell Wrapper', writeWslShellWrapper$ref_0(), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { @@ -72947,7 +73876,7 @@ if (typeof Math.imul === 'undefined') { setOutput('wsl-shell-distribution-wrapper-path', get_wslShellDistributionWrapperPath()); var tmp1_success = Unit_getInstance(); var tmp_2 = this; - tmp_2.kw_1 = _Result___init__impl__xyqfz8(Unit_getInstance()); + tmp_2.xw_1 = _Result___init__impl__xyqfz8(Unit_getInstance()); this.qb_1 = 22; this.pb_1 = 23; continue $sm; @@ -72958,7 +73887,7 @@ if (typeof Math.imul === 'undefined') { var e = this.sb_1; var tmp_4 = this; var tmp2_failure = Companion_getInstance_4(); - tmp_4.kw_1 = _Result___init__impl__xyqfz8(createFailure(e)); + tmp_4.xw_1 = _Result___init__impl__xyqfz8(createFailure(e)); this.pb_1 = 23; continue $sm; } else { @@ -72970,7 +73899,7 @@ if (typeof Math.imul === 'undefined') { throw this.sb_1; case 23: this.qb_1 = 22; - var tmp3_onFailure = this.kw_1; + var tmp3_onFailure = this.xw_1; var tmp0_safe_receiver = Result__exceptionOrNull_impl_p6xea9(tmp3_onFailure); if (tmp0_safe_receiver == null) null; @@ -72997,7 +73926,7 @@ if (typeof Math.imul === 'undefined') { }; function $extractZipCOROUTINE$12(archive, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.yw_1 = archive; + this.lx_1 = archive; } protoOf($extractZipCOROUTINE$12).xb = function () { var suspendResult = this.rb_1; @@ -73007,9 +73936,9 @@ if (typeof Math.imul === 'undefined') { switch (tmp) { case 0: this.qb_1 = 3; - this.zw_1 = this.yw_1 + '.zip'; + this.mx_1 = this.lx_1 + '.zip'; this.pb_1 = 1; - suspendResult = mv_0(this.yw_1, this.zw_1, this); + suspendResult = mv_0(this.lx_1, this.mx_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -73017,7 +73946,7 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: this.pb_1 = 2; - suspendResult = extractZip_0(this.zw_1, this); + suspendResult = extractZip_0(this.mx_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -73041,8 +73970,8 @@ if (typeof Math.imul === 'undefined') { }; function $executeWslCommandCOROUTINE$13(wslArguments, wslconfigArguments, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.ix_1 = wslArguments; - this.jx_1 = wslconfigArguments; + this.vx_1 = wslArguments; + this.wx_1 = wslconfigArguments; } protoOf($executeWslCommandCOROUTINE$13).xb = function () { var suspendResult = this.rb_1; @@ -73060,18 +73989,18 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: - this.kx_1 = suspendResult; - if (contains_1(this.kx_1, first(this.ix_1))) { + this.xx_1 = suspendResult; + if (contains_1(this.xx_1, first(this.vx_1))) { this.pb_1 = 3; - suspendResult = exec_1('wsl', this.ix_1, this); + suspendResult = exec_1('wsl', this.vx_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; } else { - if (!(this.jx_1 == null)) { + if (!(this.wx_1 == null)) { this.pb_1 = 2; - suspendResult = exec_1('wslconfig', this.jx_1, this); + suspendResult = exec_1('wslconfig', this.wx_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -73109,8 +74038,8 @@ if (typeof Math.imul === 'undefined') { }; function $groupCOROUTINE$14(name, fn, resultContinuation) { CoroutineImpl.call(this, resultContinuation); - this.tx_1 = name; - this.ux_1 = fn; + this.gy_1 = name; + this.hy_1 = fn; } protoOf($groupCOROUTINE$14).xb = function () { var suspendResult = this.rb_1; @@ -73120,7 +74049,7 @@ if (typeof Math.imul === 'undefined') { switch (tmp) { case 0: this.qb_1 = 7; - startGroup(this.tx_1); + startGroup(this.gy_1); this.pb_1 = 1; continue $sm; case 1: @@ -73129,20 +74058,20 @@ if (typeof Math.imul === 'undefined') { case 2: this.qb_1 = 6; this.pb_1 = 3; - suspendResult = this.ux_1(this); + suspendResult = this.hy_1(this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 3: - this.vx_1 = suspendResult; + this.iy_1 = suspendResult; this.qb_1 = 7; this.pb_1 = 4; var tmp_0 = this; continue $sm; case 4: - var tmp_1 = this.vx_1; + var tmp_1 = this.iy_1; endGroup(); ; return tmp_1; @@ -73195,9 +74124,9 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: - this.fy_1 = suspendResult; - if (!isBlank(this.fy_1)) { - this.ey_1 = true; + this.sy_1 = suspendResult; + if (!isBlank(this.sy_1)) { + this.ry_1 = true; this.pb_1 = 3; continue $sm; } else { @@ -73212,11 +74141,11 @@ if (typeof Math.imul === 'undefined') { break; case 2: var tmp2_isNotBlank = suspendResult; - this.ey_1 = !isBlank(tmp2_isNotBlank); + this.ry_1 = !isBlank(tmp2_isNotBlank); this.pb_1 = 3; continue $sm; case 3: - var tmp3_check = this.ey_1; + var tmp3_check = this.ry_1; if (!tmp3_check) { var message_0 = "This Windows environment does not have WSL enabled, please verify your 'runs-on' setting"; throw IllegalStateException_init_$Create$(toString_2(message_0)); @@ -73256,7 +74185,7 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: - this.oy_1 = path; + this.bz_1 = path; this.pb_1 = 2; suspendResult = invoke(get_distributionDirectory(), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { @@ -73265,18 +74194,18 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 2: - this.py_1 = suspendResult; - this.qy_1 = [this.py_1, get_distribution().uq_1]; - this.ry_1 = function () { - var $externalVarargReceiverTmp = this.oy_1; - return $externalVarargReceiverTmp.join.apply($externalVarargReceiverTmp, [].slice.call(this.qy_1)); + this.cz_1 = suspendResult; + this.dz_1 = [this.cz_1, get_distribution().hr_1]; + this.ez_1 = function () { + var $externalVarargReceiverTmp = this.bz_1; + return $externalVarargReceiverTmp.join.apply($externalVarargReceiverTmp, [].slice.call(this.dz_1)); }.call(this); - this.sy_1 = '"' + this.ry_1 + '"'; + this.fz_1 = '"' + this.ez_1 + '"'; this.pb_1 = 3; var tmp0_apply = {}; tmp0_apply.input = Buffer.from(''); ; - suspendResult = exec_0(this.sy_1, ['install', '--root'], tmp0_apply, this); + suspendResult = exec_0(this.fz_1, ['install', '--root'], tmp0_apply, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -73299,10 +74228,10 @@ if (typeof Math.imul === 'undefined') { } while (true); }; - function $createWslConfCOROUTINE$17(resultContinuation) { + function $adjustWslConfCOROUTINE$17(resultContinuation) { CoroutineImpl.call(this, resultContinuation); } - protoOf($createWslConfCOROUTINE$17).xb = function () { + protoOf($adjustWslConfCOROUTINE$17).xb = function () { var suspendResult = this.rb_1; $sm: do try { @@ -73318,12 +74247,12 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: - this.bz_1 = suspendResult; - this.cz_1 = ['--distribution', this.bz_1, 'sh', '-c', "echo '" + get_wslConf() + "' >/etc/wsl.conf"]; + this.oz_1 = suspendResult; + this.pz_1 = ['--distribution', this.oz_1, 'sh', '-c', "echo '" + get_wslConf() + "' >/etc/wsl.conf"]; var tmp_0 = this; - tmp_0.dz_1 = this.cz_1; + tmp_0.qz_1 = this.pz_1; this.pb_1 = 2; - suspendResult = exec_1('wsl', this.dz_1, this); + suspendResult = exec_1('wsl', this.qz_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -73339,10 +74268,10 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 3: - this.ez_1 = suspendResult; - this.fz_1 = ['--terminate', this.ez_1]; + this.rz_1 = suspendResult; + this.sz_1 = ['--terminate', this.rz_1]; var tmp_1 = this; - tmp_1.gz_1 = this.fz_1; + tmp_1.tz_1 = this.sz_1; this.pb_1 = 4; suspendResult = invoke(get_wslId(), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { @@ -73351,12 +74280,12 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 4: - this.hz_1 = suspendResult; - this.iz_1 = ['/terminate', this.hz_1]; + this.uz_1 = suspendResult; + this.vz_1 = ['/terminate', this.uz_1]; var tmp_2 = this; - tmp_2.jz_1 = this.iz_1; + tmp_2.wz_1 = this.vz_1; this.pb_1 = 5; - suspendResult = executeWslCommand(this.gz_1, this.jz_1, this); + suspendResult = executeWslCommand(this.tz_1, this.wz_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -73397,10 +74326,10 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 1: - this.sz_1 = suspendResult; - this.tz_1 = ['--set-default', this.sz_1]; + this.f10_1 = suspendResult; + this.g10_1 = ['--set-default', this.f10_1]; var tmp_0 = this; - tmp_0.uz_1 = this.tz_1; + tmp_0.h10_1 = this.g10_1; this.pb_1 = 2; suspendResult = invoke(get_wslId(), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { @@ -73409,12 +74338,12 @@ if (typeof Math.imul === 'undefined') { continue $sm; case 2: - this.vz_1 = suspendResult; - this.wz_1 = ['/setdefault', this.vz_1]; + this.i10_1 = suspendResult; + this.j10_1 = ['/setdefault', this.i10_1]; var tmp_1 = this; - tmp_1.xz_1 = this.wz_1; + tmp_1.k10_1 = this.j10_1; this.pb_1 = 3; - suspendResult = executeWslCommand(this.uz_1, this.xz_1, this); + suspendResult = executeWslCommand(this.h10_1, this.k10_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -73464,35 +74393,35 @@ if (typeof Math.imul === 'undefined') { } continue $sm; } else { - this.g10_1 = false; + this.t10_1 = false; this.pb_1 = 4; continue $sm; } break; case 2: - this.h10_1 = suspendResult; - this.i10_1 = ['--distribution', this.h10_1, 'bash', '-c', 'true']; + this.u10_1 = suspendResult; + this.v10_1 = ['--distribution', this.u10_1, 'bash', '-c', 'true']; var tmp_0 = this; - tmp_0.j10_1 = this.i10_1; + tmp_0.w10_1 = this.v10_1; this.pb_1 = 3; var tmp2_apply = {}; tmp2_apply.ignoreReturnCode = true; ; - suspendResult = exec_0('wsl', this.j10_1, tmp2_apply, this); + suspendResult = exec_0('wsl', this.w10_1, tmp2_apply, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 3: - this.k10_1 = suspendResult; - this.l10_1 = equals_0(this.k10_1, 0); - this.g10_1 = !this.l10_1; + this.x10_1 = suspendResult; + this.y10_1 = equals_0(this.x10_1, 0); + this.t10_1 = !this.y10_1; this.pb_1 = 4; continue $sm; case 4: - this.m10_1 = this.g10_1; + this.z10_1 = this.t10_1; var tmp3_isNotEmpty = get_wslShellUser(); if (charSequenceLength(tmp3_isNotEmpty) > 0) { this.pb_1 = 5; @@ -73509,24 +74438,24 @@ if (typeof Math.imul === 'undefined') { ; break; case 5: - this.n10_1 = suspendResult; - this.o10_1 = ['--distribution', this.n10_1, 'id', '-u', get_wslShellUser()]; + this.a11_1 = suspendResult; + this.b11_1 = ['--distribution', this.a11_1, 'id', '-u', get_wslShellUser()]; var tmp_1 = this; - tmp_1.p10_1 = this.o10_1; + tmp_1.c11_1 = this.b11_1; this.pb_1 = 6; var tmp5_apply = {}; tmp5_apply.ignoreReturnCode = true; ; - suspendResult = exec_0('wsl', this.p10_1, tmp5_apply, this); + suspendResult = exec_0('wsl', this.c11_1, tmp5_apply, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 6: - this.q10_1 = suspendResult; - this.r10_1 = equals_0(this.q10_1, 0); - if (!this.r10_1) { + this.d11_1 = suspendResult; + this.e11_1 = equals_0(this.d11_1, 0); + if (!this.e11_1) { this.pb_1 = 7; suspendResult = invoke(get_wslId(), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { @@ -73540,12 +74469,12 @@ if (typeof Math.imul === 'undefined') { break; case 7: - this.s10_1 = suspendResult; - this.t10_1 = ['--distribution', this.s10_1, 'useradd', '-m', '-p', '4qBD5NWD3IkbU', get_wslShellUser()]; + this.f11_1 = suspendResult; + this.g11_1 = ['--distribution', this.f11_1, 'useradd', '-m', '-p', '4qBD5NWD3IkbU', get_wslShellUser()]; var tmp_2 = this; - tmp_2.u10_1 = this.t10_1; + tmp_2.h11_1 = this.g11_1; this.pb_1 = 8; - suspendResult = exec_1('wsl', this.u10_1, this); + suspendResult = exec_1('wsl', this.h11_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } @@ -73561,8 +74490,8 @@ if (typeof Math.imul === 'undefined') { case 10: var tmp_3 = this; var tmp_4; - if (this.m10_1) { - tmp_4 = '\n @ECHO ' + (isDebug() ? 'ON' : 'OFF') + "\n\n ECHO Bash is not available by default in '" + get_distribution().vq_1 + "', please either add it to 'additional-packages' input or configure a different 'wsl-shell-command' >&2\n EXIT /B 1\n "; + if (this.z10_1) { + tmp_4 = '\n @ECHO ' + (isDebug() ? 'ON' : 'OFF') + "\n\n ECHO Bash is not available by default in '" + get_distribution().ir_1 + "', please either add it to 'additional-packages' input or configure a different 'wsl-shell-command' >&2\n EXIT /B 1\n "; } else { var tmp_5 = isDebug() ? 'ON' : 'OFF'; var tmp_6; @@ -73587,10 +74516,10 @@ if (typeof Math.imul === 'undefined') { tmp_4 = '\n @ECHO ' + tmp_5 + "\n\n SETLOCAL\n\n IF '%1' EQU '' (\n REM wsl-shell\n GOTO INVALID_ARGUMENTS\n ) ELSE IF '%2' EQU '' (\n REM wsl-shell scriptFile\n " + tmp_7 + "\n SET scriptFile=%~1\n ) ELSE IF '%1' NEQ '-u' (\n REM wsl-shell user scriptFile\n GOTO INVALID_ARGUMENTS\n ) ELSE IF '%3' EQU '' (\n REM wsl-shell -u user\n GOTO INVALID_ARGUMENTS\n ) ELSE IF '%4' NEQ '' (\n REM wsl-shell -u user scriptFile foo\n GOTO INVALID_ARGUMENTS\n ) ELSE (\n REM wsl-shell -u user scriptFile\n SET wslShellUser=-u %~2\n SET scriptFile=%~3\n )\n\n IF NOT EXIST %scriptFile% GOTO INVALID_SCRIPT_FILE\n GOTO START\n\n :INVALID_ARGUMENTS\n ECHO Invalid arguments >&2\n GOTO USAGE\n\n :INVALID_SCRIPT_FILE\n ECHO Invalid script file \"%scriptFile%\" >&2\n GOTO USAGE\n\n :USAGE\n ECHO Usage: %~n0 [-u ^] ^