2022-05-03 20:01:37 +02:00
|
|
|
---
|
|
|
|
name: Release Desktop
|
2022-11-08 16:02:51 +01:00
|
|
|
run-name: Release Desktop ${{ inputs.release_type }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
release_type:
|
|
|
|
description: 'Release Options'
|
|
|
|
required: true
|
|
|
|
default: 'Initial Release'
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- Initial Release
|
|
|
|
- Redeploy
|
|
|
|
- Dry Run
|
2022-10-11 16:46:36 +02:00
|
|
|
rollout_percentage:
|
|
|
|
description: 'Staged Rollout Percentage'
|
|
|
|
required: true
|
|
|
|
default: '10'
|
|
|
|
type: string
|
2022-07-15 15:29:56 +02:00
|
|
|
snap_publish:
|
2022-10-11 16:46:36 +02:00
|
|
|
description: 'Publish to Snap store'
|
2022-07-15 15:29:56 +02:00
|
|
|
required: true
|
|
|
|
default: true
|
|
|
|
type: boolean
|
|
|
|
choco_publish:
|
2022-10-11 16:46:36 +02:00
|
|
|
description: 'Publish to Chocolatey store'
|
2022-07-15 15:29:56 +02:00
|
|
|
required: true
|
|
|
|
default: true
|
|
|
|
type: boolean
|
2022-11-30 21:51:54 +01:00
|
|
|
electron_publish:
|
2024-02-09 11:30:07 +01:00
|
|
|
description: 'Publish Electron to S3 bucket'
|
2022-11-30 21:51:54 +01:00
|
|
|
required: true
|
|
|
|
default: true
|
|
|
|
type: boolean
|
|
|
|
github_release:
|
2024-02-09 11:30:07 +01:00
|
|
|
description: 'Publish GitHub release'
|
2022-11-30 21:51:54 +01:00
|
|
|
required: true
|
|
|
|
default: true
|
|
|
|
type: boolean
|
2022-07-15 15:29:56 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
setup:
|
|
|
|
name: Setup
|
2023-08-28 21:31:09 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2022-05-03 20:01:37 +02:00
|
|
|
outputs:
|
2022-06-02 20:14:17 +02:00
|
|
|
release-version: ${{ steps.version.outputs.version }}
|
2022-06-07 15:44:25 +02:00
|
|
|
release-channel: ${{ steps.release-channel.outputs.channel }}
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
2022-06-30 19:26:35 +02:00
|
|
|
- name: Checkout repo
|
2024-02-08 20:43:14 +01:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-06-30 19:26:35 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Branch check
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
2022-05-03 20:01:37 +02:00
|
|
|
run: |
|
2022-11-16 16:48:49 +01:00
|
|
|
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix-rc-desktop" ]]; then
|
2022-05-03 20:01:37 +02:00
|
|
|
echo "==================================="
|
2022-08-16 17:55:57 +02:00
|
|
|
echo "[!] Can only release from the 'rc' or 'hotfix-rc-desktop' branches"
|
2022-05-03 20:01:37 +02:00
|
|
|
echo "==================================="
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-06-01 19:03:05 +02:00
|
|
|
- name: Check Release Version
|
|
|
|
id: version
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/release-version-check@main
|
2022-06-01 19:03:05 +02:00
|
|
|
with:
|
2023-08-30 16:46:10 +02:00
|
|
|
release-type: ${{ inputs.release_type }}
|
2022-06-01 19:03:05 +02:00
|
|
|
project-type: ts
|
|
|
|
file: apps/desktop/src/package.json
|
|
|
|
monorepo: true
|
|
|
|
monorepo-project: desktop
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2022-06-07 15:44:25 +02:00
|
|
|
- name: Get Version Channel
|
|
|
|
id: release-channel
|
|
|
|
run: |
|
|
|
|
case "${{ steps.version.outputs.version }}" in
|
|
|
|
*"alpha"*)
|
2022-12-05 16:04:04 +01:00
|
|
|
echo "channel=alpha" >> $GITHUB_OUTPUT
|
2022-06-07 15:44:25 +02:00
|
|
|
echo "[!] We do not yet support 'alpha'"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*"beta"*)
|
2022-12-05 16:04:04 +01:00
|
|
|
echo "channel=beta" >> $GITHUB_OUTPUT
|
2022-06-07 15:44:25 +02:00
|
|
|
;;
|
|
|
|
*)
|
2022-12-05 16:04:04 +01:00
|
|
|
echo "channel=latest" >> $GITHUB_OUTPUT
|
2022-06-07 15:44:25 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2022-07-25 23:20:17 +02:00
|
|
|
- name: Create GitHub deployment
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: chrnorm/deployment-action@55729fcebec3d284f60f5bcabbd8376437d696b1 # v2.0.7
|
2022-07-25 23:20:17 +02:00
|
|
|
id: deployment
|
|
|
|
with:
|
|
|
|
token: '${{ secrets.GITHUB_TOKEN }}'
|
2022-08-08 19:21:49 +02:00
|
|
|
initial-status: 'in_progress'
|
2022-07-25 23:20:17 +02:00
|
|
|
environment: 'Desktop - Production'
|
|
|
|
description: 'Deployment ${{ steps.version.outputs.version }} to channel ${{ steps.release-channel.outputs.channel }} from branch ${{ github.ref_name }}'
|
|
|
|
task: release
|
|
|
|
|
2022-05-24 16:42:17 +02:00
|
|
|
- name: Login to Azure
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2022-05-24 16:42:17 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
2022-05-24 16:42:17 +02:00
|
|
|
|
|
|
|
- name: Retrieve secrets
|
|
|
|
id: retrieve-secrets
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
2022-10-11 16:46:36 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
keyvault: "bitwarden-ci"
|
2022-10-11 16:46:36 +02:00
|
|
|
secrets: "aws-electron-access-id,
|
2022-09-05 11:39:27 +02:00
|
|
|
aws-electron-access-key,
|
2022-10-04 15:38:48 +02:00
|
|
|
aws-electron-bucket-name,
|
|
|
|
r2-electron-access-id,
|
|
|
|
r2-electron-access-key,
|
|
|
|
r2-electron-bucket-name,
|
2022-10-11 16:46:36 +02:00
|
|
|
cf-prod-account"
|
2022-05-24 16:42:17 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Download all artifacts
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-24 16:42:17 +02:00
|
|
|
workflow: build-desktop.yml
|
2022-05-03 20:01:37 +02:00
|
|
|
workflow_conclusion: success
|
2022-06-22 14:32:45 +02:00
|
|
|
branch: ${{ github.ref_name }}
|
2022-06-02 20:02:26 +02:00
|
|
|
path: apps/desktop/artifacts
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2022-11-14 15:35:42 +01:00
|
|
|
- name: Dry Run - Download all artifacts
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type == 'Dry Run' }}
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
2022-07-01 17:44:20 +02:00
|
|
|
with:
|
|
|
|
workflow: build-desktop.yml
|
|
|
|
workflow_conclusion: success
|
2023-12-12 20:57:50 +01:00
|
|
|
branch: main
|
2022-07-01 17:44:20 +02:00
|
|
|
path: apps/desktop/artifacts
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Rename .pkg to .pkg.archive
|
|
|
|
env:
|
2022-06-01 19:03:05 +02:00
|
|
|
PKG_VERSION: ${{ steps.version.outputs.version }}
|
2022-06-02 20:02:26 +02:00
|
|
|
working-directory: apps/desktop/artifacts
|
2022-05-03 20:01:37 +02:00
|
|
|
run: mv Bitwarden-${{ env.PKG_VERSION }}-universal.pkg Bitwarden-${{ env.PKG_VERSION }}-universal.pkg.archive
|
|
|
|
|
2022-10-11 16:46:36 +02:00
|
|
|
- name: Set staged rollout percentage
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.electron_publish == 'true' }}
|
2022-10-11 16:46:36 +02:00
|
|
|
env:
|
|
|
|
RELEASE_CHANNEL: ${{ steps.release-channel.outputs.channel }}
|
2023-08-30 16:46:10 +02:00
|
|
|
ROLLOUT_PCT: ${{ inputs.rollout_percentage }}
|
2022-10-11 16:46:36 +02:00
|
|
|
run: |
|
|
|
|
echo "stagingPercentage: ${ROLLOUT_PCT}" >> apps/desktop/artifacts/${RELEASE_CHANNEL}.yml
|
|
|
|
echo "stagingPercentage: ${ROLLOUT_PCT}" >> apps/desktop/artifacts/${RELEASE_CHANNEL}-linux.yml
|
|
|
|
echo "stagingPercentage: ${ROLLOUT_PCT}" >> apps/desktop/artifacts/${RELEASE_CHANNEL}-mac.yml
|
|
|
|
|
2022-05-24 16:42:17 +02:00
|
|
|
- name: Publish artifacts to S3
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' && github.event.inputs.electron_publish == 'true' }}
|
2022-05-24 16:42:17 +02:00
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ steps.retrieve-secrets.outputs.aws-electron-access-id }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ steps.retrieve-secrets.outputs.aws-electron-access-key }}
|
|
|
|
AWS_DEFAULT_REGION: 'us-west-2'
|
|
|
|
AWS_S3_BUCKET_NAME: ${{ steps.retrieve-secrets.outputs.aws-electron-bucket-name }}
|
2022-06-02 20:02:26 +02:00
|
|
|
working-directory: apps/desktop/artifacts
|
2022-05-24 16:42:17 +02:00
|
|
|
run: |
|
|
|
|
aws s3 cp ./ $AWS_S3_BUCKET_NAME/desktop/ \
|
|
|
|
--acl "public-read" \
|
|
|
|
--recursive \
|
|
|
|
--quiet
|
|
|
|
|
2022-10-04 15:38:48 +02:00
|
|
|
- name: Publish artifacts to R2
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' && github.event.inputs.electron_publish == 'true' }}
|
2022-10-04 15:38:48 +02:00
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ steps.retrieve-secrets.outputs.r2-electron-access-id }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ steps.retrieve-secrets.outputs.r2-electron-access-key }}
|
|
|
|
AWS_DEFAULT_REGION: 'us-east-1'
|
|
|
|
AWS_S3_BUCKET_NAME: ${{ steps.retrieve-secrets.outputs.r2-electron-bucket-name }}
|
|
|
|
CF_ACCOUNT: ${{ steps.retrieve-secrets.outputs.cf-prod-account }}
|
|
|
|
working-directory: apps/desktop/artifacts
|
|
|
|
run: |
|
|
|
|
aws s3 cp ./ $AWS_S3_BUCKET_NAME/desktop/ \
|
|
|
|
--recursive \
|
|
|
|
--quiet \
|
|
|
|
--endpoint-url https://${CF_ACCOUNT}.r2.cloudflarestorage.com
|
|
|
|
|
2023-01-30 17:19:40 +01:00
|
|
|
- name: Get checksum files
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/get-checksum@main
|
2023-01-30 17:19:40 +01:00
|
|
|
with:
|
|
|
|
packages_dir: "apps/desktop/artifacts"
|
|
|
|
file_path: "apps/desktop/artifacts/sha256-checksums.txt"
|
|
|
|
|
2022-10-11 16:46:36 +02:00
|
|
|
- name: Create Release
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ steps.release-channel.outputs.channel == 'latest' && github.event.inputs.release_type != 'Dry Run' && github.event.inputs.github_release == 'true' }}
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
2022-06-01 19:03:05 +02:00
|
|
|
PKG_VERSION: ${{ steps.version.outputs.version }}
|
2022-06-07 15:44:25 +02:00
|
|
|
RELEASE_CHANNEL: ${{ steps.release-channel.outputs.channel }}
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-06-02 20:02:26 +02:00
|
|
|
artifacts: "apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-amd64.deb,
|
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-x86_64.rpm,
|
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-x64.freebsd,
|
|
|
|
apps/desktop/artifacts/bitwarden_${{ env.PKG_VERSION }}_amd64.snap,
|
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-x86_64.AppImage,
|
|
|
|
apps/desktop/artifacts/Bitwarden-Portable-${{ env.PKG_VERSION }}.exe,
|
|
|
|
apps/desktop/artifacts/Bitwarden-Installer-${{ env.PKG_VERSION }}.exe,
|
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-ia32-store.appx,
|
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-ia32.appx,
|
2022-06-08 21:23:28 +02:00
|
|
|
apps/desktop/artifacts/bitwarden-${{ env.PKG_VERSION }}-ia32.nsis.7z,
|
2022-06-02 20:02:26 +02:00
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-x64-store.appx,
|
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-x64.appx,
|
2022-06-08 21:23:28 +02:00
|
|
|
apps/desktop/artifacts/bitwarden-${{ env.PKG_VERSION }}-x64.nsis.7z,
|
2022-06-02 20:02:26 +02:00
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-arm64-store.appx,
|
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-arm64.appx,
|
2022-06-08 21:23:28 +02:00
|
|
|
apps/desktop/artifacts/bitwarden-${{ env.PKG_VERSION }}-arm64.nsis.7z,
|
2022-06-02 20:02:26 +02:00
|
|
|
apps/desktop/artifacts/bitwarden.${{ env.PKG_VERSION }}.nupkg,
|
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-universal-mac.zip,
|
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-universal.dmg,
|
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-universal.dmg.blockmap,
|
2022-06-07 15:44:25 +02:00
|
|
|
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-universal.pkg.archive,
|
|
|
|
apps/desktop/artifacts/${{ env.RELEASE_CHANNEL }}.yml,
|
|
|
|
apps/desktop/artifacts/${{ env.RELEASE_CHANNEL }}-linux.yml,
|
2023-01-30 17:19:40 +01:00
|
|
|
apps/desktop/artifacts/${{ env.RELEASE_CHANNEL }}-mac.yml,
|
|
|
|
apps/desktop/artifacts/sha256-checksums.txt"
|
2022-05-03 20:01:37 +02:00
|
|
|
commit: ${{ github.sha }}
|
|
|
|
tag: desktop-v${{ env.PKG_VERSION }}
|
2022-06-02 20:02:26 +02:00
|
|
|
name: Desktop v${{ env.PKG_VERSION }}
|
2022-05-03 20:01:37 +02:00
|
|
|
body: "<insert release notes here>"
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
draft: true
|
|
|
|
|
2022-07-25 23:20:17 +02:00
|
|
|
- name: Update deployment status to Success
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' && success() }}
|
2024-03-06 19:49:15 +01:00
|
|
|
uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3
|
2022-07-25 23:20:17 +02:00
|
|
|
with:
|
|
|
|
token: '${{ secrets.GITHUB_TOKEN }}'
|
|
|
|
state: 'success'
|
|
|
|
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
|
|
|
|
|
|
|
|
- name: Update deployment status to Failure
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' && failure() }}
|
2024-03-06 19:49:15 +01:00
|
|
|
uses: chrnorm/deployment-status@9a72af4586197112e0491ea843682b5dc280d806 # v2.0.3
|
2022-07-25 23:20:17 +02:00
|
|
|
with:
|
|
|
|
token: '${{ secrets.GITHUB_TOKEN }}'
|
|
|
|
state: 'failure'
|
|
|
|
deployment-id: ${{ steps.deployment.outputs.deployment_id }}
|
2022-06-07 15:44:25 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
snap:
|
|
|
|
name: Deploy Snap
|
2023-08-28 21:31:09 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2022-05-03 20:01:37 +02:00
|
|
|
needs: setup
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.snap_publish == 'true' }}
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
2022-06-01 19:03:05 +02:00
|
|
|
_PKG_VERSION: ${{ needs.setup.outputs.release-version }}
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout Repo
|
2024-02-08 20:43:14 +01:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Login to Azure
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Retrieve secrets
|
|
|
|
id: retrieve-secrets
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
2022-10-11 16:46:36 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
keyvault: "bitwarden-ci"
|
2022-10-11 16:46:36 +02:00
|
|
|
secrets: "snapcraft-store-token"
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Install Snap
|
2023-05-05 22:17:19 +02:00
|
|
|
uses: samuelmeuli/action-snapcraft@d33c176a9b784876d966f80fb1b461808edc0641 # v2.1.1
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Setup
|
|
|
|
run: mkdir dist
|
2022-06-02 20:02:26 +02:00
|
|
|
working-directory: apps/desktop
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Download Snap artifact
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-24 16:42:17 +02:00
|
|
|
workflow: build-desktop.yml
|
2022-05-03 20:01:37 +02:00
|
|
|
workflow_conclusion: success
|
2022-06-22 14:32:45 +02:00
|
|
|
branch: ${{ github.ref_name }}
|
2022-05-03 20:01:37 +02:00
|
|
|
artifacts: bitwarden_${{ env._PKG_VERSION }}_amd64.snap
|
2022-06-02 20:02:26 +02:00
|
|
|
path: apps/desktop/dist
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2022-11-14 15:35:42 +01:00
|
|
|
- name: Dry Run - Download Snap artifact
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type == 'Dry Run' }}
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
2022-07-19 21:01:14 +02:00
|
|
|
with:
|
|
|
|
workflow: build-desktop.yml
|
|
|
|
workflow_conclusion: success
|
2023-12-12 20:57:50 +01:00
|
|
|
branch: main
|
2022-07-19 21:01:14 +02:00
|
|
|
artifacts: bitwarden_${{ env._PKG_VERSION }}_amd64.snap
|
|
|
|
path: apps/desktop/dist
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Deploy to Snap Store
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
2023-05-31 19:19:40 +02:00
|
|
|
env:
|
|
|
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ steps.retrieve-secrets.outputs.snapcraft-store-token }}
|
2022-05-03 20:01:37 +02:00
|
|
|
run: |
|
2023-10-05 21:14:10 +02:00
|
|
|
snapcraft upload bitwarden_${{ env._PKG_VERSION }}_amd64.snap --release stable
|
|
|
|
snapcraft logout
|
2022-06-02 20:02:26 +02:00
|
|
|
working-directory: apps/desktop/dist
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
choco:
|
|
|
|
name: Deploy Choco
|
2024-02-08 21:33:19 +01:00
|
|
|
runs-on: windows-2022
|
2022-05-03 20:01:37 +02:00
|
|
|
needs: setup
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.choco_publish == 'true' }}
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
2022-06-01 19:03:05 +02:00
|
|
|
_PKG_VERSION: ${{ needs.setup.outputs.release-version }}
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout Repo
|
2024-02-08 20:43:14 +01:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2022-07-01 17:44:20 +02:00
|
|
|
- name: Print Environment
|
|
|
|
run: |
|
|
|
|
dotnet --version
|
|
|
|
dotnet nuget --version
|
|
|
|
|
2022-06-30 18:32:03 +02:00
|
|
|
- name: Login to Azure
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2022-06-30 18:32:03 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
2022-06-30 18:32:03 +02:00
|
|
|
|
|
|
|
- name: Retrieve secrets
|
|
|
|
id: retrieve-secrets
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
2022-10-11 16:46:36 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
keyvault: "bitwarden-ci"
|
2022-10-11 16:46:36 +02:00
|
|
|
secrets: "cli-choco-api-key"
|
2022-06-30 18:32:03 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Setup Chocolatey
|
2022-07-01 17:44:20 +02:00
|
|
|
shell: pwsh
|
2022-05-03 20:01:37 +02:00
|
|
|
run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/
|
|
|
|
env:
|
2022-06-30 18:32:03 +02:00
|
|
|
CHOCO_API_KEY: ${{ steps.retrieve-secrets.outputs.cli-choco-api-key }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Make dist dir
|
|
|
|
shell: pwsh
|
|
|
|
run: New-Item -ItemType directory -Path ./dist
|
2022-06-02 20:02:26 +02:00
|
|
|
working-directory: apps/desktop
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Download choco artifact
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-24 16:42:17 +02:00
|
|
|
workflow: build-desktop.yml
|
2022-05-03 20:01:37 +02:00
|
|
|
workflow_conclusion: success
|
2022-06-22 14:32:45 +02:00
|
|
|
branch: ${{ github.ref_name }}
|
2022-05-03 20:01:37 +02:00
|
|
|
artifacts: bitwarden.${{ env._PKG_VERSION }}.nupkg
|
2022-06-02 20:02:26 +02:00
|
|
|
path: apps/desktop/dist
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2022-11-14 15:35:42 +01:00
|
|
|
- name: Dry Run - Download choco artifact
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type == 'Dry Run' }}
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
2022-07-19 21:01:14 +02:00
|
|
|
with:
|
|
|
|
workflow: build-desktop.yml
|
|
|
|
workflow_conclusion: success
|
2023-12-12 20:57:50 +01:00
|
|
|
branch: main
|
2022-07-19 21:01:14 +02:00
|
|
|
artifacts: bitwarden.${{ env._PKG_VERSION }}.nupkg
|
|
|
|
path: apps/desktop/dist
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Push to Chocolatey
|
2023-09-20 20:34:21 +02:00
|
|
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
2022-05-03 20:01:37 +02:00
|
|
|
shell: pwsh
|
2023-06-22 15:57:15 +02:00
|
|
|
run: choco push --source=https://push.chocolatey.org/
|
2022-06-02 20:02:26 +02:00
|
|
|
working-directory: apps/desktop/dist
|