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 <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24450)
This commit is contained in:
Neil Horman 2024-06-28 15:35:36 -04:00
parent a8f99f98d6
commit aa08335852
2 changed files with 6 additions and 6 deletions

View File

@ -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: |

View File

@ -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: |