mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-05 23:53:21 +00:00
99 lines
3.3 KiB
YAML
99 lines
3.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
release_type:
|
|
description: 'Release Options'
|
|
required: true
|
|
default: 'Initial Release'
|
|
type: choice
|
|
options:
|
|
- Initial Release
|
|
- Redeploy
|
|
- Dry Run
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
setup:
|
|
name: Setup
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
release_version: ${{ steps.version.outputs.version }}
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
- 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: Check Release Version
|
|
id: version
|
|
uses: bitwarden/gh-actions/release-version-check@main
|
|
with:
|
|
release-type: ${{ inputs.release_type }}
|
|
project-type: ts
|
|
file: package.json
|
|
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-24.04
|
|
needs: setup
|
|
permissions:
|
|
actions: read
|
|
packages: read
|
|
contents: write
|
|
steps:
|
|
- name: Download all artifacts
|
|
if: ${{ inputs.release_type != 'Dry Run' }}
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
|
with:
|
|
workflow: build.yml
|
|
workflow_conclusion: success
|
|
branch: ${{ github.ref_name }}
|
|
|
|
- name: Dry Run - Download all artifacts
|
|
if: ${{ inputs.release_type == 'Dry Run' }}
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
|
with:
|
|
workflow: build.yml
|
|
workflow_conclusion: success
|
|
branch: main
|
|
|
|
- name: Create release
|
|
if: ${{ inputs.release_type != 'Dry Run' }}
|
|
uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # v1.15.0
|
|
env:
|
|
PKG_VERSION: ${{ needs.setup.outputs.release_version }}
|
|
with:
|
|
artifacts: "./bwdc-windows-${{ env.PKG_VERSION }}.zip,
|
|
./bwdc-macos-${{ env.PKG_VERSION }}.zip,
|
|
./bwdc-linux-${{ env.PKG_VERSION }}.zip,
|
|
./Bitwarden-Connector-Portable-${{ env.PKG_VERSION }}.exe,
|
|
./Bitwarden-Connector-Installer-${{ env.PKG_VERSION }}.exe,
|
|
./Bitwarden-Connector-Installer-${{ env.PKG_VERSION }}.exe.blockmap,
|
|
./Bitwarden-Connector-${{ env.PKG_VERSION }}-x86_64.AppImage,
|
|
./Bitwarden-Connector-${{ env.PKG_VERSION }}-mac.zip,
|
|
./Bitwarden-Connector-${{ env.PKG_VERSION }}.dmg,
|
|
./Bitwarden-Connector-${{ env.PKG_VERSION }}.dmg.blockmap,
|
|
./latest-linux.yml,
|
|
./latest-mac.yml,
|
|
./latest.yml"
|
|
commit: ${{ github.sha }}
|
|
tag: v${{ env.PKG_VERSION }}
|
|
name: Version ${{ env.PKG_VERSION }}
|
|
body: "<insert release notes here>"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
draft: true
|