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:
|
2024-08-09 00:55:13 +02:00
|
|
|
description: 'Release Type'
|
2022-05-03 20:01:37 +02:00
|
|
|
required: true
|
2024-08-09 00:55:13 +02:00
|
|
|
default: 'Release'
|
2022-05-03 20:01:37 +02:00
|
|
|
type: choice
|
|
|
|
options:
|
2024-08-09 00:55:13 +02:00
|
|
|
- Release
|
2022-05-03 20:01:37 +02:00
|
|
|
- Dry Run
|
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-10-17 16:45:49 +02:00
|
|
|
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.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-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
|
|
|
|
|
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
|
2024-08-22 16:54:23 +02:00
|
|
|
if: ${{ steps.release-channel.outputs.channel == 'latest' && github.event.inputs.release_type != 'Dry Run' }}
|
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
|