From bc72905421a8ceb860096366c4e058c6b07a4ec9 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 29 Mar 2024 16:24:54 +0100 Subject: [PATCH 01/67] Add cpp schemas --- .github/workflows/generate_schemas.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/generate_schemas.yml b/.github/workflows/generate_schemas.yml index bd206b21e..cc15bd4ff 100644 --- a/.github/workflows/generate_schemas.yml +++ b/.github/workflows/generate_schemas.yml @@ -89,3 +89,10 @@ jobs: name: sdk-schemas-java path: ${{ github.workspace }}/languages/java/src/main/java/com/bitwarden/sdk/schema/* if-no-files-found: error + + - name: Upload cpp schemas artifact + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: sdk-schemas-cpp + path: ${{ github.workspace }}/languages/cpp/include/schemas.hpp + if-no-files-found: error From d6db031971c85ddf5eb7fd323f0eb2103a05fe48 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 29 Mar 2024 16:25:26 +0100 Subject: [PATCH 02/67] Add build cpp --- .github/workflows/build-cpp.yml | 42 +++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build-cpp.yml diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml new file mode 100644 index 000000000..58b3c5e4c --- /dev/null +++ b/.github/workflows/build-cpp.yml @@ -0,0 +1,42 @@ +name: Build C++ SDK + +on: + push: + branches: + - main + - rc + - hotfix-rc + + pull_request: + + +jobs: + generate-schemas: + uses: ./.github/workflows/generate_schemas.yml + + build: + name: Build + needs: generate-schemas + runs-on: ubuntu-22.04 + steps: + - name: Checkout Repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: install dependencies + run: | + sudo apt-get install nlohmann-json-dev + sudo apt-get install libboost-all-dev + + - name: Download schemas + uses: actions/download-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: sdk-schemas-cpp + path: languages/cpp/include + + - name: Build + working-directory: languages/cpp + run: | + mkdir build + cd build + cmake .. -DNLOHMANN=/path/to/include/nlohmann -DBOOST=/path/to/include/boost -DTARGET=../../target/release/libbitwarden_c.dylib + cmake --build . From 77bb2e6e42dfdb0166ef0c6eb336c657f816bb98 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 29 Mar 2024 16:38:28 +0100 Subject: [PATCH 03/67] Upload artifact --- .github/workflows/build-cpp.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 58b3c5e4c..862f036e1 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -40,3 +40,9 @@ jobs: cd build cmake .. -DNLOHMANN=/path/to/include/nlohmann -DBOOST=/path/to/include/boost -DTARGET=../../target/release/libbitwarden_c.dylib cmake --build . + + - name: Upload C++ package + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: libbitwarden_c.dylib + path: languages/cpp/target/release/libbitwarden_c.dylib From 9d4bb79b234b1d0c40957659734d30276eded0ee Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 29 Mar 2024 16:39:05 +0100 Subject: [PATCH 04/67] Add workflow dispatch trigger to build cpp --- .github/workflows/build-cpp.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 862f036e1..0e94ff4ea 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -8,6 +8,7 @@ on: - hotfix-rc pull_request: + workflow_dispatch: jobs: From 4531f5e78eda086bdc7113e38d485c7b8713520b Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 2 Apr 2024 13:51:56 +0200 Subject: [PATCH 05/67] Fix --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 0e94ff4ea..9a265810a 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -29,7 +29,7 @@ jobs: sudo apt-get install libboost-all-dev - name: Download schemas - uses: actions/download-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: name: sdk-schemas-cpp path: languages/cpp/include From b88519e7df7dfa0a8e7a39c828b5e36bec1a2d1c Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 2 Apr 2024 13:57:53 +0200 Subject: [PATCH 06/67] Maybe fix --- .github/workflows/build-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 9a265810a..509fc72fc 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -25,8 +25,8 @@ jobs: - name: install dependencies run: | - sudo apt-get install nlohmann-json-dev - sudo apt-get install libboost-all-dev + sudo apt-get install -y nlohmann-json3-dev + sudo apt-get install -y libboost-all-dev - name: Download schemas uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 From f8eba0b5120e48932dbeafc7545ccc4c6bdba0dd Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 2 Apr 2024 14:02:32 +0200 Subject: [PATCH 07/67] Check install location --- .github/workflows/build-cpp.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 509fc72fc..38e96a989 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -28,6 +28,9 @@ jobs: sudo apt-get install -y nlohmann-json3-dev sudo apt-get install -y libboost-all-dev + dpkg -L nlohmann-json3-dev + dpkg -L libboost-all-dev + - name: Download schemas uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: From 43f74533631aa137a695bc3edf95515562d21dea Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 2 Apr 2024 14:12:17 +0200 Subject: [PATCH 08/67] Change path for includes --- .github/workflows/build-cpp.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 38e96a989..e03769c16 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -28,9 +28,6 @@ jobs: sudo apt-get install -y nlohmann-json3-dev sudo apt-get install -y libboost-all-dev - dpkg -L nlohmann-json3-dev - dpkg -L libboost-all-dev - - name: Download schemas uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: @@ -42,7 +39,7 @@ jobs: run: | mkdir build cd build - cmake .. -DNLOHMANN=/path/to/include/nlohmann -DBOOST=/path/to/include/boost -DTARGET=../../target/release/libbitwarden_c.dylib + cmake .. -DNLOHMANN=/usr/share/doc/nlohmann-json3-dev -DBOOST=/usr/share/doc/libboost-all-dev -DTARGET=../../target/release/libbitwarden_c.dylib cmake --build . - name: Upload C++ package From 754ab88e4c78bfdcefca1323345c1f0c8d31df77 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 2 Apr 2024 18:06:16 +0200 Subject: [PATCH 09/67] Add matrix --- .github/workflows/build-cpp.yml | 37 ++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index e03769c16..e91cf9992 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -15,10 +15,27 @@ jobs: generate-schemas: uses: ./.github/workflows/generate_schemas.yml + build_rust: + uses: ./.github/workflows/build-rust-cross-platform.yml + build: - name: Build - needs: generate-schemas - runs-on: ubuntu-22.04 + name: Build for ${{ matrix.settings.os }} ${{ matrix.settings.target }} + needs: + - generate-schemas + - build_rust + runs-on: ${{ matrix.settings.os }} + strategy: + fail-fast: false + matrix: + settings: + - os: macos-12 + target: x86_64-apple-darwin + - os: macos-12 + target: aarch64-apple-darwin + - os: windows-2022 + target: x86_64-pc-windows-msvc + - os: ubuntu-22.04 + target: x86_64-unknown-linux-gnu steps: - name: Checkout Repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -34,16 +51,22 @@ jobs: name: sdk-schemas-cpp path: languages/cpp/include + - name: Download ${{ matrix.settings.target }} files + uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 + with: + name: libbitwarden_c_files-${{ matrix.settings.target }} + path: languages/cpp/include + - name: Build working-directory: languages/cpp run: | mkdir build cd build - cmake .. -DNLOHMANN=/usr/share/doc/nlohmann-json3-dev -DBOOST=/usr/share/doc/libboost-all-dev -DTARGET=../../target/release/libbitwarden_c.dylib + cmake .. -DNLOHMANN=/usr/share/doc/nlohmann-json3-dev -DBOOST=/usr/share/doc/libboost-all-dev -DTARGET=../include/libbitwarden_c.dylib cmake --build . - - name: Upload C++ package + - name: Upload C++ package for ${{ matrix.settings.target }} uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: libbitwarden_c.dylib - path: languages/cpp/target/release/libbitwarden_c.dylib + name: libbitwarden_c-${{ matrix.settings.target }} + path: languages/cpp/target/release From 04b83052a4d727119b105ac95b3eed342f1548cb Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 2 Apr 2024 18:18:47 +0200 Subject: [PATCH 10/67] try to fix --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index e91cf9992..84cce6e7e 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -62,7 +62,7 @@ jobs: run: | mkdir build cd build - cmake .. -DNLOHMANN=/usr/share/doc/nlohmann-json3-dev -DBOOST=/usr/share/doc/libboost-all-dev -DTARGET=../include/libbitwarden_c.dylib + cmake .. -DNLOHMANN=/usr/share/doc/nlohmann-json3-dev -DBOOST=/usr/share/doc/libboost-all-dev -DTARGET=include/libbitwarden_c.dylib cmake --build . - name: Upload C++ package for ${{ matrix.settings.target }} From a5b319cfd41a63a8c865db379a35da8508b1a084 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 3 Apr 2024 14:48:02 +0200 Subject: [PATCH 11/67] Add difgferent deps installation for different oses --- .github/workflows/build-cpp.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 84cce6e7e..dbf0c3200 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -40,11 +40,24 @@ jobs: - name: Checkout Repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: install dependencies + - name: install dependencies linux + if: matrix.settings.os == 'ubuntu-22.04' run: | sudo apt-get install -y nlohmann-json3-dev sudo apt-get install -y libboost-all-dev + - name: install dependencies macos + if: matrix.settings.os == 'macos-12' + run: | + brew install nlohmann-json + brew install boost + + - name: install dependencies windows + if: matrix.settings.os == 'windows-2022' + run: | + choco install nlohmann-json + choco install boost + - name: Download schemas uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: From 8fbf42fbb7f0a1d6ab147d48314e1712e5f736a7 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 3 Apr 2024 15:01:02 +0200 Subject: [PATCH 12/67] Fix --- .github/workflows/build-cpp.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index dbf0c3200..a7bff34f9 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -30,12 +30,16 @@ jobs: settings: - os: macos-12 target: x86_64-apple-darwin + - os: macos-12 target: aarch64-apple-darwin + - os: windows-2022 target: x86_64-pc-windows-msvc + - os: ubuntu-22.04 target: x86_64-unknown-linux-gnu + steps: - name: Checkout Repository uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 @@ -73,9 +77,25 @@ jobs: - name: Build working-directory: languages/cpp run: | + if [[ ${{ matrix.settings.os }} == 'macos-12' ]]; then + export DNLOHMANN_PATH=/usr/local/opt/nlohmann-json + export DBOOST_PATH=/usr/local/opt/boost + fi + + if [[ ${{ matrix.settings.os }} == 'ubuntu-22.04' ]]; then + export DNLOHMANN_PATH=/usr/share/doc/nlohmann-json3-dev + export DBOOST_PATH=/usr/share/doc/libboost-all-dev + fi + + if [[ ${{ matrix.settings.os }} == 'windows-2022' ]]; then + export DNLOHMANN_PATH=/c/Program\ Files/nlohmann-json + export DBOOST_PATH=/c/Program\ Files/boost + fi + + mkdir build cd build - cmake .. -DNLOHMANN=/usr/share/doc/nlohmann-json3-dev -DBOOST=/usr/share/doc/libboost-all-dev -DTARGET=include/libbitwarden_c.dylib + cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dylib cmake --build . - name: Upload C++ package for ${{ matrix.settings.target }} From fc9cfd01aef1e2031ead221ac9de2140e65c20c4 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 3 Apr 2024 17:37:04 +0200 Subject: [PATCH 13/67] Arror if no files found to upload --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index a7bff34f9..2e6daf2e5 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -92,7 +92,6 @@ jobs: export DBOOST_PATH=/c/Program\ Files/boost fi - mkdir build cd build cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dylib @@ -103,3 +102,4 @@ jobs: with: name: libbitwarden_c-${{ matrix.settings.target }} path: languages/cpp/target/release + if-no-files-found: error From 34539bd3bab698b47e5044e07dcc899b2a463c7d Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 10:16:59 +0200 Subject: [PATCH 14/67] Use conda for libs for windows --- .github/workflows/build-cpp.yml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 2e6daf2e5..80efe2698 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -45,22 +45,41 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: install dependencies linux - if: matrix.settings.os == 'ubuntu-22.04' + if: runner.os == 'Linux' run: | sudo apt-get install -y nlohmann-json3-dev sudo apt-get install -y libboost-all-dev - name: install dependencies macos - if: matrix.settings.os == 'macos-12' + if: runner.os == 'macOS' run: | brew install nlohmann-json brew install boost - - name: install dependencies windows - if: matrix.settings.os == 'windows-2022' + - name: Set up conda environment + uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3 + with: + miniconda-version: "latest" + auto-update-conda: true + activate-environment: conda-env + if: runner.os == 'Windows' #|| runner.os == 'Linux' + + - name: Install libraries for Windows run: | - choco install nlohmann-json - choco install boost + conda install -c conda-forge boost + conda install -c conda-forge nlohmann_json + conda list + shell: pwsh + if: runner.os == 'Windows' + + # - name: Install libraries for Linux + # run: | + # conda install -c conda-forge boost + # conda install -c conda-forge nlohmann_json + # # sudo apt-get update + # # sudo apt-get install libboost-all-dev + # shell: bash + # if: runner.os == 'Linux' - name: Download schemas uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 From 6f4dc5147087519b46e302f38dc472fdf69c1e5d Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 10:41:38 +0200 Subject: [PATCH 15/67] Fix --- .github/workflows/build-cpp.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 80efe2698..76f0ec5ba 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -96,17 +96,17 @@ jobs: - name: Build working-directory: languages/cpp run: | - if [[ ${{ matrix.settings.os }} == 'macos-12' ]]; then + if [[ ${{ runner.os }} == 'macOS' ]]; then export DNLOHMANN_PATH=/usr/local/opt/nlohmann-json export DBOOST_PATH=/usr/local/opt/boost fi - if [[ ${{ matrix.settings.os }} == 'ubuntu-22.04' ]]; then + if [[ ${{ runner.os }} == 'Linux' ]]; then export DNLOHMANN_PATH=/usr/share/doc/nlohmann-json3-dev export DBOOST_PATH=/usr/share/doc/libboost-all-dev fi - if [[ ${{ matrix.settings.os }} == 'windows-2022' ]]; then + if [[ ${{ runner.os }} == 'Windows' ]]; then export DNLOHMANN_PATH=/c/Program\ Files/nlohmann-json export DBOOST_PATH=/c/Program\ Files/boost fi From 6bf1b062bdeed177b0f0392aa8b7fbb95ce9b7dc Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 10:43:23 +0200 Subject: [PATCH 16/67] Fix windows paths --- .github/workflows/build-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 76f0ec5ba..45d102dba 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -107,8 +107,8 @@ jobs: fi if [[ ${{ runner.os }} == 'Windows' ]]; then - export DNLOHMANN_PATH=/c/Program\ Files/nlohmann-json - export DBOOST_PATH=/c/Program\ Files/boost + export DNLOHMANN_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json + export DBOOST_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\boost fi mkdir build From 03271d5109a81c2b904c3ed815bb55386bf6fd84 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 11:13:56 +0200 Subject: [PATCH 17/67] Comment out arch64 macos build --- .github/workflows/build-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 45d102dba..183ea3bf1 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -31,8 +31,8 @@ jobs: - os: macos-12 target: x86_64-apple-darwin - - os: macos-12 - target: aarch64-apple-darwin + # - os: macos-12 # aarch64 is not supported by gh action runners yet + # target: aarch64-apple-darwin - os: windows-2022 target: x86_64-pc-windows-msvc From fad1c720ccc56a6905b4fff441411b5d55440170 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 12:09:23 +0200 Subject: [PATCH 18/67] Update artifact path in build-cpp.yml --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 183ea3bf1..73eed941d 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -120,5 +120,5 @@ jobs: uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: libbitwarden_c-${{ matrix.settings.target }} - path: languages/cpp/target/release + path: languages/cpp/build if-no-files-found: error From 5a66dc0811ef53fd5b2dea5ad06fb4d7640228f7 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 12:27:01 +0200 Subject: [PATCH 19/67] Fix maybe? --- .github/workflows/build-cpp.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 73eed941d..1da941b68 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -96,17 +96,17 @@ jobs: - name: Build working-directory: languages/cpp run: | - if [[ ${{ runner.os }} == 'macOS' ]]; then + if [[ '${{ runner.os }}' == 'macOS' ]]; then export DNLOHMANN_PATH=/usr/local/opt/nlohmann-json export DBOOST_PATH=/usr/local/opt/boost fi - if [[ ${{ runner.os }} == 'Linux' ]]; then + if [[ '${{ runner.os }}' == 'Linux' ]]; then export DNLOHMANN_PATH=/usr/share/doc/nlohmann-json3-dev export DBOOST_PATH=/usr/share/doc/libboost-all-dev fi - if [[ ${{ runner.os }} == 'Windows' ]]; then + if [[ '${{ runner.os }}' == 'Windows' ]]; then export DNLOHMANN_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json export DBOOST_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\boost fi From 33d77a33628523c77c964790daa8c11dc3a6fd39 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 13:35:09 +0200 Subject: [PATCH 20/67] Add defaults bash --- .github/workflows/build-cpp.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 1da941b68..33b1f58a2 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -10,6 +10,9 @@ on: pull_request: workflow_dispatch: +defaults: + run: + shell: bash jobs: generate-schemas: From 6a0fa30aa71b31a4c7ab3ff146f508fc413c058f Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 14:43:44 +0200 Subject: [PATCH 21/67] Update C++ package name in build workflow --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 33b1f58a2..1ddb187bc 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -122,6 +122,6 @@ jobs: - name: Upload C++ package for ${{ matrix.settings.target }} uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: libbitwarden_c-${{ matrix.settings.target }} + name: libbitwarden_cpp-${{ matrix.settings.target }} path: languages/cpp/build if-no-files-found: error From 8cd57c0f8e30462b86f38bedc73692fd8201835e Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 14:44:31 +0200 Subject: [PATCH 22/67] ls include --- .github/workflows/build-cpp.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 1ddb187bc..35c1c56d4 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -114,6 +114,8 @@ jobs: export DBOOST_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\boost fi + ls include + mkdir build cd build cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dylib From 10911071331fb44ebe2f1e467cba1d38fe898c82 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 14:49:23 +0200 Subject: [PATCH 23/67] Mabe fix --- .github/workflows/build-cpp.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 35c1c56d4..8f85c1407 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -10,10 +10,6 @@ on: pull_request: workflow_dispatch: -defaults: - run: - shell: bash - jobs: generate-schemas: uses: ./.github/workflows/generate_schemas.yml @@ -96,8 +92,9 @@ jobs: name: libbitwarden_c_files-${{ matrix.settings.target }} path: languages/cpp/include - - name: Build + - name: Build unix working-directory: languages/cpp + if: runner.os == 'macOS' || runner.os == 'Linux' run: | if [[ '${{ runner.os }}' == 'macOS' ]]; then export DNLOHMANN_PATH=/usr/local/opt/nlohmann-json @@ -109,11 +106,6 @@ jobs: export DBOOST_PATH=/usr/share/doc/libboost-all-dev fi - if [[ '${{ runner.os }}' == 'Windows' ]]; then - export DNLOHMANN_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json - export DBOOST_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\boost - fi - ls include mkdir build @@ -121,6 +113,18 @@ jobs: cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dylib cmake --build . + - name: Build windows + if: runner.os == 'Windows' + working-directory: languages/cpp + run: | + set DNLOHMANN_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json + set DBOOST_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\boost + + mkdir build + cd build + cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dll + cmake --build . + - name: Upload C++ package for ${{ matrix.settings.target }} uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: From a923e2b183def3f2b76ca8caad4ef40be755353f Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 4 Apr 2024 15:20:15 +0200 Subject: [PATCH 24/67] Fix --- .github/workflows/build-cpp.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 8f85c1407..9192e1611 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -117,12 +117,9 @@ jobs: if: runner.os == 'Windows' working-directory: languages/cpp run: | - set DNLOHMANN_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json - set DBOOST_PATH=C:\Users\runneradmin\miniconda3\envs\conda-env\boost - mkdir build cd build - cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dll + cmake .. -DNLOHMANN=C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json -DBOOST=C:\Users\runneradmin\miniconda3\envs\conda-env\boost -DTARGET=include/libbitwarden_c.dll cmake --build . - name: Upload C++ package for ${{ matrix.settings.target }} From 9f847e6c942dc1be1d35a2b83c778c167ebdd234 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 5 Apr 2024 13:18:51 +0200 Subject: [PATCH 25/67] Update build-cpp.yml: Set target based on runner OS --- .github/workflows/build-cpp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 9192e1611..a75133ab2 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -99,18 +99,20 @@ jobs: if [[ '${{ runner.os }}' == 'macOS' ]]; then export DNLOHMANN_PATH=/usr/local/opt/nlohmann-json export DBOOST_PATH=/usr/local/opt/boost + export DTARGET=include/libbitwarden_c.dylib fi if [[ '${{ runner.os }}' == 'Linux' ]]; then export DNLOHMANN_PATH=/usr/share/doc/nlohmann-json3-dev export DBOOST_PATH=/usr/share/doc/libboost-all-dev + export DTARGET=include/libbitwarden_c.so fi ls include mkdir build cd build - cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dylib + cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET cmake --build . - name: Build windows From 9df66e10cd8e52ed11178ff48ba8e0f2127a8059 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 5 Apr 2024 13:21:31 +0200 Subject: [PATCH 26/67] Add artifact copying step to C++ build workflow --- .github/workflows/build-cpp.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index a75133ab2..a1c2d6be1 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -124,9 +124,16 @@ jobs: cmake .. -DNLOHMANN=C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json -DBOOST=C:\Users\runneradmin\miniconda3\envs\conda-env\boost -DTARGET=include/libbitwarden_c.dll cmake --build . + - name: Copy artifacts + working-directory: languages/cpp/build + run: | + mkdir artifacts + cp libbitwarden_c.* artifacts + cp libBitwardenClient.* artifacts + - name: Upload C++ package for ${{ matrix.settings.target }} uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: libbitwarden_cpp-${{ matrix.settings.target }} - path: languages/cpp/build + path: languages/cpp/build/artifacts if-no-files-found: error From 86bb6b05d091f03e2f4e5f8f4813129e739ff9dc Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 5 Apr 2024 13:25:47 +0200 Subject: [PATCH 27/67] Remove unnecessary 'ls include' command and add environment variables for Boost and nlohmann_json include directories --- .github/workflows/build-cpp.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index a1c2d6be1..4fa52e739 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -108,8 +108,6 @@ jobs: export DTARGET=include/libbitwarden_c.so fi - ls include - mkdir build cd build cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET @@ -118,6 +116,10 @@ jobs: - name: Build windows if: runner.os == 'Windows' working-directory: languages/cpp + env: + # BOOST_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\Library\include + BOOST_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\boost + NLOHMANN_JSON_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json run: | mkdir build cd build From 4ef34856571cdedf3baa466c9bdbeabb490e4e18 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 5 Apr 2024 15:30:34 +0200 Subject: [PATCH 28/67] Update BOOST_INCLUDE_DIR and NLOHMANN_JSON_INCLUDE_DIR paths --- .github/workflows/build-cpp.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 4fa52e739..9f0125a99 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -117,9 +117,10 @@ jobs: if: runner.os == 'Windows' working-directory: languages/cpp env: - # BOOST_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\Library\include - BOOST_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\boost - NLOHMANN_JSON_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json + BOOST_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\Library\include + # BOOST_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\boost + # NLOHMANN_JSON_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json + NLOHMANN_JSON_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\Library\include run: | mkdir build cd build From 8c8ca8314c37798cecb768552011cce7f9248a3d Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 9 Apr 2024 12:37:16 +0200 Subject: [PATCH 29/67] Change way of installing packages for windows --- .github/workflows/build-cpp.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 9f0125a99..fd0cfb980 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -55,21 +55,12 @@ jobs: brew install nlohmann-json brew install boost - - name: Set up conda environment - uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3 - with: - miniconda-version: "latest" - auto-update-conda: true - activate-environment: conda-env - if: runner.os == 'Windows' #|| runner.os == 'Linux' - - name: Install libraries for Windows + if: runner.os == 'Windows' run: | - conda install -c conda-forge boost - conda install -c conda-forge nlohmann_json - conda list + vcpkg install boost + vcpkg install nlohmann-json shell: pwsh - if: runner.os == 'Windows' # - name: Install libraries for Linux # run: | From eb28ef5b9e1a221aaa05b166de9e3b259f3efd91 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 11 Apr 2024 12:45:04 +0200 Subject: [PATCH 30/67] Add list trees --- .github/workflows/build-cpp.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index fd0cfb980..ab1dea098 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -62,6 +62,12 @@ jobs: vcpkg install nlohmann-json shell: pwsh + - name: list + run: | + ls -lR C:/vcpkg/buildtrees/nlohmann-json/ + ls -lR C:/vcpkg/buildtrees/boost/ + if: runner.os == 'Windows' + # - name: Install libraries for Linux # run: | # conda install -c conda-forge boost @@ -108,10 +114,10 @@ jobs: if: runner.os == 'Windows' working-directory: languages/cpp env: - BOOST_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\Library\include + BOOST_INCLUDE_DIR: C:/vcpkg/packages/boost_x64-windows # BOOST_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\boost # NLOHMANN_JSON_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json - NLOHMANN_JSON_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\Library\include + NLOHMANN_JSON_INCLUDE_DIR: C:/vcpkg/packages/nlohmann-json_x64-windows run: | mkdir build cd build From cbe5d6235c4752614353da7e73c8d54f55a2e80c Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 11 Apr 2024 12:54:34 +0200 Subject: [PATCH 31/67] Add vcpkg.json for Bitwarden Secrets Manager SDK for C++ --- languages/cpp/vcpkg.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 languages/cpp/vcpkg.json diff --git a/languages/cpp/vcpkg.json b/languages/cpp/vcpkg.json new file mode 100644 index 000000000..56ad5084d --- /dev/null +++ b/languages/cpp/vcpkg.json @@ -0,0 +1,10 @@ +{ + "name": "bitwarden-sdk-secrets", + "version": "0.1.0", + "homepage": "https://github.com/bitwarden/sdk/tree/languages/cpp", + "description": "Bitwarden Secrets Manager SDK for C++", + "dependencies": [ + "boost", + "nlohmann-json" + ] + } \ No newline at end of file From 53ff5ec4dab4aa528681e27516bfcfd6fc17c144 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 11 Apr 2024 13:33:41 +0200 Subject: [PATCH 32/67] Change command --- .github/workflows/build-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index ab1dea098..8817dc73c 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -64,8 +64,8 @@ jobs: - name: list run: | - ls -lR C:/vcpkg/buildtrees/nlohmann-json/ - ls -lR C:/vcpkg/buildtrees/boost/ + Get-ChildItem -Recurse C:/vcpkg/buildtrees/nlohmann-json/ + Get-ChildItem -Recurse C:/vcpkg/buildtrees/boost/ if: runner.os == 'Windows' # - name: Install libraries for Linux From 042bd410d696136b29dea0f88e2c8993b52132cd Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 11 Apr 2024 17:31:02 +0200 Subject: [PATCH 33/67] Use paths --- .github/workflows/build-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 8817dc73c..170a9fe7f 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -114,14 +114,14 @@ jobs: if: runner.os == 'Windows' working-directory: languages/cpp env: - BOOST_INCLUDE_DIR: C:/vcpkg/packages/boost_x64-windows + BOOST_INCLUDE_DIR: C:/vcpkg/packages/boost # BOOST_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\boost # NLOHMANN_JSON_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json NLOHMANN_JSON_INCLUDE_DIR: C:/vcpkg/packages/nlohmann-json_x64-windows run: | mkdir build cd build - cmake .. -DNLOHMANN=C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json -DBOOST=C:\Users\runneradmin\miniconda3\envs\conda-env\boost -DTARGET=include/libbitwarden_c.dll + cmake .. -DNLOHMANN=$NLOHMANN_JSON_INCLUDE_DIR -DBOOST=$BOOST_INCLUDE_DIR -DTARGET=include/libbitwarden_c.dll cmake --build . - name: Copy artifacts From f014cdbdf47796925c5808cb12d6d49c69054956 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 11 Apr 2024 17:33:05 +0200 Subject: [PATCH 34/67] Fix env variables --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 170a9fe7f..d520034cc 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -121,7 +121,7 @@ jobs: run: | mkdir build cd build - cmake .. -DNLOHMANN=$NLOHMANN_JSON_INCLUDE_DIR -DBOOST=$BOOST_INCLUDE_DIR -DTARGET=include/libbitwarden_c.dll + cmake .. -DNLOHMANN=$env:NLOHMANN_JSON_INCLUDE_DIR -DBOOST=$env:BOOST_INCLUDE_DIR -DTARGET=include/libbitwarden_c.dll cmake --build . - name: Copy artifacts From 506e16f0291695d5142c11752c59436ed8a5bb02 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 11 Apr 2024 17:33:40 +0200 Subject: [PATCH 35/67] remove commented stuff --- .github/workflows/build-cpp.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index d520034cc..5aae0dc29 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -68,15 +68,6 @@ jobs: Get-ChildItem -Recurse C:/vcpkg/buildtrees/boost/ if: runner.os == 'Windows' - # - name: Install libraries for Linux - # run: | - # conda install -c conda-forge boost - # conda install -c conda-forge nlohmann_json - # # sudo apt-get update - # # sudo apt-get install libboost-all-dev - # shell: bash - # if: runner.os == 'Linux' - - name: Download schemas uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: @@ -115,8 +106,6 @@ jobs: working-directory: languages/cpp env: BOOST_INCLUDE_DIR: C:/vcpkg/packages/boost - # BOOST_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\boost - # NLOHMANN_JSON_INCLUDE_DIR: C:\Users\runneradmin\miniconda3\envs\conda-env\nlohmann_json NLOHMANN_JSON_INCLUDE_DIR: C:/vcpkg/packages/nlohmann-json_x64-windows run: | mkdir build From 7f5f2f7fe57723a877ae777aa7a8c8bcb40e1cbd Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 11 Apr 2024 18:14:09 +0200 Subject: [PATCH 36/67] Add another list --- .github/workflows/build-cpp.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 5aae0dc29..6e0cefc97 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -62,12 +62,16 @@ jobs: vcpkg install nlohmann-json shell: pwsh - - name: list + - name: list C:/vcpkg/buildtrees run: | Get-ChildItem -Recurse C:/vcpkg/buildtrees/nlohmann-json/ Get-ChildItem -Recurse C:/vcpkg/buildtrees/boost/ if: runner.os == 'Windows' + - name: List C:/vcpkg/packages + run: Get-ChildItem -Recurse C:/vcpkg/packages + if: runner.os == 'Windows' + - name: Download schemas uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: From ed67e68c97220c1fcd658bf5471aeb7e95cdb205 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 11 Apr 2024 18:15:27 +0200 Subject: [PATCH 37/67] Change paths --- .github/workflows/build-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 6e0cefc97..add216fde 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -109,8 +109,8 @@ jobs: if: runner.os == 'Windows' working-directory: languages/cpp env: - BOOST_INCLUDE_DIR: C:/vcpkg/packages/boost - NLOHMANN_JSON_INCLUDE_DIR: C:/vcpkg/packages/nlohmann-json_x64-windows + BOOST_INCLUDE_DIR: C:/vcpkg/buildtrees/boost/ + NLOHMANN_JSON_INCLUDE_DIR: C:/vcpkg/buildtrees/nlohmann-json/ run: | mkdir build cd build From 445bf67a1da5162ba8bbe769bc149d8d19bc51ac Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 11 Apr 2024 18:15:59 +0200 Subject: [PATCH 38/67] Fix target path in CMake configuration --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index add216fde..7de605657 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -114,7 +114,7 @@ jobs: run: | mkdir build cd build - cmake .. -DNLOHMANN=$env:NLOHMANN_JSON_INCLUDE_DIR -DBOOST=$env:BOOST_INCLUDE_DIR -DTARGET=include/libbitwarden_c.dll + cmake .. -DNLOHMANN=$env:NLOHMANN_JSON_INCLUDE_DIR -DBOOST=$env:BOOST_INCLUDE_DIR -DTARGET="include/libbitwarden_c.dll" cmake --build . - name: Copy artifacts From d01966e22fd4ad1ef1b87f68d8479ea14e495c61 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 11 Apr 2024 18:17:09 +0200 Subject: [PATCH 39/67] FIx --- .github/workflows/build-cpp.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 7de605657..013c16bb7 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -108,13 +108,13 @@ jobs: - name: Build windows if: runner.os == 'Windows' working-directory: languages/cpp - env: - BOOST_INCLUDE_DIR: C:/vcpkg/buildtrees/boost/ - NLOHMANN_JSON_INCLUDE_DIR: C:/vcpkg/buildtrees/nlohmann-json/ + # env: + # BOOST_INCLUDE_DIR: C:\vcpkg\buildtrees\boost\ + # NLOHMANN_JSON_INCLUDE_DIR: C:\vcpkg\buildtrees\nlohmann-json\ run: | mkdir build cd build - cmake .. -DNLOHMANN=$env:NLOHMANN_JSON_INCLUDE_DIR -DBOOST=$env:BOOST_INCLUDE_DIR -DTARGET="include/libbitwarden_c.dll" + cmake .. -DNLOHMANN="C:\vcpkg\buildtrees\boost\" -DBOOST="C:\vcpkg\buildtrees\nlohmann-json\" -DTARGET="include/libbitwarden_c.dll" cmake --build . - name: Copy artifacts From 7d1c6d3108e1e547c0a32704102ce688f3543abf Mon Sep 17 00:00:00 2001 From: Thomas Avery Date: Thu, 11 Apr 2024 13:01:51 -0500 Subject: [PATCH 40/67] test attempted fix --- .github/workflows/build-cpp.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 013c16bb7..ce5d6ab45 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -114,8 +114,12 @@ jobs: run: | mkdir build cd build - cmake .. -DNLOHMANN="C:\vcpkg\buildtrees\boost\" -DBOOST="C:\vcpkg\buildtrees\nlohmann-json\" -DTARGET="include/libbitwarden_c.dll" + $DNLOHMANN_PATH="C:\vcpkg\buildtrees\nlohmann-json\" + $DBOOST_PATH="C:\vcpkg\buildtrees\boost\" + $DTARGET="include\libbitwarden_c.dll" + cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET cmake --build . + shell: pwsh - name: Copy artifacts working-directory: languages/cpp/build From ca302f6a8c1fcdc164176578fc834a2ece327ed0 Mon Sep 17 00:00:00 2001 From: Thomas Avery Date: Thu, 11 Apr 2024 16:10:01 -0500 Subject: [PATCH 41/67] run another test --- .github/workflows/build-cpp.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index ce5d6ab45..e33132b80 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -64,8 +64,8 @@ jobs: - name: list C:/vcpkg/buildtrees run: | - Get-ChildItem -Recurse C:/vcpkg/buildtrees/nlohmann-json/ - Get-ChildItem -Recurse C:/vcpkg/buildtrees/boost/ + Get-ChildItem -Recurse C:\vcpkg\installed\x64-windows\include\ + Get-ChildItem -Recurse C:\vcpkg\installed\x64-windows\lib\ if: runner.os == 'Windows' - name: List C:/vcpkg/packages @@ -114,10 +114,10 @@ jobs: run: | mkdir build cd build - $DNLOHMANN_PATH="C:\vcpkg\buildtrees\nlohmann-json\" - $DBOOST_PATH="C:\vcpkg\buildtrees\boost\" + $DNLOHMANN_PATH="C:\vcpkg\installed\x64-windows\include\nlohmann-json" + $DBOOST_PATH="C:\vcpkg\installed\x64-windows\include\boost" $DTARGET="include\libbitwarden_c.dll" - cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET + cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake cmake --build . shell: pwsh From 48b80ea70859febfe415963eab8979067d137504 Mon Sep 17 00:00:00 2001 From: Thomas Avery Date: Thu, 11 Apr 2024 17:30:37 -0500 Subject: [PATCH 42/67] testing again --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index e33132b80..1763227a8 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -116,7 +116,7 @@ jobs: cd build $DNLOHMANN_PATH="C:\vcpkg\installed\x64-windows\include\nlohmann-json" $DBOOST_PATH="C:\vcpkg\installed\x64-windows\include\boost" - $DTARGET="include\libbitwarden_c.dll" + $DTARGET="include/libbitwarden_c.dll" cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake cmake --build . shell: pwsh From cc6990c36b8bae88c946e7759ddc8bacd9eff571 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 12 Apr 2024 11:58:11 +0200 Subject: [PATCH 43/67] Try using cache --- .github/workflows/build-cpp.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 1763227a8..1f6a5d957 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -55,23 +55,23 @@ jobs: brew install nlohmann-json brew install boost + - name: Export GitHub Actions cache environment variables + if: runner.os == 'Windows' + uses: actions/github-script@v6 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Install libraries for Windows if: runner.os == 'Windows' + env: + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: | vcpkg install boost vcpkg install nlohmann-json shell: pwsh - - name: list C:/vcpkg/buildtrees - run: | - Get-ChildItem -Recurse C:\vcpkg\installed\x64-windows\include\ - Get-ChildItem -Recurse C:\vcpkg\installed\x64-windows\lib\ - if: runner.os == 'Windows' - - - name: List C:/vcpkg/packages - run: Get-ChildItem -Recurse C:/vcpkg/packages - if: runner.os == 'Windows' - - name: Download schemas uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: From 690670ac1f3d73829edd29f8d5e1eefef294c440 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 12 Apr 2024 12:12:07 +0200 Subject: [PATCH 44/67] Try to fix --- .github/workflows/build-cpp.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 1f6a5d957..aba5e7f9d 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -108,9 +108,9 @@ jobs: - name: Build windows if: runner.os == 'Windows' working-directory: languages/cpp - # env: - # BOOST_INCLUDE_DIR: C:\vcpkg\buildtrees\boost\ - # NLOHMANN_JSON_INCLUDE_DIR: C:\vcpkg\buildtrees\nlohmann-json\ + env: + BOOST_INCLUDE_DIR: C:\vcpkg\installed\x64-windows\include\boost + NLOHMANN_JSON_INCLUDE_DIR: C:\vcpkg\installed\x64-windows\include\nlohmann-json run: | mkdir build cd build From a7d7a958b41812790b1baf89fe87f1a648d62e17 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Mon, 15 Apr 2024 15:12:22 +0200 Subject: [PATCH 45/67] Maybe fix --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index aba5e7f9d..253b50bf6 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -117,7 +117,7 @@ jobs: $DNLOHMANN_PATH="C:\vcpkg\installed\x64-windows\include\nlohmann-json" $DBOOST_PATH="C:\vcpkg\installed\x64-windows\include\boost" $DTARGET="include/libbitwarden_c.dll" - cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake + cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/languages/cpp/ cmake --build . shell: pwsh From 1f11e5009c2b30cb2e153b396688d9e4c1ea4b79 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Mon, 15 Apr 2024 16:12:01 +0200 Subject: [PATCH 46/67] Change path --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 253b50bf6..44d97b695 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -117,7 +117,7 @@ jobs: $DNLOHMANN_PATH="C:\vcpkg\installed\x64-windows\include\nlohmann-json" $DBOOST_PATH="C:\vcpkg\installed\x64-windows\include\boost" $DTARGET="include/libbitwarden_c.dll" - cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/languages/cpp/ + cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/languages/cpp/ cmake --build . shell: pwsh From 49041f5fb5664c6caaaaf8bb46427655f092be58 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Mon, 15 Apr 2024 18:50:57 +0200 Subject: [PATCH 47/67] Maybe fix --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 44d97b695..67780a501 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -117,7 +117,7 @@ jobs: $DNLOHMANN_PATH="C:\vcpkg\installed\x64-windows\include\nlohmann-json" $DBOOST_PATH="C:\vcpkg\installed\x64-windows\include\boost" $DTARGET="include/libbitwarden_c.dll" - cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=$DTARGET -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/languages/cpp/ + cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dll -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/languages/cpp/ cmake --build . shell: pwsh From 636fe4822fab7e2283191ccde01f91ad2d9bde63 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Mon, 15 Apr 2024 19:14:23 +0200 Subject: [PATCH 48/67] Add caching param --- .github/workflows/build-cpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 67780a501..d3c615107 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -68,8 +68,8 @@ jobs: env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: | - vcpkg install boost - vcpkg install nlohmann-json + vcpkg install boost --binarysource="clear;x-gha,readwrite" + vcpkg install nlohmann-json --binarysource="clear;x-gha,readwrite" shell: pwsh - name: Download schemas From a82b2022c58e945d523eafae78ea2fe367d84679 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 16 Apr 2024 15:18:28 +0200 Subject: [PATCH 49/67] List includes --- .github/workflows/build-cpp.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index d3c615107..24cbf94ef 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -84,6 +84,9 @@ jobs: name: libbitwarden_c_files-${{ matrix.settings.target }} path: languages/cpp/include + - name: List includes + run: ls languages/cpp/include + - name: Build unix working-directory: languages/cpp if: runner.os == 'macOS' || runner.os == 'Linux' From bf0fcd9c2bd634494ce54a2a437b8997d0d06c6a Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 16 Apr 2024 15:19:56 +0200 Subject: [PATCH 50/67] Get acl --- .github/workflows/build-cpp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 24cbf94ef..434c9da31 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -85,7 +85,9 @@ jobs: path: languages/cpp/include - name: List includes - run: ls languages/cpp/include + run: | + ls languages/cpp/include + Get-Acl languages/cpp/include/* | Format-List - name: Build unix working-directory: languages/cpp From 15294924a4969a1bf9c19bdfc4a6aed5925bf997 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 16 Apr 2024 18:37:20 +0200 Subject: [PATCH 51/67] Add github actions cache --- .github/workflows/build-cpp.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 434c9da31..abf665417 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -55,6 +55,16 @@ jobs: brew install nlohmann-json brew install boost + - name: Cache vcpkg + if: runner.os == 'Windows' + uses: actions/cache@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + path: C:/vcpkg/ + key: vcpkg-${{ runner.os }}-${{ matrix.settings.target }} + restore-keys: | + vcpkg-${{ runner.os }}- + vcpkg- + - name: Export GitHub Actions cache environment variables if: runner.os == 'Windows' uses: actions/github-script@v6 @@ -64,7 +74,7 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Install libraries for Windows - if: runner.os == 'Windows' + if: runner.os == 'Windows' && steps.cache.outputs.cache-hit != 'true' env: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" run: | @@ -85,6 +95,7 @@ jobs: path: languages/cpp/include - name: List includes + if: runner.os == 'Windows' run: | ls languages/cpp/include Get-Acl languages/cpp/include/* | Format-List From 24e6ddb96303b7c23e07eadff5b8a5b2796963a3 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 16 Apr 2024 18:40:37 +0200 Subject: [PATCH 52/67] Add cache save --- .github/workflows/build-cpp.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index abf665417..5de6e65dd 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -57,7 +57,7 @@ jobs: - name: Cache vcpkg if: runner.os == 'Windows' - uses: actions/cache@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 with: path: C:/vcpkg/ key: vcpkg-${{ runner.os }}-${{ matrix.settings.target }} @@ -82,6 +82,13 @@ jobs: vcpkg install nlohmann-json --binarysource="clear;x-gha,readwrite" shell: pwsh + - name: Save cache + if: runner.os == 'Windows' + uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + with: + path: C:/vcpkg/ + key: vcpkg-${{ runner.os }}-${{ matrix.settings.target }} + - name: Download schemas uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: From 6074481d100bed754b7b600373e1422f58e8aa2d Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Tue, 16 Apr 2024 18:53:06 +0200 Subject: [PATCH 53/67] Set permissions for include folder on Windows --- .github/workflows/build-cpp.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 5de6e65dd..6a2b36380 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -101,10 +101,20 @@ jobs: name: libbitwarden_c_files-${{ matrix.settings.target }} path: languages/cpp/include - - name: List includes + - name: Set permissions to include folder if: runner.os == 'Windows' + shell: pwsh run: | - ls languages/cpp/include + Get-Acl languages/cpp/include/* | Format-List + + $path = "./languages/cpp/include" + $name = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name + $acl = Get-Acl languages/cpp/include + $accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($name,"FullControl","Allow") + $acl.SetAccessRule($accessRule) + $acl | Set-Acl languages/cpp/include + Get-ChildItem -Path "$path" -Recurse -Force | Set-Acl -aclObject $acl -Verbose + Get-Acl languages/cpp/include/* | Format-List - name: Build unix From 54dab6c5a39700c5aece44d10b8bcd59aed5bd86 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 18 Apr 2024 12:15:43 +0200 Subject: [PATCH 54/67] Check if build fails or seeting paths --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 6a2b36380..4e20ebadb 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -151,7 +151,7 @@ jobs: $DBOOST_PATH="C:\vcpkg\installed\x64-windows\include\boost" $DTARGET="include/libbitwarden_c.dll" cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dll -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/languages/cpp/ - cmake --build . + # cmake --build . shell: pwsh - name: Copy artifacts From 1cde15b789743cd8fb0400efb1ec896548bd12a1 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 19 Apr 2024 10:37:44 +0200 Subject: [PATCH 55/67] Comment out copy in cmake list --- .github/workflows/build-cpp.yml | 2 +- languages/cpp/CMakeLists.txt | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 4e20ebadb..6a2b36380 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -151,7 +151,7 @@ jobs: $DBOOST_PATH="C:\vcpkg\installed\x64-windows\include\boost" $DTARGET="include/libbitwarden_c.dll" cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dll -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/languages/cpp/ - # cmake --build . + cmake --build . shell: pwsh - name: Copy artifacts diff --git a/languages/cpp/CMakeLists.txt b/languages/cpp/CMakeLists.txt index e513a32ed..862d25d7e 100644 --- a/languages/cpp/CMakeLists.txt +++ b/languages/cpp/CMakeLists.txt @@ -25,12 +25,12 @@ add_library(BitwardenClient SHARED ${SOURCES} ${SCHEMAS_SOURCE}) set(LIB_BITWARDEN_C "${CMAKE_SOURCE_DIR}/${TARGET}") # Copy the library to the build directory before building -add_custom_command( - TARGET BitwardenClient PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy - ${LIB_BITWARDEN_C} - $ -) +# add_custom_command( +# TARGET BitwardenClient PRE_BUILD +# COMMAND ${CMAKE_COMMAND} -E copy +# ${LIB_BITWARDEN_C} +# $ +# ) # Link libraries target_link_libraries(BitwardenClient PRIVATE ${LIB_BITWARDEN_C}) From 1de39a007e3f1e4a8ac7c7ee1250e9c922aeb1af Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 19 Apr 2024 11:45:37 +0200 Subject: [PATCH 56/67] Fix library copy command in CMakeLists.txt --- languages/cpp/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/languages/cpp/CMakeLists.txt b/languages/cpp/CMakeLists.txt index 862d25d7e..e513a32ed 100644 --- a/languages/cpp/CMakeLists.txt +++ b/languages/cpp/CMakeLists.txt @@ -25,12 +25,12 @@ add_library(BitwardenClient SHARED ${SOURCES} ${SCHEMAS_SOURCE}) set(LIB_BITWARDEN_C "${CMAKE_SOURCE_DIR}/${TARGET}") # Copy the library to the build directory before building -# add_custom_command( -# TARGET BitwardenClient PRE_BUILD -# COMMAND ${CMAKE_COMMAND} -E copy -# ${LIB_BITWARDEN_C} -# $ -# ) +add_custom_command( + TARGET BitwardenClient PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${LIB_BITWARDEN_C} + $ +) # Link libraries target_link_libraries(BitwardenClient PRIVATE ${LIB_BITWARDEN_C}) From 9e1800d93e4d99b41007028859513683d0bf73f7 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 19 Apr 2024 11:45:44 +0200 Subject: [PATCH 57/67] Add BUILD_TESTING=OFF flag to CMake configuration --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 6a2b36380..ee30f8b90 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -150,7 +150,7 @@ jobs: $DNLOHMANN_PATH="C:\vcpkg\installed\x64-windows\include\nlohmann-json" $DBOOST_PATH="C:\vcpkg\installed\x64-windows\include\boost" $DTARGET="include/libbitwarden_c.dll" - cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dll -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/languages/cpp/ + cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dll -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/languages/cpp/ -DBUILD_TESTING=OFF cmake --build . shell: pwsh From 977f79d1b50dce6be5036d56bf686d4dabf64d43 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Fri, 19 Apr 2024 15:16:44 +0200 Subject: [PATCH 58/67] Fix dtarget --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index ee30f8b90..e4e959584 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -150,7 +150,7 @@ jobs: $DNLOHMANN_PATH="C:\vcpkg\installed\x64-windows\include\nlohmann-json" $DBOOST_PATH="C:\vcpkg\installed\x64-windows\include\boost" $DTARGET="include/libbitwarden_c.dll" - cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET=include/libbitwarden_c.dll -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/languages/cpp/ -DBUILD_TESTING=OFF + cmake .. -DNLOHMANN=$DNLOHMANN_PATH -DBOOST=$DBOOST_PATH -DTARGET="include/libbitwarden_c.dll" -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/languages/cpp/ -DBUILD_TESTING=OFF cmake --build . shell: pwsh From c6761cd3ee00a409331da635c23ae7c133972114 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 24 Apr 2024 13:46:57 +0200 Subject: [PATCH 59/67] Update build-cpp.yml to exclude Windows-2022 target --- .github/workflows/build-cpp.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index e4e959584..8f3638a81 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -30,11 +30,8 @@ jobs: - os: macos-12 target: x86_64-apple-darwin - # - os: macos-12 # aarch64 is not supported by gh action runners yet - # target: aarch64-apple-darwin - - - os: windows-2022 - target: x86_64-pc-windows-msvc + # - os: windows-2022 + # target: x86_64-pc-windows-msvc - os: ubuntu-22.04 target: x86_64-unknown-linux-gnu From b23a9339eb7b82c58615e923ffbfd4278309828f Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 24 Apr 2024 13:47:06 +0200 Subject: [PATCH 60/67] Add release-cpp.yml workflow for C++ SDK release --- .github/workflows/release-cpp.yml | 172 ++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 .github/workflows/release-cpp.yml diff --git a/.github/workflows/release-cpp.yml b/.github/workflows/release-cpp.yml new file mode 100644 index 000000000..d02c2fb6c --- /dev/null +++ b/.github/workflows/release-cpp.yml @@ -0,0 +1,172 @@ +name: Release C++ SDK +run-name: Release C++ SDK ${{ inputs.release_type }} + +on: + workflow_dispatch: + inputs: + release_type: + description: "Release Options" + required: true + default: "Release" + type: choice + options: + - Release + - Dry Run + +env: + _KEY_VAULT: "bitwarden-ci" + +jobs: + validate: + name: Setup + runs-on: ubuntu-22.04 + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - name: Checkout repo + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Branch check + if: ${{ inputs.release_type != 'Dry Run' }} + run: | + if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix-rc" ]]; then + echo "===================================" + echo "[!] Can only release from the 'rc' or 'hotfix-rc' branches" + echo "===================================" + exit 1 + fi + + - name: Get version + id: version + run: | + VERSION=$(cat languages/cpp/vcpkg.json | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") + echo "version=$VERSION" >> $GITHUB_OUTPUT + + github-release: + name: GitHub Release + runs-on: ubuntu-22.04 + needs: + - repo-sync + - validate + env: + _PKG_VERSION: ${{ needs.validate.outputs.version }} + steps: + - name: Login to Azure - Prod Subscription + uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 + with: + creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} + + - name: Retrieve secrets + id: retrieve-secrets + uses: bitwarden/gh-actions/get-keyvault-secrets@main + with: + keyvault: ${{ env._KEY_VAULT }} + secrets: "github-pat-bitwarden-devops-bot-repo-scope" + + - name: Download x86_64-apple-darwin C artifact + uses: bitwarden/gh-actions/download-artifacts@main + with: + workflow: build-rust-cross-platform.yml + workflow_conclusion: success + branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} + artifacts: libbitwarden_c_files-x86_64-apple-darwin + skip_unpack: true + + - name: Download aarch64-apple-darwin C artifact + uses: bitwarden/gh-actions/download-artifacts@main + with: + workflow: build-rust-cross-platform.yml + workflow_conclusion: success + branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} + artifacts: libbitwarden_c_files-aarch64-apple-darwin + skip_unpack: true + + - name: Download x86_64-unknown-linux-gnu C artifact + uses: bitwarden/gh-actions/download-artifacts@main + with: + workflow: build-rust-cross-platform.yml + workflow_conclusion: success + branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} + artifacts: libbitwarden_c_files-x86_64-unknown-linux-gnu + skip_unpack: true + + - name: Download x86_64-pc-windows-msvc C artifact + uses: bitwarden/gh-actions/download-artifacts@main + with: + workflow: build-rust-cross-platform.yml + workflow_conclusion: success + branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} + artifacts: libbitwarden_c_files-x86_64-pc-windows-msvc + skip_unpack: true + + - name: Rename C build artifacts + run: | + artifacts=("x86_64-apple-darwin" "aarch64-apple-darwin" "x86_64-unknown-linux-gnu" "x86_64-pc-windows-msvc") # aarch64-unknown-linux-gnu) + for value in "${artifacts[@]}" + do + unzip libbitwarden_c_files-$value.zip -d libbitwarden_c_files-$value + cd libbitwarden_c_files-$value + zip -Rj ../libbitwarden_c_files-$value-$_PKG_VERSION.zip 'libbitwarden_c.*' + cd .. + done + + - name: Download schemas + uses: bitwarden/gh-actions/download-artifacts@main + with: + name: sdk-schemas-cpp + workflow: generate_schemas.yml + workflow_conclusion: success + branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} + artifacts: sdk-schemas-cpp + skip_unpack: true + + - name: Rename schemas artifacts + run: mv sdk-schemas-cpp.zip sdk-schemas-cpp-$_PKG_VERSION.zip + + - name: Download x86_64-apple-darwin C++ artifact + uses: bitwarden/gh-actions/download-artifacts@main + with: + workflow: build-cpp.yml + workflow_conclusion: success + branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} + artifacts: libbitwarden_cpp-x86_64-apple-darwin + skip_unpack: true + + - name: Download x86_64-unknown-linux-gnu C++ artifact + uses: bitwarden/gh-actions/download-artifacts@main + with: + workflow: build-cpp.yml + workflow_conclusion: success + branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} + artifacts: libbitwarden_cpp-x86_64-unknown-linux-gnu + skip_unpack: true + + - name: Rename C++ build artifacts + run: | + artifacts=("x86_64-apple-darwin" "x86_64-unknown-linux-gnu") # "x86_64-pc-windows-msvc" "aarch64-apple-darwin" "aarch64-unknown-linux-gnu") + for value in "${artifacts[@]}" + do + mv libbitwarden_cpp-$value.zip libbitwarden_c_files-$value-$_PKG_VERSION.zip + done + + - name: Calculate SHA512 checksums + run: | + sha512sum -b libbitwarden_c_files-*.zip + sha512sum -b sdk-schemas-cpp-*.zip + + - name: Create release + if: ${{ inputs.release_type != 'Dry Run' }} + uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 + with: + tag: cpp-sdk-v${{ env._PKG_VERSION }} + name: "C++ SDK v${{ env._PKG_VERSION }}" + body: "" + token: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} + draft: true + repo: sdk + owner: bitwarden + artifacts: "libbitwarden_c_files-x86_64-apple-darwin-${{ env._PKG_VERSION }}.zip, + libbitwarden_c_files-aarch64-apple-darwin-${{ env._PKG_VERSION }}.zip, + libbitwarden_c_files-x86_64-unknown-linux-gnu-${{ env._PKG_VERSION }}.zip, + libbitwarden_c_files-x86_64-pc-windows-msvc-${{ env._PKG_VERSION }}.zip, + sdk-schemas-cpp-${{ env._PKG_VERSION }}.zip" From 7d6315af64e2fc2662d95ebce614c2d6a25a42b7 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 24 Apr 2024 13:47:26 +0200 Subject: [PATCH 61/67] Add C++ SDKto version bump workflow --- .github/workflows/version-bump.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 704bee01d..24692bea6 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -23,6 +23,7 @@ on: - go-sdk - dotnet-sdk - php-sdk + - cpp-sdk version_number: description: "New version (example: '2024.1.0')" required: true @@ -175,6 +176,12 @@ jobs: run: | sed -i 's/"version": "[0-9]\.[0-9]\.[0-9]"/"version": "${{ inputs.version_number }}"/' ./languages/php/composer.json + ### cpp sdk + - name: Bump C++ SDK Version + if: ${{ inputs.project == 'cpp-sdk' }} + run: | + sed -i 's/"version": "[0-9]\.[0-9]\.[0-9]"/"version": "${{ inputs.version_number }}"/' ./languages/cpp/vcpkg.json + ############################ # VERSION BUMP SECTION END # ############################ From 63e9194a162782acb569a82e2569f4e8e5149869 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 24 Apr 2024 13:47:41 +0200 Subject: [PATCH 62/67] Add portfile (not working yet) --- languages/cpp/portfile.cmake | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 languages/cpp/portfile.cmake diff --git a/languages/cpp/portfile.cmake b/languages/cpp/portfile.cmake new file mode 100644 index 000000000..88e601246 --- /dev/null +++ b/languages/cpp/portfile.cmake @@ -0,0 +1,59 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO bitwarden/sdk + REF "${VERSION}" + SHA512 7c2fb18261ce9185d29b690ccb7694d7926abe3af0619dbe42b7ab43b400ee71c1eb79c31f892aea2fbdb55036225f31ee393287cce91afd17f20cff8f6cb949 + HEAD_REF main +) + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${ARCHIVE}" +) + +if(VCPKG_HOST_IS_WINDOWS) + vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/bitwarden/sm-sdk-go/releases/download/v${VERSION}/libbitwarden_c_files-aarch64-apple-darwin-${VERSION}.zip" + FILENAME "libbitwarden_c_files-aarch64-apple-darwin-${VERSION}.zip" + SHA512 9392e227009a0c3692e48df8547131e5c79729ba10e1e56c4b84d1023322fa51dff6e0cfc513857ca8d210f76663cfe21bdfe35a30b10a40ef4a3288ef1eacb4 + ) +endif() + +if(VCPKG_HOST_IS_OSX) + vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/bitwarden/sm-sdk-go/releases/download/v${VERSION}/libbitwarden_c_files-x86_64-pc-windows-msvc-${VERSION}.zip" + FILENAME "libbitwarden_c_files-x86_64-pc-windows-msvc-${VERSION}.zip" + SHA512 9392e227009a0c3692e48df8547131e5c79729ba10e1e56c4b84d1023322fa51dff6e0cfc513857ca8d210f76663cfe21bdfe35a30b10a40ef4a3288ef1eacb4 +) +endif() + +if(VCPKG_HOST_IS_LINUX) + vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/bitwarden/sm-sdk-go/releases/download/v${VERSION}/libbitwarden_c_files-x86_64-unknown-linux-gnu-${VERSION}.zip" + FILENAME "libbitwarden_c_files-x86_64-pc-windows-msvc-${VERSION}.zip" + SHA512 9392e227009a0c3692e48df8547131e5c79729ba10e1e56c4b84d1023322fa51dff6e0cfc513857ca8d210f76663cfe21bdfe35a30b10a40ef4a3288ef1eacb4 +) +endif() + +vcpkg_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE "${ARCHIVE}" +) + +file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/7zip-config.cmake.in" DESTINATION "${SOURCE_PATH}") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}/languages/cpp" + OPTIONS + -DNLOHMANN=DNLOHMANN_PATH + -DBOOST=DBOOST_PATH + -DTARGET=DTARGET_PATH +) + +vcpkg_cmake_install() +vcpkg_copy_pdbs() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") \ No newline at end of file From 6343ced8056b3919027e4540f8c9d05d0b0a685c Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 8 May 2024 14:25:53 +0200 Subject: [PATCH 63/67] Remove sh512 hashes calc --- .github/workflows/release-cpp.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/release-cpp.yml b/.github/workflows/release-cpp.yml index d02c2fb6c..58ece2650 100644 --- a/.github/workflows/release-cpp.yml +++ b/.github/workflows/release-cpp.yml @@ -149,11 +149,6 @@ jobs: mv libbitwarden_cpp-$value.zip libbitwarden_c_files-$value-$_PKG_VERSION.zip done - - name: Calculate SHA512 checksums - run: | - sha512sum -b libbitwarden_c_files-*.zip - sha512sum -b sdk-schemas-cpp-*.zip - - name: Create release if: ${{ inputs.release_type != 'Dry Run' }} uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 From c144e745be25b784b6b2cfe6f571bb111d500ff6 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 8 May 2024 14:27:55 +0200 Subject: [PATCH 64/67] Change files to publish --- .github/workflows/release-cpp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-cpp.yml b/.github/workflows/release-cpp.yml index 58ece2650..65517eb39 100644 --- a/.github/workflows/release-cpp.yml +++ b/.github/workflows/release-cpp.yml @@ -146,7 +146,7 @@ jobs: artifacts=("x86_64-apple-darwin" "x86_64-unknown-linux-gnu") # "x86_64-pc-windows-msvc" "aarch64-apple-darwin" "aarch64-unknown-linux-gnu") for value in "${artifacts[@]}" do - mv libbitwarden_cpp-$value.zip libbitwarden_c_files-$value-$_PKG_VERSION.zip + mv libbitwarden_cpp-$value.zip libbitwarden_cpp_files-$value-$_PKG_VERSION.zip done - name: Create release @@ -164,4 +164,6 @@ jobs: libbitwarden_c_files-aarch64-apple-darwin-${{ env._PKG_VERSION }}.zip, libbitwarden_c_files-x86_64-unknown-linux-gnu-${{ env._PKG_VERSION }}.zip, libbitwarden_c_files-x86_64-pc-windows-msvc-${{ env._PKG_VERSION }}.zip, + libbitwarden_cpp_files-x86_64-unknown-linux-gnu-${{ env._PKG_VERSION }}.zip, + libbitwarden_cpp_files-x86_64-apple-darwin-${{ env._PKG_VERSION }}.zip, sdk-schemas-cpp-${{ env._PKG_VERSION }}.zip" From 7f67c319c5784f8a9f80d094a63b93cda7f31c80 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 8 May 2024 17:30:33 +0200 Subject: [PATCH 65/67] Remove portfile --- languages/cpp/portfile.cmake | 59 ------------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 languages/cpp/portfile.cmake diff --git a/languages/cpp/portfile.cmake b/languages/cpp/portfile.cmake deleted file mode 100644 index 88e601246..000000000 --- a/languages/cpp/portfile.cmake +++ /dev/null @@ -1,59 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO bitwarden/sdk - REF "${VERSION}" - SHA512 7c2fb18261ce9185d29b690ccb7694d7926abe3af0619dbe42b7ab43b400ee71c1eb79c31f892aea2fbdb55036225f31ee393287cce91afd17f20cff8f6cb949 - HEAD_REF main -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE "${ARCHIVE}" -) - -if(VCPKG_HOST_IS_WINDOWS) - vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/bitwarden/sm-sdk-go/releases/download/v${VERSION}/libbitwarden_c_files-aarch64-apple-darwin-${VERSION}.zip" - FILENAME "libbitwarden_c_files-aarch64-apple-darwin-${VERSION}.zip" - SHA512 9392e227009a0c3692e48df8547131e5c79729ba10e1e56c4b84d1023322fa51dff6e0cfc513857ca8d210f76663cfe21bdfe35a30b10a40ef4a3288ef1eacb4 - ) -endif() - -if(VCPKG_HOST_IS_OSX) - vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/bitwarden/sm-sdk-go/releases/download/v${VERSION}/libbitwarden_c_files-x86_64-pc-windows-msvc-${VERSION}.zip" - FILENAME "libbitwarden_c_files-x86_64-pc-windows-msvc-${VERSION}.zip" - SHA512 9392e227009a0c3692e48df8547131e5c79729ba10e1e56c4b84d1023322fa51dff6e0cfc513857ca8d210f76663cfe21bdfe35a30b10a40ef4a3288ef1eacb4 -) -endif() - -if(VCPKG_HOST_IS_LINUX) - vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/bitwarden/sm-sdk-go/releases/download/v${VERSION}/libbitwarden_c_files-x86_64-unknown-linux-gnu-${VERSION}.zip" - FILENAME "libbitwarden_c_files-x86_64-pc-windows-msvc-${VERSION}.zip" - SHA512 9392e227009a0c3692e48df8547131e5c79729ba10e1e56c4b84d1023322fa51dff6e0cfc513857ca8d210f76663cfe21bdfe35a30b10a40ef4a3288ef1eacb4 -) -endif() - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE "${ARCHIVE}" -) - -file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") -file(COPY "${CMAKE_CURRENT_LIST_DIR}/7zip-config.cmake.in" DESTINATION "${SOURCE_PATH}") - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}/languages/cpp" - OPTIONS - -DNLOHMANN=DNLOHMANN_PATH - -DBOOST=DBOOST_PATH - -DTARGET=DTARGET_PATH -) - -vcpkg_cmake_install() -vcpkg_copy_pdbs() - -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") \ No newline at end of file From 8e505cc23c7ef164546592c9ed2569037a75682d Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Wed, 8 May 2024 17:31:15 +0200 Subject: [PATCH 66/67] Fix endline --- languages/cpp/vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/cpp/vcpkg.json b/languages/cpp/vcpkg.json index 56ad5084d..06a7b968c 100644 --- a/languages/cpp/vcpkg.json +++ b/languages/cpp/vcpkg.json @@ -7,4 +7,4 @@ "boost", "nlohmann-json" ] - } \ No newline at end of file +} From c430694ddb8de0b6893ebbc98d3feebe630aa5e3 Mon Sep 17 00:00:00 2001 From: Michal Checinski Date: Thu, 9 May 2024 11:35:21 +0200 Subject: [PATCH 67/67] Fix --- .github/workflows/build-cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-cpp.yml b/.github/workflows/build-cpp.yml index 8f3638a81..0fb032853 100644 --- a/.github/workflows/build-cpp.yml +++ b/.github/workflows/build-cpp.yml @@ -64,7 +64,7 @@ jobs: - name: Export GitHub Actions cache environment variables if: runner.os == 'Windows' - uses: actions/github-script@v6 + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');