From: Neil Horman Date: Fri, 28 Jun 2024 19:35:36 +0000 (-0400) Subject: Fix sed/awk usage in windows ci jobs X-Git-Tag: openssl-3.4.0-alpha1~383 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa08335852a3714075c26690a6eeab456e813a54;p=thirdparty%2Fopenssl.git Fix sed/awk usage in windows ci jobs The addition of sed and awk, while available in the windows vm's for CI in powershell, don't behave as I would expect (though the same commands work with a local installation on windows using GnuWin32). In trying to figure out what was going on I found it was far more stable and predictable to use the powershell -split and -replace commands instead of sed and awk Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/24450) --- diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a0cb656e36c..fc194ebcbbf 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -56,9 +56,9 @@ jobs: run: | $Env:OPENSSL_CONF="apps\openssl.cnf" apps/openssl.exe version -v - apps/openssl.exe version -v | awk '{print $2}' - apps/openssl.exe version -v | awk '{print $2}' | sed -e's/\([0-9]\+\.[0-9]\+\)\(\.[0-9]\+\)\(-*.*$\)/\1/' - echo "OSSL_VERSION=$(apps/openssl.exe version -v | awk '{print $2}' | sed -e's/\([0-9]\+\.[0-9]\+\)\(\.[0-9]\+\)\(-*.*$\)/\1/')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + apps/openssl.exe version -v | %{($_ -split '\s+')[1]} + apps/openssl.exe version -v | %{($_ -split '\s+')[1] -replace '([0-9]+\.[0-9]+)(\..*)','$1'} + echo "OSSL_VERSION=$(apps/openssl.exe version -v | %{($_ -split '\s+')[1] -replace '([0-9]+\.[0-9]+)(\..*)','$1'})" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - name: Set registry keys working-directory: _build run: | diff --git a/.github/workflows/windows_comp.yml b/.github/workflows/windows_comp.yml index a65a6b5244d..36f4caf084a 100644 --- a/.github/workflows/windows_comp.yml +++ b/.github/workflows/windows_comp.yml @@ -38,9 +38,9 @@ jobs: run: | $Env:OPENSSL_CONF="apps\openssl.cnf" apps/openssl.exe version -v - apps/openssl.exe version -v | awk '{print $2}' - apps/openssl.exe version -v | awk '{print $2}' | sed -e's/\([0-9]\+\.[0-9]\+\)\(\.[0-9]\+\)\(-*.*$\)/\1/' - echo "OSSL_VERSION=$(apps/openssl.exe version -v | awk '{print $2}' | sed -e's/\([0-9]\+\.[0-9]\+\)\(\.[0-9]\+\)\(-*.*$\)/\1/')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + apps/openssl.exe version -v | %{($_ -split '\s+')[1]} + apps/openssl.exe version -v | %{($_ -split '\s+')[1] -replace '([0-9]+\.[0-9]+)(\..*)','$1'} + echo "OSSL_VERSION=$(apps/openssl.exe version -v | %{($_ -split '\s+')[1] -replace '([0-9]+\.[0-9]+)(\..*)','$1'})" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - name: Set registry keys working-directory: _build run: |