Skip to content

Commit 84c116d

Browse files
dependabot[bot]kernelsambarrycaceres
authored
Bump senzing-factory/github-action-install-senzing-sdk from 2 to 3 (#26)
* Bump senzing-factory/github-action-install-senzing-sdk from 2 to 3 Bumps [senzing-factory/github-action-install-senzing-sdk](https://github.com/senzing-factory/github-action-install-senzing-sdk) from 2 to 3. - [Release notes](https://github.com/senzing-factory/github-action-install-senzing-sdk/releases) - [Changelog](https://github.com/senzing-factory/github-action-install-senzing-sdk/blob/main/CHANGELOG.md) - [Commits](senzing-factory/github-action-install-senzing-sdk@v2...v3) --- updated-dependencies: - dependency-name: senzing-factory/github-action-install-senzing-sdk dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * update install paths * linting updates and path fixes * test * Updated finding of default paths * debug * Debug SENZING_DIR since it cannot find the sz-sdk.jar * Hard-code SENZING_DIR in pom.xml to check if the problem lies there * Minor update to darwin java DYLD_LIBRARY_PATH * Another try -- tired of commit messsages * Another try -- tired of commit messsages * Another try -- tired of commit messsages * Added export for environmment variables * cleanup environment configuration * test * cleanup * Add debugging to C# InstallLocations.cs to determine why the support path is wrong * Add debugging to C# InstallLocations.cs to determine why the support path is wrong * Add debugging to C# InstallLocations.cs to determine why the support path is wrong * Add debugging to C# InstallLocations.cs to determine why the support path is wrong * Add debugging to C# InstallLocations.cs to determine why the support path is wrong * Add debugging to C# InstallLocations.cs to determine why the support path is wrong * Removed SENZING_DATA_DIR from github workflow for C# darwin * Removed SENZING_DATA_DIR from github workflow for C# darwin * Removed debugging code from InstallLocations.cs and fixed OS detection --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sam <[email protected]> Co-authored-by: Barry M. Caceres <[email protected]>
1 parent 940d102 commit 84c116d

File tree

9 files changed

+96
-105
lines changed

9 files changed

+96
-105
lines changed

Diff for: .github/workflows/csharp-darwin-snippets.yaml

+11-7
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,26 @@ jobs:
2525
dotnet-version: ${{ matrix.dotnet-version }}
2626

2727
- name: install Senzing SDK
28-
uses: senzing-factory/github-action-install-senzing-sdk@v2
28+
uses: senzing-factory/github-action-install-senzing-sdk@v3
2929
with:
3030
senzingsdk-repository-path: ${{ secrets.SENZING_OSX_BETA_REPOSITORY }}
3131

32+
- name: configure environment
33+
run: |
34+
SENZING_DIR="${HOME}/senzing/er"
35+
{
36+
echo "SENZING_DIR=${SENZING_DIR}"
37+
echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib"
38+
} >> "$GITHUB_ENV"
39+
3240
- name: configure local nuget repo
3341
run: |
34-
find /opt/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename
35-
sdk_package=$(find /opt/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename)
42+
sdk_package=$(find "${HOME}"/senzing/er/sdk/dotnet/ -name "Senzing.Sdk*" | xargs -0 -L 1 basename)
3643
mkdir -p ~/dev/nuget/packages
3744
dotnet nuget add source ~/dev/nuget/packages -n dev
38-
dotnet nuget push /opt/senzing/er/sdk/dotnet/"${sdk_package}" --source dev
45+
dotnet nuget push "${HOME}"/senzing/er/sdk/dotnet/"${sdk_package}" --source dev
3946
4047
- name: run csharp snippets
41-
env:
42-
DYLD_LIBRARY_PATH: "/opt/senzing/er/lib"
43-
SENZING_DATA_DIR: "/opt/senzing/er/data"
4448
run: |
4549
cd "${GITHUB_WORKSPACE}"/csharp/runner
4650
dotnet add SnippetRunner package Senzing.Sdk --version 4.0.0-beta

Diff for: .github/workflows/csharp-linux-snippets.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
dotnet-version: ${{ matrix.dotnet-version }}
3030

3131
- name: install Senzing runtime
32-
uses: senzing-factory/github-action-install-senzing-sdk@v2
32+
uses: senzing-factory/github-action-install-senzing-sdk@v3
3333
with:
3434
packages-to-install: "senzingsdk-runtime senzingsdk-setup"
3535
senzingsdk-repository-package: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_PACKAGE }}

Diff for: .github/workflows/csharp-windows-snippets.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@ jobs:
2525
dotnet-version: ${{ matrix.dotnet-version }}
2626

