Skip to content

Commit fa6662d

Browse files
authored
chore: detect where OpenSSL is installed on Windows runner (#256)
We have intermittent CI failures because OpenSSL is installed to either `Program Files\OpenSSL-Win64` or `Program Files\OpenSSL`. I'm not entirely sure why, but it seems to be luck of the draw on the runner. This should detect where it was installed and pass it to CMake. We can't force the install location because that requires a licensed chocolatey. Chocolatey also writes out the install location - for this particular package - but we'd have to process its output. Instead, this just tests the two known installation directories.
1 parent 5309250 commit fa6662d

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

.github/actions/sdk-release/action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,20 @@ runs:
9797
shell: bash
9898
run: |
9999
choco upgrade openssl --no-progress
100-
100+
- name: Determine OpenSSL Installation Directory
101+
if: runner.os == 'Windows'
102+
shell: bash
103+
run: |
104+
if [ -d "C:\Program Files\OpenSSL-Win64" ]; then
105+
echo "OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64" >> "$GITHUB_ENV"
106+
else
107+
echo "OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL" >> "$GITHUB_ENV"
108+
fi
101109
- name: Build Windows Artifacts
102110
if: runner.os == 'Windows'
103111
shell: bash
104112
env:
105-
OPENSSL_ROOT_DIR: 'C:\Program Files\OpenSSL-Win64'
113+
OPENSSL_ROOT_DIR: ${{ env.OPENSSL_ROOT_DIR }}
106114
BOOST_LIBRARY_DIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
107115
BOOST_LIBRARYDIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
108116
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

.github/workflows/client.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,19 @@ jobs:
5858
shell: bash
5959
run: |
6060
choco upgrade openssl --no-progress
61+
- name: Determine OpenSSL Installation Directory
62+
shell: bash
63+
run: |
64+
if [ -d "C:\Program Files\OpenSSL-Win64" ]; then
65+
echo "OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64" >> "$GITHUB_ENV"
66+
else
67+
echo "OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL" >> "$GITHUB_ENV"
68+
fi
6169
- uses: actions/checkout@v3
6270
- uses: ilammy/msvc-dev-cmd@v1
6371
- uses: ./.github/actions/ci
6472
env:
65-
OPENSSL_ROOT_DIR: 'C:\Program Files\OpenSSL-Win64'
73+
OPENSSL_ROOT_DIR: ${{ env.OPENSSL_ROOT_DIR }}
6674
BOOST_LIBRARY_DIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
6775
BOOST_LIBRARYDIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
6876
with:

.github/workflows/manual-sdk-release-artifacts.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Checks out the tag, builds release builds, and attaches them to the release for the tag.
22
# If you need to change build scripts, then update the tag to include the modifications.
3+
# NOTE: This workflow uses sdk-release/action.yml @ the tag specified in the workflow_dispatch input.
34
on:
45
workflow_dispatch:
56
inputs:
@@ -55,18 +56,18 @@ jobs:
5556
sdk_path: ${{ needs.split-input.outputs.sdk_path}}
5657
sdk_cmake_target: ${{ needs.split-input.outputs.sdk_cmake_target}}
5758
release-sdk-provenance:
58-
needs: ['release-sdk']
59+
needs: [ 'release-sdk' ]
5960
strategy:
6061
matrix:
6162
# Generates a combined attestation for each platform
6263
os: [ linux, windows, macos ]
63-
permissions:
64+
permissions:
6465
actions: read
6566
id-token: write
6667
contents: write
6768
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
6869
with:
6970
base64-subjects: "${{ needs.release-sdk.outputs[format('hashes-{0}', matrix.os)] }}"
70-
upload-assets: true
71+
upload-assets: true
7172
upload-tag-name: ${{ inputs.tag }}
7273
provenance-name: ${{ format('{0}-multiple-provenance.intoto.jsonl', matrix.os) }}

0 commit comments

Comments
 (0)