-
Notifications
You must be signed in to change notification settings - Fork 50
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' into ps/secure-crypto-service
- Loading branch information
Showing
22 changed files
with
713 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
name: Build @bitwarden/sdk-internal | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
- "rc" | ||
- "hotfix-rc" | ||
workflow_dispatch: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: crates/bitwarden-wasm-internal | ||
|
||
jobs: | ||
build: | ||
name: Building @bitwarden/sdk-wasm-internal | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 | ||
with: | ||
node-version: 20 | ||
registry-url: "https://npm.pkg.github.com" | ||
cache: "npm" | ||
|
||
- name: Install dependencies | ||
run: npm i -g binaryen | ||
|
||
- name: Install rust | ||
uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a # stable | ||
with: | ||
toolchain: stable | ||
targets: wasm32-unknown-unknown | ||
|
||
- name: Cache cargo registry | ||
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | ||
with: | ||
key: wasm-cargo-cache | ||
|
||
- name: Install wasm-bindgen-cli | ||
run: cargo install wasm-bindgen-cli | ||
|
||
- name: Build | ||
run: ./build.sh -r | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 | ||
with: | ||
name: sdk-internal | ||
path: ${{ github.workspace }}/languages/js/sdk-internal/* | ||
if-no-files-found: error |
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
name: Publish @bitwarden/sdk-internal | ||
run-name: Publish @bitwarden/sdk-internal ${{ inputs.release_type }} | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release_type: | ||
description: "Release Options" | ||
required: true | ||
default: "Release" | ||
type: choice | ||
options: | ||
- Release | ||
- Dry Run | ||
version: | ||
description: "Release Version" | ||
required: true | ||
|
||
defaults: | ||
run: | ||
working-directory: languages/js/sdk-internal | ||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Branch check | ||
if: ${{ inputs.release_type != 'Dry Run' }} | ||
run: | | ||
if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then | ||
echo "===================================" | ||
echo "[!] Can only release from the 'main' branch" | ||
echo "===================================" | ||
exit 1 | ||
fi | ||
npm: | ||
name: Publish NPM | ||
runs-on: ubuntu-22.04 | ||
needs: setup | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Login to Azure | ||
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0 | ||
with: | ||
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} | ||
|
||
- name: Retrieve secrets | ||
id: retrieve-secrets | ||
uses: bitwarden/gh-actions/get-keyvault-secrets@main | ||
with: | ||
keyvault: "bitwarden-ci" | ||
secrets: "npm-api-key" | ||
|
||
- name: Download artifact | ||
uses: bitwarden/gh-actions/download-artifacts@main | ||
with: | ||
workflow: build-wasm-internal.yml | ||
workflow_conclusion: success | ||
branch: ${{ inputs.release_type == 'Dry Run' && 'main' || github.ref_name }} | ||
artifacts: sdk-internal | ||
path: languages/js/sdk-internal | ||
|
||
- name: Set version | ||
run: | | ||
npm version --no-git-tag-version ${{ inputs.version }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup NPM | ||
run: | | ||
echo 'registry="https://registry.npmjs.org/"' > ./.npmrc | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ./.npmrc | ||
echo 'registry="https://registry.npmjs.org/"' > ~/.npmrc | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | ||
env: | ||
NPM_TOKEN: ${{ steps.retrieve-secrets.outputs.npm-api-key }} | ||
|
||
- name: Publish NPM | ||
if: ${{ inputs.release_type != 'Dry Run' }} | ||
run: npm publish --access public --registry=https://registry.npmjs.org/ --userconfig=./.npmrc |
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 |
---|---|---|
|
@@ -13,7 +13,6 @@ on: | |
- Release | ||
- Dry Run | ||
|
||
|
||
jobs: | ||
setup: | ||
name: Setup | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.