2727
- name: install Senzing SDK
28-
uses: senzing-factory/github-action-install-senzing-sdk@v2
28+
uses: senzing-factory/github-action-install-senzing-sdk@v3
2929
with:
3030
senzingsdk-repository-path: ${{ secrets.SENZING_WIN_BETA_REPOSITORY }}
3131

3232
- name: configure local nuget repo
3333
run: |
34-
$Env:sdk_package = Get-ChildItem -Path "C:\Program Files\Senzing\er\sdk\dotnet\" -Recurse | Where-Object {$_.Name -match "^Senzing.SDK*"} | Select-Object -ExpandProperty Name
34+
$Env:sdk_package = Get-ChildItem -Path "$Env:USERPROFILE\Senzing\er\sdk\dotnet\" -Recurse | Where-Object {$_.Name -match "^Senzing.SDK*"} | Select-Object -ExpandProperty Name
3535
mkdir $Env:USERPROFILE\dev\nuget\packages
3636
cd $Env:USERPROFILE\dev\nuget\packages
3737
dir
3838
dotnet nuget add source $Env:USERPROFILE\dev\nuget\packages -n senzing
39-
dotnet nuget push "C:\Program Files\Senzing\er\sdk\dotnet\${Env:sdk_package}" --source senzing
39+
dotnet nuget push "$Env:USERPROFILE\Senzing\er\sdk\dotnet\${Env:sdk_package}" --source senzing
4040
dotnet nuget list source
4141
4242
- name: Add to "Path" environment variable
4343
run: |
44-
Add-Content $env:GITHUB_PATH "C:\Program Files\Senzing\er\lib"
44+
Add-Content $env:GITHUB_PATH "$Env:USERPROFILE\Senzing\er\lib"
4545
4646
- name: run csharp snippets
4747
run: |
48-
echo $Env:Path
48+
$Env:SENZING_DIR = "$Env:USERPROFILE\Senzing\er"
4949
cd ${Env:GITHUB_WORKSPACE}/csharp/runner
5050
dotnet run --project SnippetRunner all

Diff for: .github/workflows/java-darwin-snippets.yaml

+9-5
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,24 @@ jobs:
2727
java-version: ${{ matrix.java-version }}
2828

2929
- name: install Senzing SDK
30-
uses: senzing-factory/github-action-install-senzing-sdk@v2
30+
uses: senzing-factory/github-action-install-senzing-sdk@v3
3131
with:
3232
senzingsdk-repository-path: ${{ secrets.SENZING_OSX_BETA_REPOSITORY }}
3333

34+
- name: configure environment
35+
run: |
36+
SENZING_DIR="${HOME}/senzing/er"
37+
{
38+
echo "SENZING_DIR=${SENZING_DIR}"
39+
echo "DYLD_LIBRARY_PATH=${SENZING_DIR}/lib:${SENZING_DIR}/lib/macos"
40+
} >> "$GITHUB_ENV"
41+
3442
- name: build with Maven
35-
env:
36-
SENZING_DIR: "/opt/senzing/er"
3743
run: |
3844
cd "${GITHUB_WORKSPACE}"/java
3945
mvn clean install
4046
4147
- name: run java snippets
42-
env:
43-
DYLD_LIBRARY_PATH: "/opt/senzing/er/lib"
4448
run: |
4549
cd "${GITHUB_WORKSPACE}"/java
4650
java -jar target/sz-sdk-snippets.jar all

Diff for: .github/workflows/java-linux-snippets.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
distribution: ${{ matrix.java-distribution }}
3232

3333
- name: install Senzing runtime
34-
uses: senzing-factory/github-action-install-senzing-sdk@v2
34+
uses: senzing-factory/github-action-install-senzing-sdk@v3
3535
with:
3636
packages-to-install: "senzingsdk-runtime senzingsdk-setup"
3737
senzingsdk-repository-package: ${{ secrets.SENZING_APT_BETA_STAGING_REPOSITORY_PACKAGE }}

Diff for: .github/workflows/java-windows-snippets.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,21 @@ jobs:
2727
distribution: ${{ matrix.java-distribution }}
2828

2929
- name: install Senzing SDK
30-
uses: senzing-factory/github-action-install-senzing-sdk@v2
30+
uses: senzing-factory/github-action-install-senzing-sdk@v3
3131
with:
3232
senzingsdk-repository-path: ${{ secrets.SENZING_WIN_BETA_REPOSITORY }}
3333

