-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:bitwarden/sdk into cargo-tie-versions
# Conflicts: # crates/bitwarden-json/Cargo.toml # crates/bws/Cargo.toml # crates/sdk-schemas/Cargo.toml
- Loading branch information
Showing
115 changed files
with
1,655 additions
and
803 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,78 @@ | ||
name: Deploy NuGet Package | ||
name: Publish .NET NuGet | ||
run-name: Publish .NET NuGet Package ${{ inputs.release_type }} | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version_number: | ||
description: "New Version" | ||
release_type: | ||
description: "Release Options" | ||
required: true | ||
default: "Release" | ||
type: choice | ||
options: | ||
- Release | ||
- Dry Run | ||
|
||
jobs: | ||
generate_schemas: | ||
uses: ./.github/workflows/generate_schemas.yml | ||
|
||
build_rust: | ||
uses: ./.github/workflows/build-rust-cross-platform.yml | ||
env: | ||
_KEY_VAULT: "bitwarden-ci" | ||
|
||
deploy: | ||
name: Deploy | ||
jobs: | ||
validate: | ||
name: Setup | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- generate_schemas | ||
- build_rust | ||
|
||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- name: Checkout Repository | ||
- name: Checkout repo | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Download C# schemas artifact | ||
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 | ||
with: | ||
name: schemas.cs | ||
path: languages/csharp/Bitwarden.Sdk | ||
- 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: Set up .NET Core | ||
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 | ||
with: | ||
global-json-file: languages/csharp/global.json | ||
- name: Install xmllint | ||
run: sudo apt-get install -y libxml2-utils | ||
|
||
- name: Download x86_64-apple-darwin files | ||
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 | ||
with: | ||
name: libbitwarden_c_files-x86_64-apple-darwin | ||
path: languages/csharp/Bitwarden.Sdk/macos-x64 | ||
- name: Get version | ||
id: version | ||
run: | | ||
VERSION=$(xmllint --xpath 'string(/Project/PropertyGroup/Version)' languages/csharp/Bitwarden.Sdk/Bitwarden.Sdk.csproj) | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Download aarch64-apple-darwin files | ||
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 | ||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-22.04 | ||
needs: validate | ||
steps: | ||
- name: Download NuGet package | ||
uses: bitwarden/gh-actions/download-artifacts@main | ||
with: | ||
name: libbitwarden_c_files-aarch64-apple-darwin | ||
path: languages/csharp/Bitwarden.Sdk/macos-arm64 | ||
workflow: build-dotnet.yml | ||
workflow_conclusion: success | ||
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} | ||
artifacts: Bitwarden.Sdk.${{ needs.validate.outputs.version }}.nupkg | ||
path: ./nuget-output | ||
|
||
- name: Download x86_64-unknown-linux-gnu files | ||
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 | ||
- name: Login to Azure - Prod Subscription | ||
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 | ||
with: | ||
name: libbitwarden_c_files-x86_64-unknown-linux-gnu | ||
path: languages/csharp/Bitwarden.Sdk/linux-x64 | ||
creds: ${{ secrets.AZURE_CI_SERVICE_PRINCIPAL }} | ||
|
||
- name: Download x86_64-pc-windows-msvc files | ||
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2 | ||
- name: Retrieve secrets | ||
id: retrieve-secrets | ||
uses: bitwarden/gh-actions/get-keyvault-secrets@main | ||
with: | ||
name: libbitwarden_c_files-x86_64-pc-windows-msvc | ||
path: languages/csharp/Bitwarden.Sdk/windows-x64 | ||
|
||
- name: Pack NuGet Package | ||
env: | ||
VERSION: ${{ github.event.inputs.version_number }} | ||
run: dotnet pack --configuration Release -p:PackageID=Bitwarden.Sdk -p:Version=${VERSION} --output ./nuget-output /nologo /v:n | ||
working-directory: languages/csharp/Bitwarden.Sdk | ||
keyvault: ${{ env._KEY_VAULT }} | ||
secrets: "nuget-api-key" | ||
|
||
- name: Publish NuGet Package | ||
run: dotnet nuget push ./languages/csharp/Bitwarden.Sdk/nuget-output/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json | ||
if: ${{ inputs.release_type != 'Dry Run' }} | ||
env: | ||
NUGET_API_KEY: ${{ steps.retrieve-secrets.outputs.nuget-api-key }} | ||
run: dotnet nuget push ./nuget-output/*.nupkg -k ${{ env.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json |
Oops, something went wrong.