Skip to content

Commit

Permalink
Merge branch 'main' into ps/improve-ts-bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-garcia authored Feb 8, 2024
2 parents 6992012 + 1595306 commit 29e291a
Show file tree
Hide file tree
Showing 77 changed files with 3,008 additions and 270 deletions.
15 changes: 1 addition & 14 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base",
"github>bitwarden/renovate-config:pin-actions",
":combinePatchMinorReleases",
":dependencyDashboard",
":maintainLockFilesWeekly",
":prConcurrentLimit10",
":rebaseStalePrs",
":separateMajorReleases",
"group:monorepos",
"schedule:weekends"
],
"extends": ["github>bitwarden/renovate-config:non-pinned"],
"separateMajorMinor": true,
"enabledManagers": ["cargo", "github-actions", "npm", "nuget"],
"commitMessagePrefix": "[deps]:",
"commitMessageTopic": "{{depName}}",
"packageRules": [
{
"matchManagers": ["cargo"],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
run: cross build -p bitwarden-uniffi --release --target=${{ matrix.settings.target }}

- name: Upload artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: android-${{ matrix.settings.target }}
path: ./target/${{ matrix.settings.target }}/release/libbitwarden_uniffi.so
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
run: ./build-schemas.sh

- name: Publish
uses: gradle/gradle-build-action@982da8e78c05368c70dac0351bb82647a9e9a5d2 # v2.11.1
uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
with:
arguments: sdk:publish
build-root-directory: languages/kotlin
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/build-cli-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
paths:
- "crates/bws/**"
workflow_dispatch:
inputs:
sdk_branch:
description: "Server branch name to deploy (examples: 'master', 'rc', 'feature/sm')"
type: string
default: master
pull_request:
paths:
- ".github/workflows/build-cli-docker.yml"
Expand Down Expand Up @@ -44,10 +39,10 @@ jobs:
########## Set up Docker ##########
- name: Set up QEMU emulators
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.10.0
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

########## Login to Docker registries ##########
- name: Login to Azure - Prod Subscription
Expand Down Expand Up @@ -104,14 +99,14 @@ jobs:
fi
- name: Build and push Docker image
uses: docker/build-push-action@1104d471370f9806843c095c1db02b5a90c5f8b6 # v3.3.1
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
context: .
file: crates/bws/Dockerfile
platforms: |
linux/amd64,
linux/arm64/v8
push: true
push: ${{ env.is_publish_branch }}
tags: ${{ steps.tag-list.outputs.tags }}
secrets: |
"GH_PAT=${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
run: zip -j ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip ./target/${{ matrix.settings.target }}/release/bws

- name: Upload artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip
path: ./bws-${{ matrix.settings.target }}-${{ env._PACKAGE_VERSION }}.zip
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
run: zip ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip ./bws-macos-universal/bws

- name: Upload artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip
path: ./bws-macos-universal-${{ env._PACKAGE_VERSION }}.zip
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
sed -i.bak 's/\$NAME\$/Bitwarden Secrets Manager CLI/g' THIRDPARTY.html
- name: Upload artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: THIRDPARTY.html
path: ./crates/bws/THIRDPARTY.html
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
working-directory: languages/csharp/Bitwarden.Sdk

- name: Upload NuGet package
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: Bitwarden.Sdk.0.0.1.nupkg
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
path: languages/java/src/main/resources/win32-x86-64

- name: Publish Maven
uses: gradle/gradle-build-action@982da8e78c05368c70dac0351bb82647a9e9a5d2 # v2.11.1
uses: gradle/actions/setup-gradle@ec92e829475ac0c2315ea8f9eced72db85bb337a # v3.0.0
with:
arguments: publish
build-root-directory: languages/java
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-napi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
run: ${{ matrix.settings.build }}

- name: Upload artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: sdk-bitwarden-napi-${{ matrix.settings.target }}
path: ${{ github.workspace }}/crates/bitwarden-napi/sdk-napi.*.node
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-python-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ jobs:
working-directory: ${{ github.workspace }}/languages/python

- name: Upload wheels
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: bitwarden_sdk-${{ env._PACKAGE_VERSION }}-${{ matrix.settings.target }}
path: ${{ github.workspace }}/target/wheels/bitwarden_sdk*.whl

- name: Upload sdists
if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} # we only need one sdist
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: bitwarden_sdk-${{ env._PACKAGE_VERSION }}-sdist
path: ${{ github.workspace }}/target/wheels/bitwarden_sdk-*.tar.gz
2 changes: 1 addition & 1 deletion .github/workflows/build-rust-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: cargo build --target ${{ matrix.settings.target }} --release

- name: Upload Artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: libbitwarden_c_files-${{ matrix.settings.target }}
path: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete-old-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Cleanup Android SDK
runs-on: ubuntu-22.04
steps:
- uses: actions/delete-package-versions@0d39a63126868f5eefaa47169615edd3c0f61e20 # v4.1.1
- uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5.0.0
with:
package-name: com.bitwarden.sdk-android
package-type: maven
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/generate_schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,48 +37,48 @@ jobs:
run: npm run schemas

- name: Upload ts schemas artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: schemas.ts
path: ${{ github.workspace }}/languages/js/sdk-client/src/schemas.ts
if-no-files-found: error

- name: Upload c# schemas artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: schemas.cs
path: ${{ github.workspace }}/languages/csharp/Bitwarden.Sdk/schemas.cs
if-no-files-found: error

- name: Upload python schemas artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: schemas.py
path: ${{ github.workspace }}/languages/python/bitwarden_sdk/schemas.py
if-no-files-found: error

- name: Upload ruby schemas artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: schemas.rb
path: ${{ github.workspace }}/languages/ruby/bitwarden_sdk/lib/schemas.rb
if-no-files-found: error

- name: Upload json schemas artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: sdk-schemas-json
path: ${{ github.workspace }}/support/schemas/*
if-no-files-found: error

- name: Upload Go schemas artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: schemas.go
path: ${{ github.workspace }}/languages/go/schema.go

- name: Upload java schemas artifact
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: sdk-schemas-java
path: ${{ github.workspace }}/languages/java/src/main/java/com/bitwarden/sdk/schema/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golang-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
go-version: ${{ env.GO_VERSION }}

- name: Cache dependencies
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.3
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand Down
94 changes: 90 additions & 4 deletions .github/workflows/publish-python.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,99 @@
---
name: Publish Python SDK
run-name: Publish Python SDK ${{ inputs.release_type }}

on:
workflow_dispatch:
inputs:
release_type:
description: "Release Options"
required: true
default: "Release"
type: choice
options:
- Release
- Dry Run

defaults:
run:
shell: bash

jobs:
stub:
name: Stub
setup:
name: Setup
runs-on: ubuntu-22.04
steps:
- name: Stub
run: echo "Stub"
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Branch check
if: ${{ github.event.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
publish:
name: Publish
runs-on: ubuntu-22.04
needs: setup
steps:
- name: Install Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.9"

- name: Install twine
run: pip install twine

- name: Download artifacts
uses: dawidd6/action-download-artifact@e7466d1a7587ed14867642c2ca74b5bcc1e19a2d # v3.0.0
with:
workflow: build-python-wheels.yml
path: ${{ github.workspace }}/target/wheels/dist
workflow_conclusion: success
branch: ${{ github.event.inputs.release_type == 'Dry Run' && 'main' || github.ref_name }}
name: bitwarden_sdk(.*)
name_is_regexp: true

- name: Move files
working-directory: ${{ github.workspace }}/target/wheels/dist
run: |
find . -maxdepth 2 -type f -print0 | xargs -0 mv -t .
rm -rf */
- name: Login to Azure
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
with:
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}

- name: Retrieve pypi api token
id: retrieve-secret
uses: bitwarden/gh-actions/get-keyvault-secrets@main
with:
keyvault: "bitwarden-ci"
secrets: "pypi-api-token,
pypi-test-api-token"

- name: Check
working-directory: ${{ github.workspace }}/target/wheels
run: twine check dist/*

- name: Publish
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
working-directory: ${{ github.workspace }}/target/wheels
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ steps.retrieve-secret.outputs.pypi-api-token }}
run: twine upload --repository pypi dist/*

- name: Dry Run - Publish
if: ${{ github.event.inputs.release_type == 'Dry Run' }}
working-directory: ${{ github.workspace }}/target/wheels
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ steps.retrieve-secret.outputs.pypi-test-api-token }}
run: twine upload --repository testpypi dist/*
2 changes: 1 addition & 1 deletion .github/workflows/publish-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Ruby
uses: ruby/setup-ruby@5daca165445f0ae10478593083f72ca2625e241d # v1.169.0
uses: ruby/setup-ruby@22fdc77bf4148f810455b226c90fb81b5cbc00a7 # v1.171.0
with:
ruby-version: 3.2

Expand Down
Loading

0 comments on commit 29e291a

Please sign in to comment.