3434
- name: build with Maven
35-
env:
36-
SENZING_DIR: 'C:\Program Files\Senzing\er'
3735
run: |
36+
$Env:SENZING_DIR = "$Env:USERPROFILE\Senzing\er"
3837
cd "${Env:GITHUB_WORKSPACE}/java"
3938
mvn clean install
4039
4140
- name: Add to "Path" environment variable
4241
run: |
43-
Add-Content $env:GITHUB_PATH "C:\Program Files\Senzing\er\lib"
42+
Add-Content $env:GITHUB_PATH "$Env:USERPROFILE\Senzing\er\lib"
4443
4544
- name: run java snippets
4645
run: |
4746
cd "${Env:GITHUB_WORKSPACE}/java"
48-
java -jar target/sz-sdk-snippets.jar all
47+
java "-Dsenzing.install.dir=$Env:USERPROFILE\Senzing\er" -jar target/sz-sdk-snippets.jar all

Diff for: csharp/runner/SnippetRunner/InstallLocations.cs

+29-34
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ private static bool IsDirectory(string path)
180180
/// </summary>
181181
public static InstallLocations? FindLocations()
182182
{
183+
DirectoryInfo homeDir = new DirectoryInfo(Environment.GetFolderPath(
184+
Environment.SpecialFolder.UserProfile));
185+
DirectoryInfo homeSenzing = new DirectoryInfo(
186+
Path.Combine(homeDir.FullName, "senzing"));
187+
DirectoryInfo homeInstall = new DirectoryInfo(
188+
Path.Combine(homeSenzing.FullName, "er"));
189+
DirectoryInfo homeSupport = new DirectoryInfo(
190+
Path.Combine(homeInstall.FullName, "data"));
191+
183192
DirectoryInfo? installDir = null;
184193
DirectoryInfo? configDir = null;
185194
DirectoryInfo? resourceDir = null;
@@ -190,25 +199,27 @@ private static bool IsDirectory(string path)
190199
string? defaultConfigPath = null;
191200
string defaultSupportPath;
192201

193-
switch (Environment.OSVersion.Platform)
202+
if (OperatingSystem.IsWindows())
203+
{
204+
defaultInstallPath = homeInstall.FullName;
205+
defaultSupportPath = homeSupport.FullName;
206+
}
207+
else if (OperatingSystem.IsMacOS())
194208
{
195-
case PlatformID.Win32NT:
196-
defaultInstallPath = "C:\\Program Files\\Senzing\\er";
197-
defaultSupportPath = "C:\\Program Files\\Senzing\\er\\data";
198-
break;
199-
case PlatformID.MacOSX:
200-
defaultInstallPath = "/opt/senzing/er";
201-
defaultSupportPath = "/opt/senzing/er/data";
202-
break;
203-
case PlatformID.Unix:
204-
defaultInstallPath = "/opt/senzing/er";
205-
defaultConfigPath = "/etc/opt/senzing";
206-
defaultSupportPath = "/opt/senzing/data";
207-
break;
208-
default:
209-
throw new NotSupportedException(
210-
"Unsupported Operating System: "
211-
+ Environment.OSVersion.Platform);
209+
defaultInstallPath = homeInstall.FullName;
210+
defaultSupportPath = homeSupport.FullName;
211+
}
212+
else if (OperatingSystem.IsLinux())
213+
{
214+
defaultInstallPath = "/opt/senzing/er";
215+
defaultConfigPath = "/etc/opt/senzing";
216+
defaultSupportPath = "/opt/senzing/data";
217+
}
218+
else
219+
{
220+
throw new NotSupportedException(
221+
"Unsupported Operating System: "
222+
+ Environment.OSVersion.Platform);
212223
}
213224

214225
// check for senzing system properties
@@ -302,22 +313,6 @@ private static bool IsDirectory(string path)
302313
}
303314
else
304315
{
305-
switch (Environment.OSVersion.Platform)
306-
{
307-
case PlatformID.Win32NT:
308-
defaultSupportPath = Path.Combine(installDir.FullName, "data");
309-
break;
310-
case PlatformID.MacOSX:
311-
defaultSupportPath = Path.Combine(installDir.FullName, "data");
312-
break;
313-
case PlatformID.Unix:
314-
break;
315-
default:
316-
throw new NotSupportedException(
317-
"Unsupported Operating System: "
318-
+ Environment.OSVersion.Platform);
319-
}
320-
321316
// no explicit path, try the default support path
322317
supportDir = new DirectoryInfo(defaultSupportPath);
323318
}

Diff for: java/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<maven.compiler.target>17</maven.compiler.target>
4040
<project.build.includeEncoding>UTF-8</project.build.includeEncoding>
4141
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
42+
<senzing.install.dir>${SENZING_DIR}</senzing.install.dir>
4243
</properties>
4344
<build>
4445
<sourceDirectory>snippets</sourceDirectory>

0 commit comments

Comments
 (0)