Release @bitwarden/sdk-napi Initial Release #17
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
--- | |
name: Release @bitwarden/sdk-napi | |
run-name: Release @bitwarden/sdk-napi ${{ inputs.release_type }} | |
on: | |
workflow_dispatch: | |
inputs: | |
release_type: | |
description: "Release Options" | |
required: true | |
default: "Initial Release" | |
type: choice | |
options: | |
- Initial Release | |
- Redeploy | |
- Dry Run | |
npm_publish: | |
description: "Publish to NPM registry" | |
required: true | |
default: true | |
type: boolean | |
defaults: | |
run: | |
shell: bash | |
working-directory: crates/bitwarden-napi | |
jobs: | |
setup: | |
name: Setup | |
runs-on: ubuntu-22.04 | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- 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 | |
- name: Check Release Version | |
id: version | |
uses: bitwarden/gh-actions/release-version-check@main | |
with: | |
release-type: ${{ inputs.release_type }} | |
project-type: ts | |
file: crates/bitwarden-napi/package.json | |
monorepo: false | |
release: | |
name: Create GitHub release | |
runs-on: ubuntu-22.04 | |
needs: setup | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
- name: Download artifacts | |
uses: bitwarden/gh-actions/download-artifacts@main | |
with: | |
workflow: build-napi.yml | |
workflow_conclusion: success | |
branch: main | |
artifacts: | | |
sdk-bitwarden-napi-aarch64-apple-darwin | |
sdk-bitwarden-napi-x86_64-apple-darwin | |
sdk-bitwarden-napi-x86_64-pc-windows-msvc | |
sdk-bitwarden-napi-x86_64-unknown-linux-gnu | |
schemas.ts | |
- name: Create release | |
if: ${{ inputs.release_type != 'Dry Run' }} | |
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 | |
env: | |
_VERSION: ${{ needs.setup.outputs.version }} | |
with: | |
commit: ${{ github.sha }} | |
tag: napi-v${{ env._VERSION }} | |
name: napi v${{ env._VERSION }} | |
body: "<insert release notes here>" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: true | |
artifacts: | | |
sdk-napi.darwin-arm64.node | |
sdk-napi.darwin-x64.node | |
sdk-napi.win32-x64-msvc.node | |
sdk-napi.linux-x64-gnu.node | |
schemas.ts |