Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bitwarden/sdk into feature/wasm
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
#	.vscode/settings.json
#	Cargo.lock
#	Cargo.toml
#	crates/bitwarden-napi/src-ts/bitwarden_client/schemas.ts
#	crates/bitwarden/src/auth/commands/login.rs
#	crates/bitwarden/src/client/auth_settings.rs
#	crates/bitwarden/src/client/client.rs
#	crates/bitwarden/src/commands/generate_fingerprint.rs
#	crates/bitwarden/src/sdk/response/mod.rs
#	crates/bitwarden/src/util.rs
#	crates/sdk-schemas/src/main.rs
#	languages/csharp/schemas.cs
#	languages/js/sdk-client/src/schemas.ts
#	languages/js_webassembly/package-lock.json
#	languages/python/BitwardenClient/schemas.py
#	support/schemas/request/ClientSettings.json
#	support/schemas/request/Command.json
  • Loading branch information
Hinton committed Jul 21, 2023
2 parents 3068216 + f0c10f1 commit b08054e
Show file tree
Hide file tree
Showing 145 changed files with 9,387 additions and 5,051 deletions.
37 changes: 25 additions & 12 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", "schedule:monthly", ":maintainLockFilesWeekly"],
"extends": [
"config:base",
"schedule:weekends",
":combinePatchMinorReleases",
":dependencyDashboard",
":maintainLockFilesWeekly",
":prConcurrentLimit10",
":rebaseStalePrs",
":separateMajorReleases"
],
"separateMajorMinor": true,
"enabledManagers": ["cargo", "github-actions", "npm", "nuget"],
"packageRules": [
{
"groupName": "npm minor",
"matchManagers": ["npm"],
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "node non-major"
"matchUpdateTypes": ["minor", "patch"]
},
{
"matchManagers": ["cargo"],
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "rust non-major"
"matchUpdateTypes": ["patch"],
"enabled": false
},
{
"matchManagers": ["cargo"],
"matchUpdateTypes": ["minor"],
"matchCurrentVersion": ">=1.0.0",
"enabled": false
},
{
"matchManagers": ["cargo"],
Expand All @@ -22,15 +36,14 @@
"groupName": "pyo3 non-major"
},
{
"groupName": "nuget minor",
"matchManagers": ["nuget"],
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "dotnet non-major"
"matchUpdateTypes": ["minor", "patch"]
},
{
"groupName": "gh minor",
"matchManagers": ["github-actions"],
"matchPackagePatterns": ["*"],
"groupName": "gh actions all"
"matchUpdateTypes": ["minor", "patch"]
}
]
}
14 changes: 4 additions & 10 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
package_version: ${{ steps.retrieve-version.outputs.package_version }}
steps:
- name: Checkout repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Get Package Version
id: retrieve-version
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
# target: aarch64-unknown-linux-gnu
steps:
- name: Checkout repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Install rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
Expand All @@ -73,7 +73,7 @@ jobs:
sudo apt-get install gcc-aarch64-linux-gnu
- name: Cache cargo registry
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }}

Expand All @@ -82,12 +82,6 @@ jobs:
TARGET: ${{ matrix.settings.target }}
run: cargo build ${{ matrix.features }} -p bws --release --target=${{ matrix.settings.target }}

- name: Test
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: test
args: -p bws -- --test-threads=1

- name: Zip Windows
shell: cmd
if: runner.os == 'Windows'
Expand All @@ -114,7 +108,7 @@ jobs:
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
steps:
- name: Checkout repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Download x86_64-apple-darwin artifact
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
Expand Down
29 changes: 12 additions & 17 deletions .github/workflows/build-napi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,13 @@ defaults:
working-directory: crates/bitwarden-napi

jobs:
cloc:
name: CLOC
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up cloc
run: |
sudo apt update
sudo apt -y install cloc
- name: Print lines of code
run: cloc --vcs git
generate_schemas:
uses: ./.github/workflows/generate_schemas.yml

build:
name: Building @bitwarden/sdk-napi for - ${{ matrix.settings.os }}
runs-on: ${{ matrix.settings.os || 'ubuntu-latest' }}
needs: generate_schemas
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -62,10 +51,10 @@ jobs:
strip *.node
steps:
- name: Checkout repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Setup Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
with:
node-version: 18
cache: "npm"
Expand All @@ -80,10 +69,16 @@ jobs:
target: ${{ matrix.settings.target }}

- name: Cache cargo registry
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }}

- name: Retrieve schemas
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: schemas.ts
path: ${{ github.workspace }}/crates/bitwarden-napi/src-ts/bitwarden_client/

- name: Install dependencies
run: npm ci

Expand Down
33 changes: 8 additions & 25 deletions .github/workflows/build-rust-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@ env:
CARGO_TERM_COLOR: always

jobs:
cloc:
name: CLOC
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2

- name: Set up cloc
run: |
sudo apt update
sudo apt -y install cloc
- name: Print lines of code
run: cloc --vcs git

build:
name: Building ${{matrix.package}} for - ${{ matrix.os }}

Expand All @@ -49,7 +34,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Install rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
Expand All @@ -60,26 +45,24 @@ jobs:
override: true

- name: Cache cargo registry
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1

- name: Build
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: build
args: ${{ matrix.features }} -p ${{ matrix.package }} --release
env:
RUSTFLAGS: "-D warnings"

- name: Build Internal
if: ${{ matrix.package == 'bitwarden' }}
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: build
args: ${{ matrix.features }} -p ${{ matrix.package }} --features internal --release

- name: Test
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: test
args: -p ${{ matrix.package }} -- --test-threads=1
env:
RUSTFLAGS: "-D warnings"

release-dry-run:
name: Release dry-run
Expand All @@ -89,7 +72,7 @@ jobs:
- build
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Install rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
Expand All @@ -100,7 +83,7 @@ jobs:
override: true

- name: Cache cargo registry
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894 # v2.4.0
uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1

- name: Install cargo-release
run: cargo install cargo-release
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/cloc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CLOC

on:
workflow_dispatch:
push:
branches: ["master"]
pull_request:

jobs:
cloc:
name: CLOC
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Set up cloc
run: |
sudo apt update
sudo apt -y install cloc
- name: Print lines of code
run: cloc --vcs git
57 changes: 57 additions & 0 deletions .github/workflows/direct-minimal-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: Direct Minimum Version

on:
pull_request:
push:
branches:
- "master"
- "rc"
- "hotfix-rc"
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
direct-minimal-versions:
name: Check dependencies minimal versions for - ${{ matrix.settings.os }} - ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.os || 'ubuntu-latest' }}
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
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

- name: Install rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
with:
toolchain: nightly
profile: minimal
override: true

- name: Cache cargo registry
uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2.5.1
with:
key: dmv-${{ matrix.settings.target }}-cargo-${{ matrix.settings.os }}

- name: cargo check direct-minimal-versions
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
with:
command: check
args: -Z direct-minimal-versions --all-features
17 changes: 17 additions & 0 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Enforce PR labels

on:
workflow_call:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
enforce-label:
name: EnforceLabel
runs-on: ubuntu-20.04
steps:
- name: Enforce Label
uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024 # 2.2.2
with:
BANNED_LABELS: "hold,needs-qa"
BANNED_LABELS_DESCRIPTION: "PRs with the hold or needs-qa labels cannot be merged"
Loading

0 comments on commit b08054e

Please sign in to comment.