Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lib architectures in language SDKs #498

Merged
merged 5 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: libbitwarden_c_files-x86_64-unknown-linux-gnu
path: languages/csharp/Bitwarden.Sdk/ubuntu-x64
path: languages/csharp/Bitwarden.Sdk/linux-x64

- name: Download x86_64-pc-windows-msvc files
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/build-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
workflow_dispatch:

jobs:
generate_schemas:
Expand Down Expand Up @@ -39,7 +40,7 @@ jobs:
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: libbitwarden_c_files-x86_64-apple-darwin
path: languages/java/src/main/resources/darwin-x64
path: languages/java/src/main/resources/darwin-x86-64

- name: Download aarch64-apple-darwin files
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
Expand All @@ -51,13 +52,13 @@ jobs:
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: libbitwarden_c_files-x86_64-unknown-linux-gnu
path: languages/java/src/main/resources/ubuntu-x64
path: languages/java/src/main/resources/linux-x86-64

- name: Download x86_64-pc-windows-msvc files
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: libbitwarden_c_files-x86_64-pc-windows-msvc
path: languages/java/src/main/resources/windows-x64
path: languages/java/src/main/resources/win32-x86-64

- name: Publish Maven
uses: gradle/gradle-build-action@982da8e78c05368c70dac0351bb82647a9e9a5d2 # v2.11.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: libbitwarden_c_files-x86_64-unknown-linux-gnu
path: languages/csharp/Bitwarden.Sdk/ubuntu-x64
path: languages/csharp/Bitwarden.Sdk/linux-x64

- name: Download x86_64-pc-windows-msvc files
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: libbitwarden_c_files-x86_64-unknown-linux-gnu
path: temp/ubuntu-x64
path: temp/linux-x64

- name: Download x86_64-pc-windows-msvc files
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
Expand All @@ -59,11 +59,11 @@ jobs:
- name: Copy lib files
run: |
mkdir -p languages/php/src/lib/macos-arm64
mkdir -p languages/php/src/lib/ubuntu-x64
mkdir -p languages/php/src/lib/linux-x64
mkdir -p languages/php/src/lib/macos-x64
mkdir -p languages/php/src/lib/windows-x64

platforms=("macos-arm64" "ubuntu-x64" "macos-x64" "windows-x64")
platforms=("macos-arm64" "linux-x64" "macos-x64" "windows-x64")
files=("libbitwarden_c.dylib" "libbitwarden_c.so" "libbitwarden_c.dylib" "bitwarden_c.dll")

for ((i=0; i<${#platforms[@]}; i++)); do
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
name: libbitwarden_c_files-x86_64-unknown-linux-gnu
path: temp/ubuntu-x64
path: temp/linux-x64

- name: Download x86_64-pc-windows-msvc files
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
Expand All @@ -60,11 +60,11 @@ jobs:
- name: Copy lib files
run: |
mkdir -p languages/ruby/bitwarden_sdk/lib/macos-arm64
mkdir -p languages/ruby/bitwarden_sdk/lib/ubuntu-x64
mkdir -p languages/ruby/bitwarden_sdk/lib/linux-x64
mkdir -p languages/ruby/bitwarden_sdk/lib/macos-x64
mkdir -p languages/ruby/bitwarden_sdk/lib/windows-x64

platforms=("macos-arm64" "ubuntu-x64" "macos-x64" "windows-x64")
platforms=("macos-arm64" "linux-x64" "macos-x64" "windows-x64")
files=("libbitwarden_c.dylib" "libbitwarden_c.so" "libbitwarden_c.dylib" "bitwarden_c.dll")

for ((i=0; i<${#platforms[@]}; i++)); do
Expand Down
2 changes: 1 addition & 1 deletion languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<PackageCopyToOutput>true</PackageCopyToOutput>
<PackagePath>runtimes/osx-arm64/native</PackagePath>
</Content>
<Content Include="ubuntu-x64/libbitwarden_c*.so">
<Content Include="linux-x64/libbitwarden_c*.so">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<PackageCopyToOutput>true</PackageCopyToOutput>
<PackagePath>runtimes/linux-x64/native</PackagePath>
Expand Down
2 changes: 1 addition & 1 deletion languages/php/src/BitwardenLib.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct()
$lib_file = __DIR__.'/../../../target/debug/bitwarden_c.dll';
}
} elseif (PHP_OS === 'Linux') {
$lib_file = '/lib/ubuntu-x64/libbitwarden_c.so';
$lib_file = '/lib/linux-x64/libbitwarden_c.so';
if (file_exists($lib_file) == false) {
$lib_file = __DIR__.'/../../../target/debug/libbitwarden_c.so';
}
Expand Down
2 changes: 1 addition & 1 deletion languages/ruby/bitwarden_sdk/bitwarden-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
end
end

spec.files += Dir.glob('lib/ubuntu-x64/**/*')
spec.files += Dir.glob('lib/linux-x64/**/*')
spec.files += Dir.glob('lib/macos-x64/**/*')
spec.files += Dir.glob('lib/windows-x64/**/*')
spec.files += Dir.glob('lib/macos-arm64/**/*')
Expand Down
2 changes: 1 addition & 1 deletion languages/ruby/bitwarden_sdk/lib/bitwarden_lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.mac_with_intel?
end
File.exist?(local_file) ? local_file : File.expand_path('../../../../target/debug/libbitwarden_c.dylib', __dir__)
when /linux/
local_file = File.expand_path('ubuntu-x64/libbitwarden_c.so', __dir__)
local_file = File.expand_path('linux-x64/libbitwarden_c.so', __dir__)
File.exist?(local_file) ? local_file : File.expand_path('../../../../target/debug/libbitwarden_c.so', __dir__)
when /mswin|mingw/
local_file = File.expand_path('windows-x64/bitwarden_c.dll', __dir__)
Expand Down