Skip to content

Commit

Permalink
Githubactions paths (#405)
Browse files Browse the repository at this point in the history
Update Githubaction workflows
  • Loading branch information
aveenismail authored May 30, 2024
1 parent 70df329 commit 68010e2
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ jobs:
run: brew install gengetopt help2man libedit

- name: clone the Yubico/yubihsm-shell repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: yubihsm-shell

Expand Down
56 changes: 34 additions & 22 deletions .github/workflows/build_and_test_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install prerequisites
run: |
set -x
Expand All @@ -22,7 +22,7 @@ jobs:
mkdir $GITHUB_WORKSPACE/artifact
mv $GITHUB_WORKSPACE/yubihsm-shell-.tar.gz $GITHUB_WORKSPACE/artifact/
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: yubihsm-shell-src
path: artifact
Expand All @@ -49,8 +49,8 @@ jobs:
arch_cmake: x64

steps:
- name: Download source from job_1
uses: actions/download-artifact@v3
- name: Download source from source job
uses: actions/download-artifact@v4
with:
name: yubihsm-shell-src

Expand All @@ -66,45 +66,57 @@ jobs:
run: |
Set-PSDebug -Trace 1
$YHSHELL_SRC_DIR="$env:GITHUB_WORKSPACE\yubihsm-shell-"
$MERGEDPATH = Get-ChildItem "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\v143\MergeModules\Microsoft_VC143_CRT_$env:ARCH.msm"
$MERGEDPATH = Get-ChildItem "C:\Program Files*\Microsoft Visual Studio\*\Enterprise\VC\Redist\MSVC\v14*\MergeModules\Microsoft_VC*_CRT_$env:ARCH.msm"
echo "MERGEDPATH = $MERGEDPATH"
cd $YHSHELL_SRC_DIR/resources/release/win
./make_release_binaries.ps1 $env:ARCH_CMAKE C:/vcpkg
./yubihsm-shell.exe --version | findstr "yubihsm-shell"
./yubihsm-shell.exe --help | findstr "Usage: yubihsm-shell [OPTION]"
cd $YHSHELL_SRC_DIR/resources/release/win
./repack_installer.ps1 $env:ARCH $env:WIX\bin "$MERGEDPATH"
#cp yubihsm-shell-$env:ARCH.msi yubihsm-shell.msi
cp yubihsm-shell-$env:ARCH.msi yubihsm-shell.msi
- name: Test installer and PKCS11 module
- name: Install yubihsm-shell from installer
run: |
Set-PSDebug -Trace 1
$log = "$env:GITHUB_WORKSPACE\install_shell.log"
Start-Process "msiexec" "/i `"$env:GITHUB_WORKSPACE\yubihsm-shell-\resources\release\win\yubihsm-shell.msi`" /qn /norestart /L*v `"$log`"" -NoNewWindow -PassThru
- name: Install OpenSC
env:
ARCH: ${{ matrix.arch }}

run: |
Set-PSDebug -Trace 1
cd $env:GITHUB_WORKSPACE\yubihsm-shell-\resources\release\win
# No actual connection, but this is enough to make sure that the PKCS11 module is found and loaded
$PKCS11_CONFIG="connector=http://127.0.0.1:12345"
$PKCS11_CONFIG | Out-File $env:GITHUB_WORKSPACE\yubihsm_pkcs11.conf
$env:YUBIHSM_PKCS11_CONF="$env:GITHUB_WORKSPACE\yubihsm_pkcs11.conf"
if($env:ARCH -eq "x86")
{
Invoke-WebRequest -Uri https://github.com/OpenSC/OpenSC/releases/download/0.23.0/OpenSC-0.23.0_win32.msi -OutFile OpenSC-0.23.0.msi -UseBasicParsing
Invoke-WebRequest -Uri https://github.com/OpenSC/OpenSC/releases/download/0.25.1/OpenSC-0.25.1_win32.msi -OutFile OpenSC.msi -UseBasicParsing
}
else
{
Invoke-WebRequest -Uri https://github.com/OpenSC/OpenSC/releases/download/0.23.0/OpenSC-0.23.0_win64.msi -OutFile OpenSC-0.23.0.msi -UseBasicParsing
Invoke-WebRequest -Uri https://github.com/OpenSC/OpenSC/releases/download/0.25.1/OpenSC-0.25.1_win64.msi -OutFile OpenSC.msi -UseBasicParsing
}
$log = "$env:GITHUB_WORKSPACE\install.log"
$procMain = Start-Process "msiexec" "/i `"OpenSC-0.23.0.msi`" /qn /l*! `"$log`"" -NoNewWindow -PassThru
$procMain.WaitForExit()
$procMain = Start-Process "msiexec" "/i `"yubihsm-shell-$env:ARCH.msi`" /qn /l*! `"$log`"" -NoNewWindow -PassThru
$procMain.WaitForExit()
Start-Sleep -Seconds 120
$log = "$env:GITHUB_WORKSPACE\install_opensc.log"
Start-Process "msiexec" "/i `"$env:GITHUB_WORKSPACE\OpenSC.msi`" /qn /l*! `"$log`"" -Wait -NoNewWindow -PassThru
- name: Test PKCS11 module
env:
ARCH: ${{ matrix.arch }}

run: |
Set-PSDebug -Trace 1
cd $env:GITHUB_WORKSPACE\yubihsm-shell-\resources\release\win
# No actual connection, but this is enough to make sure that the PKCS11 module is found and loaded
$PKCS11_CONFIG="connector=http://127.0.0.1:12345"
$PKCS11_CONFIG | Out-File $env:GITHUB_WORKSPACE\yubihsm_pkcs11.conf
$env:YUBIHSM_PKCS11_CONF="$env:GITHUB_WORKSPACE\yubihsm_pkcs11.conf"
if($env:ARCH -eq "x86")
{
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
jq
- name: clone the Yubico/yubihsm-shell repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: yubihsm-shell

Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
./opensc_test.sh $GITHUB_WORKSPACE/yubihsm-shell/build/pkcs11/yubihsm_pkcs11.so
- name: clone the YubicoLabs/yubihsm_sunpkcs11_tests repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: YubicoLabs/yubihsm_sunpkcs11_tests
path: yubihsm_sunpkcs11_tests
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
VERSION: 2.5.0
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install prerequisites
run: |
set -x
Expand All @@ -26,7 +26,7 @@ jobs:
mkdir $GITHUB_WORKSPACE/artifact
mv $GITHUB_WORKSPACE/yubihsm-shell-$VERSION.tar.gz $GITHUB_WORKSPACE/artifact/
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: yubihsm-shell-src
path: artifact
Expand All @@ -47,7 +47,7 @@ jobs:
VERSION: 2.5.0
steps:
- name: Download source from source job
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: yubihsm-shell-src

Expand All @@ -56,13 +56,12 @@ jobs:
Set-PSDebug -Trace 1
tar xf yubihsm-shell-$env:VERSION.tar.gz
- name: Build and make MSI installer
- name: Build release binaries
env:
ARCH: ${{ matrix.arch }}
run: |
Set-PSDebug -Trace 1
$YHSHELL_SRC_DIR="$env:GITHUB_WORKSPACE\yubihsm-shell-$env:VERSION"
$MERGEDPATH = Get-ChildItem "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Redist\MSVC\v143\MergeModules\Microsoft_VC143_CRT_$env:ARCH.msm"
cd $YHSHELL_SRC_DIR/resources/release/win
if($env:ARCH -eq "x86")
Expand All @@ -79,7 +78,7 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: yubihsm-shell-${{ matrix.arch }}
path: artifact
Expand All @@ -101,7 +100,7 @@ jobs:
SO_VERSION: 2
steps:
- name: Download source from source job
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: yubihsm-shell-src

Expand All @@ -126,7 +125,7 @@ jobs:
cp -r $YHSHELL_SRC_DIR/resources/release/macos/yubihsm-shell-darwin-$ARCH-$VERSION $GITHUB_WORKSPACE/artifact/
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: yubihsm-shell-darwin-${{ matrix.arch }}64
path: artifact
Expand Down
11 changes: 1 addition & 10 deletions resources/release/macos/make_release_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,7 @@ ARCH=$1 # amd or arm
VERSION=$2 # Full yubico-piv-tool version, tex 2.1.0
SO_VERSION=$3

if [ "$ARCH" == "amd" ]; then
BREW_LIB="/usr/local/opt"
#BREW_CELLAR="/usr/local/Cellar"
elif [ "$ARCH" == "arm" ]; then
BREW_LIB="/opt/homebrew/opt"
#BREW_CELLAR="/opt/homebrew/Cellar"
else
echo "Unknown architecture"
exit
fi
BREW_LIB="/opt/homebrew/opt"

brew install cmake pkg-config gengetopt help2man openssl

Expand Down

0 comments on commit 68010e2

Please sign in to comment.