2022-05-03 20:01:37 +02:00
|
|
|
name: Build Desktop
|
|
|
|
|
|
|
|
on:
|
2024-11-07 19:01:54 +01:00
|
|
|
pull_request_target:
|
|
|
|
types: [opened, synchronize]
|
2022-05-24 16:26:09 +02:00
|
|
|
branches-ignore:
|
|
|
|
- 'l10n_master'
|
2022-06-20 21:16:51 +02:00
|
|
|
- 'cf-pages'
|
2022-05-24 16:26:09 +02:00
|
|
|
paths:
|
|
|
|
- 'apps/desktop/**'
|
2022-11-01 00:24:02 +01:00
|
|
|
- 'libs/**'
|
2022-06-13 09:59:15 +02:00
|
|
|
- '*'
|
|
|
|
- '!*.md'
|
|
|
|
- '!*.txt'
|
2022-05-24 16:26:09 +02:00
|
|
|
- '.github/workflows/build-desktop.yml'
|
2022-05-03 20:01:37 +02:00
|
|
|
push:
|
2022-05-25 15:17:52 +02:00
|
|
|
branches:
|
2023-12-12 20:57:50 +01:00
|
|
|
- 'main'
|
2022-05-25 15:17:52 +02:00
|
|
|
- 'rc'
|
2022-08-16 17:55:57 +02:00
|
|
|
- 'hotfix-rc-desktop'
|
2022-05-03 20:01:37 +02:00
|
|
|
paths:
|
2022-05-03 21:45:37 +02:00
|
|
|
- 'apps/desktop/**'
|
2022-06-08 19:53:35 +02:00
|
|
|
- 'libs/**'
|
2022-06-13 09:59:15 +02:00
|
|
|
- '*'
|
|
|
|
- '!*.md'
|
|
|
|
- '!*.txt'
|
2022-05-20 18:39:38 +02:00
|
|
|
- '.github/workflows/build-desktop.yml'
|
2022-05-03 20:01:37 +02:00
|
|
|
workflow_dispatch:
|
2024-11-19 13:59:59 +01:00
|
|
|
inputs:
|
|
|
|
sdk_branch:
|
|
|
|
description: "Custom SDK branch"
|
|
|
|
required: false
|
|
|
|
type: string
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
jobs:
|
2024-11-07 19:01:54 +01:00
|
|
|
check-run:
|
|
|
|
name: Check PR run
|
|
|
|
uses: bitwarden/gh-actions/.github/workflows/check-run.yml@main
|
|
|
|
|
2022-06-02 15:18:29 +02:00
|
|
|
electron-verify:
|
|
|
|
name: Verify Electron Version
|
2024-02-08 21:56:39 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2024-11-11 19:19:33 +01:00
|
|
|
needs:
|
|
|
|
- check-run
|
2022-06-02 15:18:29 +02:00
|
|
|
steps:
|
2024-11-07 19:01:54 +01:00
|
|
|
- name: Check out repo
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-07 19:01:54 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2022-06-02 15:18:29 +02:00
|
|
|
|
|
|
|
- name: Verify
|
|
|
|
run: |
|
|
|
|
PACKAGE_VERSION=$(jq -r .devDependencies.electron package.json)
|
|
|
|
ELECTRON_BUILDER_VERSION=$(jq -r .electronVersion ./apps/desktop/electron-builder.json)
|
|
|
|
|
|
|
|
if [[ "$PACKAGE_VERSION" == "$ELECTRON_BUILDER_VERSION" ]]; then
|
|
|
|
echo "Versions matches"
|
|
|
|
else
|
|
|
|
echo "Version missmatch, package.json: $PACKAGE_VERSION, electron-builder.json: $ELECTRON_BUILDER_VERSION"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
setup:
|
|
|
|
name: Setup
|
2024-02-08 21:56:39 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2024-11-11 19:19:33 +01:00
|
|
|
needs:
|
|
|
|
- check-run
|
2022-05-03 20:01:37 +02:00
|
|
|
outputs:
|
|
|
|
package_version: ${{ steps.retrieve-version.outputs.package_version }}
|
2022-06-07 15:44:25 +02:00
|
|
|
release_channel: ${{ steps.release-channel.outputs.channel }}
|
2022-05-03 20:01:37 +02:00
|
|
|
build_number: ${{ steps.increment-version.outputs.build_number }}
|
|
|
|
rc_branch_exists: ${{ steps.branch-check.outputs.rc_branch_exists }}
|
|
|
|
hotfix_branch_exists: ${{ steps.branch-check.outputs.hotfix_branch_exists }}
|
2023-10-04 18:23:40 +02:00
|
|
|
node_version: ${{ steps.retrieve-node-version.outputs.node_version }}
|
2022-05-09 17:22:14 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: apps/desktop
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
2024-11-07 19:01:54 +01:00
|
|
|
- name: Check out repo
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-07 19:01:54 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Get Package Version
|
|
|
|
id: retrieve-version
|
|
|
|
run: |
|
|
|
|
PKG_VERSION=$(jq -r .version src/package.json)
|
2022-12-05 16:04:04 +01:00
|
|
|
echo "package_version=$PKG_VERSION" >> $GITHUB_OUTPUT
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Increment Version
|
|
|
|
id: increment-version
|
|
|
|
run: |
|
2022-05-05 22:56:45 +02:00
|
|
|
BUILD_NUMBER=$(expr 3000 + $GITHUB_RUN_NUMBER)
|
2022-05-03 20:01:37 +02:00
|
|
|
echo "Setting build number to $BUILD_NUMBER"
|
2022-12-05 16:04:04 +01:00
|
|
|
echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT
|
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.retrieve-version.outputs.package_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: Check if special branches exist
|
|
|
|
id: branch-check
|
|
|
|
run: |
|
|
|
|
if [[ $(git ls-remote --heads origin rc) ]]; then
|
2022-12-05 16:04:04 +01:00
|
|
|
echo "rc_branch_exists=1" >> $GITHUB_OUTPUT
|
2022-05-03 20:01:37 +02:00
|
|
|
else
|
2022-12-05 16:04:04 +01:00
|
|
|
echo "rc_branch_exists=0" >> $GITHUB_OUTPUT
|
2022-05-03 20:01:37 +02:00
|
|
|
fi
|
|
|
|
|
2022-08-16 17:55:57 +02:00
|
|
|
if [[ $(git ls-remote --heads origin hotfix-rc-desktop) ]]; then
|
2022-12-05 16:04:04 +01:00
|
|
|
echo "hotfix_branch_exists=1" >> $GITHUB_OUTPUT
|
2022-05-03 20:01:37 +02:00
|
|
|
else
|
2022-12-05 16:04:04 +01:00
|
|
|
echo "hotfix_branch_exists=0" >> $GITHUB_OUTPUT
|
2022-05-03 20:01:37 +02:00
|
|
|
fi
|
|
|
|
|
2023-10-04 18:23:40 +02:00
|
|
|
- name: Get Node Version
|
|
|
|
id: retrieve-node-version
|
|
|
|
working-directory: ./
|
|
|
|
run: |
|
|
|
|
NODE_NVMRC=$(cat .nvmrc)
|
|
|
|
NODE_VERSION=${NODE_NVMRC/v/''}
|
|
|
|
echo "node_version=$NODE_VERSION" >> $GITHUB_OUTPUT
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
linux:
|
|
|
|
name: Linux Build
|
2024-03-06 19:10:56 +01:00
|
|
|
# Note, before updating the ubuntu version of the workflow, ensure the snap base image
|
|
|
|
# is equal or greater than the new version. Otherwise there might be GLIBC version issues.
|
|
|
|
# The snap base for desktop is defined in `apps/desktop/electron-builder.json`
|
2024-03-11 17:40:14 +01:00
|
|
|
# We are currently running on 20.04 until the Ubuntu 24.04 release is available, as moving
|
|
|
|
# to 22.04 now breaks users who are on 20.04 due to mismatched GLIBC versions.
|
|
|
|
runs-on: ubuntu-20.04
|
2024-02-09 11:30:28 +01:00
|
|
|
needs: setup
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
|
|
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
2023-10-04 18:23:40 +02:00
|
|
|
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
|
2023-12-21 11:14:13 +01:00
|
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
2022-05-09 17:22:14 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: apps/desktop
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
2024-11-07 19:01:54 +01:00
|
|
|
- name: Check out repo
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-07 19:01:54 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up Node
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
cache: 'npm'
|
2022-06-02 15:18:29 +02:00
|
|
|
cache-dependency-path: '**/package-lock.json'
|
2023-10-04 18:23:40 +02:00
|
|
|
node-version: ${{ env._NODE_VERSION }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up environment
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2024-11-13 17:41:47 +01:00
|
|
|
sudo apt-get -y install pkg-config libxss-dev libsecret-1-dev rpm musl-dev musl-tools flatpak flatpak-builder
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up Snap
|
|
|
|
run: sudo snap install snapcraft --classic
|
|
|
|
|
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
node --version
|
|
|
|
npm --version
|
|
|
|
snap --version
|
|
|
|
snapcraft --version || echo 'snapcraft unavailable'
|
|
|
|
|
|
|
|
- name: Install Node dependencies
|
|
|
|
run: npm ci
|
2022-06-02 15:18:29 +02:00
|
|
|
working-directory: ./
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-11-19 13:59:59 +01:00
|
|
|
- name: Download SDK Artifacts
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
workflow: build-wasm-internal.yml
|
|
|
|
workflow_conclusion: success
|
|
|
|
branch: ${{ inputs.sdk_branch }}
|
|
|
|
artifacts: sdk-internal
|
|
|
|
repo: bitwarden/sdk-internal
|
|
|
|
path: ../sdk-internal
|
|
|
|
if_no_artifact_found: fail
|
|
|
|
|
|
|
|
- name: Override SDK
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
working-directory: ./
|
|
|
|
run: |
|
|
|
|
ls -l ../
|
|
|
|
npm link ../sdk-internal
|
|
|
|
|
2022-07-25 13:24:13 +02:00
|
|
|
- name: Cache Native Module
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-07-25 13:24:13 +02:00
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: |
|
2024-07-01 15:19:29 +02:00
|
|
|
apps/desktop/desktop_native/napi/*.node
|
2024-10-01 16:28:56 +02:00
|
|
|
apps/desktop/desktop_native/dist/*
|
2022-07-25 13:24:13 +02:00
|
|
|
${{ env.RUNNER_TEMP }}/.cargo/registry
|
|
|
|
${{ env.RUNNER_TEMP }}/.cargo/git
|
|
|
|
key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }}
|
|
|
|
|
|
|
|
- name: Build Native Module
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
2024-10-01 16:28:56 +02:00
|
|
|
working-directory: apps/desktop/desktop_native
|
2022-07-25 13:24:13 +02:00
|
|
|
env:
|
|
|
|
PKG_CONFIG_ALLOW_CROSS: true
|
|
|
|
PKG_CONFIG_ALL_STATIC: true
|
|
|
|
TARGET: musl
|
|
|
|
run: |
|
|
|
|
rustup target add x86_64-unknown-linux-musl
|
2024-10-01 16:28:56 +02:00
|
|
|
node build.js cross-platform
|
2022-07-25 13:24:13 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Build application
|
|
|
|
run: npm run dist:lin
|
|
|
|
|
|
|
|
- name: Upload .deb artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-amd64.deb
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-amd64.deb
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload .rpm artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-x86_64.rpm
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-x86_64.rpm
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload .freebsd artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-x64.freebsd
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-x64.freebsd
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload .snap artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: bitwarden_${{ env._PACKAGE_VERSION }}_amd64.snap
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/bitwarden_${{ env._PACKAGE_VERSION }}_amd64.snap
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload .AppImage artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
2022-06-07 15:44:25 +02:00
|
|
|
- name: Upload auto-update artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-06-07 15:44:25 +02:00
|
|
|
name: ${{ needs.setup.outputs.release_channel }}-linux.yml
|
|
|
|
path: apps/desktop/dist/${{ needs.setup.outputs.release_channel }}-linux.yml
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
2024-11-13 17:41:47 +01:00
|
|
|
|
|
|
|
- name: Build flatpak
|
|
|
|
working-directory: apps/desktop
|
|
|
|
run: |
|
|
|
|
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
|
|
sudo npm run pack:lin:flatpak
|
|
|
|
|
|
|
|
- name: Upload flatpak artifact
|
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
|
|
|
with:
|
|
|
|
name: com.bitwarden.desktop.flatpak
|
|
|
|
path: apps/desktop/dist/com.bitwarden.desktop.flatpak
|
|
|
|
if-no-files-found: error
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
windows:
|
|
|
|
name: Windows Build
|
2024-02-08 21:33:19 +01:00
|
|
|
runs-on: windows-2022
|
2024-11-07 19:01:54 +01:00
|
|
|
needs:
|
|
|
|
- setup
|
2022-05-03 20:01:37 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: pwsh
|
2022-05-05 22:20:16 +02:00
|
|
|
working-directory: apps/desktop
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
|
|
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
2023-10-04 18:23:40 +02:00
|
|
|
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
|
2023-12-21 11:14:13 +01:00
|
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
2024-11-07 19:01:54 +01:00
|
|
|
- name: Check out repo
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-07 19:01:54 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up Node
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
cache: 'npm'
|
2022-06-02 15:18:29 +02:00
|
|
|
cache-dependency-path: '**/package-lock.json'
|
2023-10-04 18:23:40 +02:00
|
|
|
node-version: ${{ env._NODE_VERSION }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Install AST
|
2023-11-21 23:21:56 +01:00
|
|
|
run: dotnet tool install --global AzureSignTool --version 4.0.1
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2022-10-19 17:22:57 +02:00
|
|
|
- name: Set up environmentF
|
2022-05-03 20:01:37 +02:00
|
|
|
run: choco install checksum --no-progress
|
|
|
|
|
2022-07-25 13:24:13 +02:00
|
|
|
- name: Rust
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
|
|
|
rustup target install i686-pc-windows-msvc
|
|
|
|
rustup target install aarch64-pc-windows-msvc
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
node --version
|
|
|
|
npm --version
|
|
|
|
choco --version
|
2022-07-25 13:24:13 +02:00
|
|
|
rustup show
|
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-13 21:38:47 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
keyvault: "bitwarden-ci"
|
2022-10-13 21:38:47 +02:00
|
|
|
secrets: "code-signing-vault-url,
|
2022-09-05 11:39:27 +02:00
|
|
|
code-signing-client-id,
|
|
|
|
code-signing-tenant-id,
|
|
|
|
code-signing-client-secret,
|
2022-10-13 21:38:47 +02:00
|
|
|
code-signing-cert-name"
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Install Node dependencies
|
|
|
|
run: npm ci
|
2022-06-02 15:18:29 +02:00
|
|
|
working-directory: ./
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-11-19 13:59:59 +01:00
|
|
|
- name: Download SDK Artifacts
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
workflow: build-wasm-internal.yml
|
|
|
|
workflow_conclusion: success
|
|
|
|
branch: ${{ inputs.sdk_branch }}
|
|
|
|
artifacts: sdk-internal
|
|
|
|
repo: bitwarden/sdk-internal
|
|
|
|
path: ../sdk-internal
|
|
|
|
if_no_artifact_found: fail
|
|
|
|
|
|
|
|
- name: Override SDK
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
working-directory: ./
|
|
|
|
run: |
|
|
|
|
ls -l ../
|
|
|
|
npm link ../sdk-internal
|
|
|
|
|
2022-07-25 13:24:13 +02:00
|
|
|
- name: Cache Native Module
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-07-25 13:24:13 +02:00
|
|
|
id: cache
|
|
|
|
with:
|
2024-10-01 16:28:56 +02:00
|
|
|
path: |
|
|
|
|
apps/desktop/desktop_native/napi/*.node
|
|
|
|
apps/desktop/desktop_native/dist/*
|
2022-07-25 13:24:13 +02:00
|
|
|
key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }}
|
|
|
|
|
|
|
|
- name: Build Native Module
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
2024-10-01 16:28:56 +02:00
|
|
|
working-directory: apps/desktop/desktop_native
|
|
|
|
run: node build.js cross-platform
|
2022-07-25 13:24:13 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Build & Sign (dev)
|
|
|
|
env:
|
|
|
|
ELECTRON_BUILDER_SIGN: 1
|
|
|
|
SIGNING_VAULT_URL: ${{ steps.retrieve-secrets.outputs.code-signing-vault-url }}
|
|
|
|
SIGNING_CLIENT_ID: ${{ steps.retrieve-secrets.outputs.code-signing-client-id }}
|
|
|
|
SIGNING_TENANT_ID: ${{ steps.retrieve-secrets.outputs.code-signing-tenant-id }}
|
|
|
|
SIGNING_CLIENT_SECRET: ${{ steps.retrieve-secrets.outputs.code-signing-client-secret }}
|
|
|
|
SIGNING_CERT_NAME: ${{ steps.retrieve-secrets.outputs.code-signing-cert-name }}
|
|
|
|
run: |
|
|
|
|
npm run build
|
|
|
|
npm run pack:win
|
|
|
|
|
|
|
|
- name: Rename appx files for store
|
|
|
|
run: |
|
|
|
|
Copy-Item "./dist/Bitwarden-${{ env._PACKAGE_VERSION }}-ia32.appx" `
|
|
|
|
-Destination "./dist/Bitwarden-${{ env._PACKAGE_VERSION }}-ia32-store.appx"
|
|
|
|
Copy-Item "./dist/Bitwarden-${{ env._PACKAGE_VERSION }}-x64.appx" `
|
|
|
|
-Destination "./dist/Bitwarden-${{ env._PACKAGE_VERSION }}-x64-store.appx"
|
|
|
|
Copy-Item "./dist/Bitwarden-${{ env._PACKAGE_VERSION }}-arm64.appx" `
|
|
|
|
-Destination "./dist/Bitwarden-${{ env._PACKAGE_VERSION }}-arm64-store.appx"
|
|
|
|
|
|
|
|
- name: Package for Chocolatey
|
|
|
|
run: |
|
|
|
|
Copy-Item -Path ./stores/chocolatey -Destination ./dist/chocolatey -Recurse
|
|
|
|
Copy-Item -Path ./dist/nsis-web/Bitwarden-Installer-${{ env._PACKAGE_VERSION }}.exe `
|
|
|
|
-Destination ./dist/chocolatey
|
|
|
|
|
|
|
|
$checksum = checksum -t sha256 ./dist/chocolatey/Bitwarden-Installer-${{ env._PACKAGE_VERSION }}.exe
|
|
|
|
$chocoInstall = "./dist/chocolatey/tools/chocolateyinstall.ps1"
|
|
|
|
(Get-Content $chocoInstall).replace('__version__', "$env:_PACKAGE_VERSION").replace('__checksum__', $checksum) | Set-Content $chocoInstall
|
|
|
|
choco pack ./dist/chocolatey/bitwarden.nuspec --version "$env:_PACKAGE_VERSION" --out ./dist/chocolatey
|
|
|
|
|
2022-06-08 21:23:28 +02:00
|
|
|
- name: Fix NSIS artifact names for auto-updater
|
|
|
|
run: |
|
|
|
|
Rename-Item -Path .\dist\nsis-web\Bitwarden-${{ env._PACKAGE_VERSION }}-ia32.nsis.7z `
|
|
|
|
-NewName bitwarden-${{ env._PACKAGE_VERSION }}-ia32.nsis.7z
|
|
|
|
Rename-Item -Path .\dist\nsis-web\Bitwarden-${{ env._PACKAGE_VERSION }}-x64.nsis.7z `
|
|
|
|
-NewName bitwarden-${{ env._PACKAGE_VERSION }}-x64.nsis.7z
|
|
|
|
Rename-Item -Path .\dist\nsis-web\Bitwarden-${{ env._PACKAGE_VERSION }}-arm64.nsis.7z `
|
|
|
|
-NewName bitwarden-${{ env._PACKAGE_VERSION }}-arm64.nsis.7z
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Upload portable exe artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-Portable-${{ env._PACKAGE_VERSION }}.exe
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-Portable-${{ env._PACKAGE_VERSION }}.exe
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload installer exe artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-Installer-${{ env._PACKAGE_VERSION }}.exe
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/nsis-web/Bitwarden-Installer-${{ env._PACKAGE_VERSION }}.exe
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload appx ia32 artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-ia32.appx
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-ia32.appx
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload store appx ia32 artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-ia32-store.appx
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-ia32-store.appx
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload NSIS ia32 artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-06-08 21:23:28 +02:00
|
|
|
name: bitwarden-${{ env._PACKAGE_VERSION }}-ia32.nsis.7z
|
|
|
|
path: apps/desktop/dist/nsis-web/bitwarden-${{ env._PACKAGE_VERSION }}-ia32.nsis.7z
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload appx x64 artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-x64.appx
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-x64.appx
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload store appx x64 artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-x64-store.appx
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-x64-store.appx
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload NSIS x64 artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-06-08 21:23:28 +02:00
|
|
|
name: bitwarden-${{ env._PACKAGE_VERSION }}-x64.nsis.7z
|
|
|
|
path: apps/desktop/dist/nsis-web/bitwarden-${{ env._PACKAGE_VERSION }}-x64.nsis.7z
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload appx ARM64 artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-arm64.appx
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-arm64.appx
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload store appx ARM64 artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-arm64-store.appx
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-arm64-store.appx
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload NSIS ARM64 artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-06-08 21:23:28 +02:00
|
|
|
name: bitwarden-${{ env._PACKAGE_VERSION }}-arm64.nsis.7z
|
|
|
|
path: apps/desktop/dist/nsis-web/bitwarden-${{ env._PACKAGE_VERSION }}-arm64.nsis.7z
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload nupkg artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: bitwarden.${{ env._PACKAGE_VERSION }}.nupkg
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/chocolatey/bitwarden.${{ env._PACKAGE_VERSION }}.nupkg
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
2022-06-07 15:44:25 +02:00
|
|
|
- name: Upload auto-update artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-06-07 15:44:25 +02:00
|
|
|
name: ${{ needs.setup.outputs.release_channel }}.yml
|
|
|
|
path: apps/desktop/dist/nsis-web/${{ needs.setup.outputs.release_channel }}.yml
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
|
|
|
|
macos-build:
|
|
|
|
name: MacOS Build
|
2024-05-31 21:58:10 +02:00
|
|
|
runs-on: macos-13
|
2024-11-07 19:01:54 +01:00
|
|
|
needs:
|
|
|
|
- setup
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
|
|
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
2023-10-04 18:23:40 +02:00
|
|
|
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
|
2023-12-21 11:14:13 +01:00
|
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
2022-05-09 17:22:14 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: apps/desktop
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
2024-11-07 19:01:54 +01:00
|
|
|
- name: Check out repo
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-07 19:01:54 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up Node
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
cache: 'npm'
|
2022-06-02 15:18:29 +02:00
|
|
|
cache-dependency-path: '**/package-lock.json'
|
2023-10-04 18:23:40 +02:00
|
|
|
node-version: ${{ env._NODE_VERSION }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-06-26 16:46:41 +02:00
|
|
|
- name: Set up Node-gyp
|
|
|
|
run: python3 -m pip install setuptools
|
|
|
|
|
2022-07-25 13:24:13 +02:00
|
|
|
- name: Rust
|
|
|
|
shell: pwsh
|
|
|
|
run: rustup target install aarch64-apple-darwin
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
node --version
|
|
|
|
npm --version
|
2022-07-25 13:24:13 +02:00
|
|
|
rustup show
|
2022-05-03 20:01:37 +02:00
|
|
|
echo "GitHub ref: $GITHUB_REF"
|
|
|
|
echo "GitHub event: $GITHUB_EVENT"
|
|
|
|
|
|
|
|
- name: Cache Build
|
|
|
|
id: build-cache
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/build
|
2022-05-03 20:01:37 +02:00
|
|
|
key: ${{ runner.os }}-${{ github.run_id }}-build
|
|
|
|
|
|
|
|
- name: Cache Safari
|
|
|
|
id: safari-cache
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/browser/dist/Safari
|
2022-05-03 20:01:37 +02:00
|
|
|
key: ${{ runner.os }}-${{ github.run_id }}-safari-extension
|
|
|
|
|
2024-02-28 19:06:50 +01:00
|
|
|
- name: Login to Azure
|
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
|
|
|
|
|
|
|
- name: Download Provisioning Profiles secrets
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
2024-02-28 19:06:50 +01:00
|
|
|
ACCOUNT_NAME: bitwardenci
|
|
|
|
CONTAINER_NAME: profiles
|
2022-05-03 20:01:37 +02:00
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/secrets
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \
|
|
|
|
--name bitwarden_desktop_appstore.provisionprofile \
|
|
|
|
--file $HOME/secrets/bitwarden_desktop_appstore.provisionprofile \
|
|
|
|
--output none
|
|
|
|
|
|
|
|
- name: Get certificates
|
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/certificates
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/bitwarden-desktop-key |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/bitwarden-desktop-key.p12
|
2024-03-06 14:59:18 +01:00
|
|
|
|
2024-02-28 19:06:50 +01:00
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/appstore-app-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/appstore-app-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/appstore-installer-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/appstore-installer-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/devid-app-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/devid-app-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/devid-installer-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/devid-installer-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/macdev-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/macdev-cert.p12
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up keychain
|
|
|
|
env:
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
security create-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security default-keychain -s build.keychain
|
|
|
|
security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security set-keychain-settings -lut 1200 build.keychain
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/bitwarden-desktop-key.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/devid-app-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/devid-installer-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/appstore-app-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/appstore-installer-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/macdev-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
|
|
|
|
- name: Set up provisioning profiles
|
|
|
|
run: |
|
|
|
|
cp $HOME/secrets/bitwarden_desktop_appstore.provisionprofile \
|
2022-05-06 18:20:10 +02:00
|
|
|
$GITHUB_WORKSPACE/apps/desktop/bitwarden_desktop_appstore.provisionprofile
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Increment version
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
BUILD_NUMBER: ${{ needs.setup.outputs.build_number }}
|
|
|
|
run: |
|
2022-05-05 22:20:16 +02:00
|
|
|
$package = Get-Content -Raw -Path electron-builder.json | ConvertFrom-Json
|
|
|
|
$package | Add-Member -MemberType NoteProperty -Name buildVersion -Value "$env:BUILD_NUMBER"
|
|
|
|
$package | ConvertTo-Json -Depth 32 | Set-Content -Path electron-builder.json
|
2024-02-09 11:30:28 +01:00
|
|
|
"### MacOS build number: $env:BUILD_NUMBER" | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Install Node dependencies
|
|
|
|
run: npm ci
|
2022-06-02 15:18:29 +02:00
|
|
|
working-directory: ./
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-11-19 13:59:59 +01:00
|
|
|
- name: Download SDK Artifacts
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
workflow: build-wasm-internal.yml
|
|
|
|
workflow_conclusion: success
|
|
|
|
branch: ${{ inputs.sdk_branch }}
|
|
|
|
artifacts: sdk-internal
|
|
|
|
repo: bitwarden/sdk-internal
|
|
|
|
path: ../sdk-internal
|
|
|
|
if_no_artifact_found: fail
|
|
|
|
|
|
|
|
- name: Override SDK
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
working-directory: ./
|
|
|
|
run: |
|
|
|
|
ls -l ../
|
|
|
|
npm link ../sdk-internal
|
|
|
|
|
2022-07-25 13:24:13 +02:00
|
|
|
- name: Cache Native Module
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-07-25 13:24:13 +02:00
|
|
|
id: cache
|
|
|
|
with:
|
2024-10-01 16:28:56 +02:00
|
|
|
path: |
|
|
|
|
apps/desktop/desktop_native/napi/*.node
|
|
|
|
apps/desktop/desktop_native/dist/*
|
2022-07-25 13:24:13 +02:00
|
|
|
key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }}
|
|
|
|
|
|
|
|
- name: Build Native Module
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
2024-10-01 16:28:56 +02:00
|
|
|
working-directory: apps/desktop/desktop_native
|
|
|
|
run: node build.js cross-platform
|
2022-07-25 13:24:13 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Build application (dev)
|
|
|
|
run: npm run build
|
|
|
|
|
|
|
|
|
2022-10-19 17:22:57 +02:00
|
|
|
browser-build:
|
|
|
|
name: Browser Build
|
|
|
|
needs: setup
|
|
|
|
uses: ./.github/workflows/build-browser.yml
|
|
|
|
secrets: inherit
|
|
|
|
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
macos-package-github:
|
|
|
|
name: MacOS Package GitHub Release Assets
|
2024-05-31 21:58:10 +02:00
|
|
|
runs-on: macos-13
|
2022-05-03 20:01:37 +02:00
|
|
|
needs:
|
2022-10-19 17:22:57 +02:00
|
|
|
- browser-build
|
2022-05-03 20:01:37 +02:00
|
|
|
- macos-build
|
2022-10-19 17:22:57 +02:00
|
|
|
- setup
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
|
|
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
2023-10-04 18:23:40 +02:00
|
|
|
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
|
2023-12-21 11:14:13 +01:00
|
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
2022-05-09 17:22:14 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: apps/desktop
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
2024-11-07 19:01:54 +01:00
|
|
|
- name: Check out repo
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-07 19:01:54 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up Node
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
cache: 'npm'
|
2022-06-02 15:18:29 +02:00
|
|
|
cache-dependency-path: '**/package-lock.json'
|
2023-10-04 18:23:40 +02:00
|
|
|
node-version: ${{ env._NODE_VERSION }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-06-26 16:46:41 +02:00
|
|
|
- name: Set up Node-gyp
|
|
|
|
run: python3 -m pip install setuptools
|
|
|
|
|
2022-07-25 13:24:13 +02:00
|
|
|
- name: Rust
|
|
|
|
shell: pwsh
|
|
|
|
run: rustup target install aarch64-apple-darwin
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
node --version
|
|
|
|
npm --version
|
2022-07-25 13:24:13 +02:00
|
|
|
rustup show
|
2022-05-03 20:01:37 +02:00
|
|
|
echo "GitHub ref: $GITHUB_REF"
|
|
|
|
echo "GitHub event: $GITHUB_EVENT"
|
|
|
|
|
|
|
|
- name: Get Build Cache
|
|
|
|
id: build-cache
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/build
|
2022-05-03 20:01:37 +02:00
|
|
|
key: ${{ runner.os }}-${{ github.run_id }}-build
|
|
|
|
|
|
|
|
- name: Setup Safari Cache
|
|
|
|
id: safari-cache
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/browser/dist/Safari
|
2022-05-03 20:01:37 +02:00
|
|
|
key: ${{ runner.os }}-${{ github.run_id }}-safari-extension
|
|
|
|
|
2024-02-28 19:06:50 +01:00
|
|
|
- name: Login to Azure
|
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
|
|
|
|
|
|
|
- name: Download Provisioning Profiles secrets
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
2024-02-28 19:06:50 +01:00
|
|
|
ACCOUNT_NAME: bitwardenci
|
|
|
|
CONTAINER_NAME: profiles
|
2022-05-03 20:01:37 +02:00
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/secrets
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \
|
|
|
|
--name bitwarden_desktop_appstore.provisionprofile \
|
|
|
|
--file $HOME/secrets/bitwarden_desktop_appstore.provisionprofile \
|
|
|
|
--output none
|
|
|
|
|
|
|
|
- name: Get certificates
|
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/certificates
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/bitwarden-desktop-key |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/bitwarden-desktop-key.p12
|
2024-03-06 14:59:18 +01:00
|
|
|
|
2024-02-28 19:06:50 +01:00
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/appstore-app-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/appstore-app-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/appstore-installer-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/appstore-installer-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/devid-app-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/devid-app-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/devid-installer-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/devid-installer-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/macdev-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/macdev-cert.p12
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up keychain
|
|
|
|
env:
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
security create-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security default-keychain -s build.keychain
|
|
|
|
security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security set-keychain-settings -lut 1200 build.keychain
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/bitwarden-desktop-key.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/devid-app-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/devid-installer-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/appstore-app-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/appstore-installer-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/macdev-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
|
|
|
|
- name: Set up provisioning profiles
|
|
|
|
run: |
|
|
|
|
cp $HOME/secrets/bitwarden_desktop_appstore.provisionprofile \
|
2022-05-06 18:20:10 +02:00
|
|
|
$GITHUB_WORKSPACE/apps/desktop/bitwarden_desktop_appstore.provisionprofile
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Increment version
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
BUILD_NUMBER: ${{ needs.setup.outputs.build_number }}
|
|
|
|
run: |
|
2022-05-05 22:20:16 +02:00
|
|
|
$package = Get-Content -Raw -Path electron-builder.json | ConvertFrom-Json
|
|
|
|
$package | Add-Member -MemberType NoteProperty -Name buildVersion -Value "$env:BUILD_NUMBER"
|
|
|
|
$package | ConvertTo-Json -Depth 32 | Set-Content -Path electron-builder.json
|
2024-09-16 19:15:34 +02:00
|
|
|
Write-Output "### MacOS GitHub build number: $env:BUILD_NUMBER"
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2022-06-02 15:18:29 +02:00
|
|
|
- name: Install Node dependencies
|
2022-05-03 20:01:37 +02:00
|
|
|
run: npm ci
|
2022-06-02 15:18:29 +02:00
|
|
|
working-directory: ./
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-11-19 13:59:59 +01:00
|
|
|
- name: Download SDK Artifacts
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
workflow: build-wasm-internal.yml
|
|
|
|
workflow_conclusion: success
|
|
|
|
branch: ${{ inputs.sdk_branch }}
|
|
|
|
artifacts: sdk-internal
|
|
|
|
repo: bitwarden/sdk-internal
|
|
|
|
path: ../sdk-internal
|
|
|
|
if_no_artifact_found: fail
|
|
|
|
|
|
|
|
- name: Override SDK
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
working-directory: ./
|
|
|
|
run: |
|
|
|
|
ls -l ../
|
|
|
|
npm link ../sdk-internal
|
|
|
|
|
2022-07-25 13:24:13 +02:00
|
|
|
- name: Cache Native Module
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-07-25 13:24:13 +02:00
|
|
|
id: cache
|
|
|
|
with:
|
2024-10-01 16:28:56 +02:00
|
|
|
path: |
|
|
|
|
apps/desktop/desktop_native/napi/*.node
|
|
|
|
apps/desktop/desktop_native/dist/*
|
2022-07-25 13:24:13 +02:00
|
|
|
key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }}
|
|
|
|
|
|
|
|
- name: Build Native Module
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
2024-10-01 16:28:56 +02:00
|
|
|
working-directory: apps/desktop/desktop_native
|
|
|
|
run: node build.js cross-platform
|
2022-07-25 13:24:13 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Build
|
|
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
|
|
run: npm run build
|
|
|
|
|
2022-10-19 17:22:57 +02:00
|
|
|
- name: Download Browser artifact
|
2024-08-26 22:45:28 +02:00
|
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
2022-06-03 22:48:22 +02:00
|
|
|
with:
|
2022-05-18 16:31:02 +02:00
|
|
|
path: ${{ github.workspace }}/browser-build-artifacts
|
|
|
|
|
|
|
|
- name: Unzip Safari artifact
|
2022-05-03 20:01:37 +02:00
|
|
|
run: |
|
2022-05-18 16:31:02 +02:00
|
|
|
SAFARI_DIR=$(find $GITHUB_WORKSPACE/browser-build-artifacts -name 'dist-safari-*.zip')
|
|
|
|
echo $SAFARI_DIR
|
|
|
|
unzip $SAFARI_DIR/dist-safari.zip -d $GITHUB_WORKSPACE/browser-build-artifacts
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Load Safari extension for .dmg
|
|
|
|
run: |
|
|
|
|
mkdir PlugIns
|
2022-05-18 16:31:02 +02:00
|
|
|
cp -r $GITHUB_WORKSPACE/browser-build-artifacts/Safari/dmg/build/Release/safari.appex PlugIns/safari.appex
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-08-13 18:14:15 +02:00
|
|
|
- name: Set up private auth key
|
|
|
|
run: |
|
|
|
|
mkdir ~/private_keys
|
|
|
|
cat << EOF > ~/private_keys/AuthKey_6TV9MKN3GP.p8
|
|
|
|
${{ secrets.APP_STORE_CONNECT_AUTH_KEY }}
|
|
|
|
EOF
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Build application (dist)
|
|
|
|
env:
|
2024-08-13 18:14:15 +02:00
|
|
|
APP_STORE_CONNECT_TEAM_ISSUER: ${{ secrets.APP_STORE_CONNECT_TEAM_ISSUER }}
|
|
|
|
APP_STORE_CONNECT_AUTH_KEY: 6TV9MKN3GP
|
|
|
|
APP_STORE_CONNECT_AUTH_KEY_PATH: ~/private_keys/AuthKey_6TV9MKN3GP.p8
|
2023-04-10 20:19:28 +02:00
|
|
|
CSC_FOR_PULL_REQUEST: true
|
2022-05-03 20:01:37 +02:00
|
|
|
run: npm run pack:mac
|
|
|
|
|
|
|
|
- name: Upload .zip artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-universal-mac.zip
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-universal-mac.zip
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload .dmg artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-universal.dmg
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-universal.dmg
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Upload .dmg blockmap artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-universal.dmg.blockmap
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-universal.dmg.blockmap
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
2022-06-07 15:44:25 +02:00
|
|
|
- name: Upload auto-update artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-06-07 15:44:25 +02:00
|
|
|
name: ${{ needs.setup.outputs.release_channel }}-mac.yml
|
|
|
|
path: apps/desktop/dist/${{ needs.setup.outputs.release_channel }}-mac.yml
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
|
|
|
|
macos-package-mas:
|
|
|
|
name: MacOS Package Prod Release Asset
|
2024-05-31 21:58:10 +02:00
|
|
|
runs-on: macos-13
|
2022-05-03 20:01:37 +02:00
|
|
|
needs:
|
2022-10-19 17:22:57 +02:00
|
|
|
- browser-build
|
2022-05-03 20:01:37 +02:00
|
|
|
- macos-build
|
2022-10-19 17:22:57 +02:00
|
|
|
- setup
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
|
|
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
2023-10-04 18:23:40 +02:00
|
|
|
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
|
2023-12-21 11:14:13 +01:00
|
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
2022-05-09 17:22:14 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: apps/desktop
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
2024-11-07 19:01:54 +01:00
|
|
|
- name: Check out repo
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-07 19:01:54 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up Node
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
cache: 'npm'
|
2022-06-02 15:18:29 +02:00
|
|
|
cache-dependency-path: '**/package-lock.json'
|
2023-10-04 18:23:40 +02:00
|
|
|
node-version: ${{ env._NODE_VERSION }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-06-26 16:46:41 +02:00
|
|
|
- name: Set up Node-gyp
|
|
|
|
run: python3 -m pip install setuptools
|
|
|
|
|
2022-07-25 13:24:13 +02:00
|
|
|
- name: Rust
|
|
|
|
shell: pwsh
|
|
|
|
run: rustup target install aarch64-apple-darwin
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
node --version
|
|
|
|
npm --version
|
2022-07-25 13:24:13 +02:00
|
|
|
rustup show
|
2022-05-03 20:01:37 +02:00
|
|
|
echo "GitHub ref: $GITHUB_REF"
|
|
|
|
echo "GitHub event: $GITHUB_EVENT"
|
|
|
|
|
|
|
|
- name: Get Build Cache
|
|
|
|
id: build-cache
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/build
|
2022-05-03 20:01:37 +02:00
|
|
|
key: ${{ runner.os }}-${{ github.run_id }}-build
|
|
|
|
|
|
|
|
- name: Setup Safari Cache
|
|
|
|
id: safari-cache
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/browser/dist/Safari
|
2022-05-03 20:01:37 +02:00
|
|
|
key: ${{ runner.os }}-${{ github.run_id }}-safari-extension
|
|
|
|
|
2024-02-28 19:06:50 +01:00
|
|
|
- name: Login to Azure
|
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
|
|
|
|
2024-09-16 19:15:34 +02:00
|
|
|
- name: Retrieve Slack secret
|
|
|
|
id: retrieve-slack-secret
|
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
|
|
|
with:
|
|
|
|
keyvault: bitwarden-ci
|
|
|
|
secrets: "slack-bot-token"
|
|
|
|
|
2024-02-28 19:06:50 +01:00
|
|
|
- name: Download Provisioning Profiles secrets
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
2024-02-28 19:06:50 +01:00
|
|
|
ACCOUNT_NAME: bitwardenci
|
|
|
|
CONTAINER_NAME: profiles
|
2022-05-03 20:01:37 +02:00
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/secrets
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \
|
|
|
|
--name bitwarden_desktop_appstore.provisionprofile \
|
|
|
|
--file $HOME/secrets/bitwarden_desktop_appstore.provisionprofile \
|
|
|
|
--output none
|
|
|
|
|
|
|
|
- name: Get certificates
|
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/certificates
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/bitwarden-desktop-key |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/bitwarden-desktop-key.p12
|
2024-03-06 14:59:18 +01:00
|
|
|
|
2024-02-28 19:06:50 +01:00
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/appstore-app-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/appstore-app-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/appstore-installer-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/appstore-installer-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/devid-app-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/devid-app-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/devid-installer-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/devid-installer-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/macdev-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/macdev-cert.p12
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up keychain
|
|
|
|
env:
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
security create-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security default-keychain -s build.keychain
|
|
|
|
security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security set-keychain-settings -lut 1200 build.keychain
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/bitwarden-desktop-key.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/devid-app-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/devid-installer-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/appstore-app-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/appstore-installer-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/macdev-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
|
|
|
|
- name: Set up provisioning profiles
|
|
|
|
run: |
|
|
|
|
cp $HOME/secrets/bitwarden_desktop_appstore.provisionprofile \
|
2022-05-06 18:20:10 +02:00
|
|
|
$GITHUB_WORKSPACE/apps/desktop/bitwarden_desktop_appstore.provisionprofile
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Increment version
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
BUILD_NUMBER: ${{ needs.setup.outputs.build_number }}
|
|
|
|
run: |
|
2022-05-05 22:20:16 +02:00
|
|
|
$package = Get-Content -Raw -Path electron-builder.json | ConvertFrom-Json
|
|
|
|
$package | Add-Member -MemberType NoteProperty -Name buildVersion -Value "$env:BUILD_NUMBER"
|
|
|
|
$package | ConvertTo-Json -Depth 32 | Set-Content -Path electron-builder.json
|
2024-09-16 19:15:34 +02:00
|
|
|
Write-Output "### MacOS App Store build number: $env:BUILD_NUMBER"
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2022-06-02 15:18:29 +02:00
|
|
|
- name: Install Node dependencies
|
2022-05-03 20:01:37 +02:00
|
|
|
run: npm ci
|
2022-06-02 15:18:29 +02:00
|
|
|
working-directory: ./
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-11-19 13:59:59 +01:00
|
|
|
- name: Download SDK Artifacts
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
workflow: build-wasm-internal.yml
|
|
|
|
workflow_conclusion: success
|
|
|
|
branch: ${{ inputs.sdk_branch }}
|
|
|
|
artifacts: sdk-internal
|
|
|
|
repo: bitwarden/sdk-internal
|
|
|
|
path: ../sdk-internal
|
|
|
|
if_no_artifact_found: fail
|
|
|
|
|
|
|
|
- name: Override SDK
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
working-directory: ./
|
|
|
|
run: |
|
|
|
|
ls -l ../
|
|
|
|
npm link ../sdk-internal
|
|
|
|
|
2022-07-25 13:24:13 +02:00
|
|
|
- name: Cache Native Module
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-07-25 13:24:13 +02:00
|
|
|
id: cache
|
|
|
|
with:
|
2024-10-01 16:28:56 +02:00
|
|
|
path: |
|
|
|
|
apps/desktop/desktop_native/napi/*.node
|
|
|
|
apps/desktop/desktop_native/dist/*
|
2022-07-25 13:24:13 +02:00
|
|
|
key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }}
|
|
|
|
|
|
|
|
- name: Build Native Module
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
2024-10-01 16:28:56 +02:00
|
|
|
working-directory: apps/desktop/desktop_native
|
|
|
|
run: node build.js cross-platform
|
2022-07-25 13:24:13 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Build
|
|
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
|
|
run: npm run build
|
|
|
|
|
2022-10-19 17:22:57 +02:00
|
|
|
- name: Download Browser artifact
|
2024-08-26 22:45:28 +02:00
|
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
2022-05-18 16:31:02 +02:00
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/browser-build-artifacts
|
|
|
|
|
|
|
|
- name: Unzip Safari artifact
|
2022-05-03 20:01:37 +02:00
|
|
|
run: |
|
2022-05-18 16:31:02 +02:00
|
|
|
SAFARI_DIR=$(find $GITHUB_WORKSPACE/browser-build-artifacts -name 'dist-safari-*.zip')
|
|
|
|
echo $SAFARI_DIR
|
|
|
|
unzip $SAFARI_DIR/dist-safari.zip -d $GITHUB_WORKSPACE/browser-build-artifacts
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Load Safari extension for App Store
|
|
|
|
run: |
|
|
|
|
mkdir PlugIns
|
2022-05-18 16:31:02 +02:00
|
|
|
cp -r $GITHUB_WORKSPACE/browser-build-artifacts/Safari/mas/build/Release/safari.appex PlugIns/safari.appex
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-08-13 18:14:15 +02:00
|
|
|
- name: Set up private auth key
|
|
|
|
run: |
|
|
|
|
mkdir ~/private_keys
|
|
|
|
cat << EOF > ~/private_keys/AuthKey_6TV9MKN3GP.p8
|
|
|
|
${{ secrets.APP_STORE_CONNECT_AUTH_KEY }}
|
|
|
|
EOF
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Build application for App Store
|
|
|
|
env:
|
2024-08-13 18:14:15 +02:00
|
|
|
APP_STORE_CONNECT_TEAM_ISSUER: ${{ secrets.APP_STORE_CONNECT_TEAM_ISSUER }}
|
|
|
|
APP_STORE_CONNECT_AUTH_KEY: 6TV9MKN3GP
|
|
|
|
APP_STORE_CONNECT_AUTH_KEY_PATH: ~/private_keys/AuthKey_6TV9MKN3GP.p8
|
2023-04-10 20:19:28 +02:00
|
|
|
CSC_FOR_PULL_REQUEST: true
|
2024-08-13 18:14:15 +02:00
|
|
|
run: npm run pack:mac:mas
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Upload .pkg artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-universal.pkg
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/dist/mas-universal/Bitwarden-${{ env._PACKAGE_VERSION }}-universal.pkg
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: Deploy to TestFlight
|
2024-09-16 19:15:34 +02:00
|
|
|
id: testflight-deploy
|
2022-05-03 20:01:37 +02:00
|
|
|
if: |
|
2024-11-11 22:38:03 +01:00
|
|
|
github.event_name != 'pull_request_target'
|
|
|
|
&& (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc-desktop')
|
2024-08-13 18:14:15 +02:00
|
|
|
env:
|
|
|
|
APP_STORE_CONNECT_TEAM_ISSUER: ${{ secrets.APP_STORE_CONNECT_TEAM_ISSUER }}
|
|
|
|
APP_STORE_CONNECT_AUTH_KEY: 6TV9MKN3GP
|
2024-09-16 19:15:34 +02:00
|
|
|
run: |
|
|
|
|
xcrun altool \
|
|
|
|
--upload-app \
|
|
|
|
--type macos \
|
|
|
|
--file "$(find ./dist/mas-universal/Bitwarden*.pkg)" \
|
|
|
|
--apiKey $APP_STORE_CONNECT_AUTH_KEY \
|
2024-09-19 10:40:55 +02:00
|
|
|
--apiIssuer $APP_STORE_CONNECT_TEAM_ISSUER
|
2024-09-16 19:15:34 +02:00
|
|
|
|
|
|
|
- name: Post message to a Slack channel
|
|
|
|
id: slack-message
|
|
|
|
if: |
|
2024-11-11 22:38:03 +01:00
|
|
|
github.event_name != 'pull_request_target'
|
|
|
|
&& (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc-desktop')
|
2024-09-24 17:35:01 +02:00
|
|
|
uses: slackapi/slack-github-action@37ebaef184d7626c5f204ab8d3baff4262dd30f0 # v1.27.0
|
2024-09-16 19:15:34 +02:00
|
|
|
with:
|
|
|
|
channel-id: C074F5UESQ0
|
|
|
|
payload: |
|
|
|
|
{
|
|
|
|
"blocks": [
|
|
|
|
{
|
|
|
|
"type": "section",
|
|
|
|
"text": {
|
|
|
|
"type": "mrkdwn",
|
2024-09-19 10:40:55 +02:00
|
|
|
"text": "Desktop client v${{ env._PACKAGE_VERSION }} <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|build ${{ env.BUILD_NUMBER }}> success on *${{ github.ref_name }}*"
|
2024-09-16 19:15:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
env:
|
|
|
|
SLACK_BOT_TOKEN: ${{ steps.retrieve-slack-secret.outputs.slack-bot-token }}
|
2024-09-19 10:40:55 +02:00
|
|
|
BUILD_NUMBER: ${{ needs.setup.outputs.build_number }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
macos-package-dev:
|
|
|
|
name: MacOS Package Dev Release Asset
|
2024-05-31 21:58:10 +02:00
|
|
|
runs-on: macos-13
|
2022-05-03 20:01:37 +02:00
|
|
|
needs:
|
2022-10-19 17:22:57 +02:00
|
|
|
- browser-build
|
2022-05-03 20:01:37 +02:00
|
|
|
- macos-build
|
2022-10-19 17:22:57 +02:00
|
|
|
- setup
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
|
|
|
_PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
|
2023-10-04 18:23:40 +02:00
|
|
|
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
|
2023-12-21 11:14:13 +01:00
|
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
2022-05-09 17:22:14 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: apps/desktop
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
2024-11-07 19:01:54 +01:00
|
|
|
- name: Check out repo
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-07 19:01:54 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up Node
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
cache: 'npm'
|
2022-06-02 15:18:29 +02:00
|
|
|
cache-dependency-path: '**/package-lock.json'
|
2023-10-04 18:23:40 +02:00
|
|
|
node-version: ${{ env._NODE_VERSION }}
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-06-26 16:46:41 +02:00
|
|
|
- name: Set up Node-gyp
|
|
|
|
run: python3 -m pip install setuptools
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
node --version
|
|
|
|
npm --version
|
|
|
|
echo "GitHub ref: $GITHUB_REF"
|
|
|
|
echo "GitHub event: $GITHUB_EVENT"
|
|
|
|
|
|
|
|
- name: Get Build Cache
|
|
|
|
id: build-cache
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/desktop/build
|
2022-05-03 20:01:37 +02:00
|
|
|
key: ${{ runner.os }}-${{ github.run_id }}-build
|
|
|
|
|
|
|
|
- name: Setup Safari Cache
|
|
|
|
id: safari-cache
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-05 22:20:16 +02:00
|
|
|
path: apps/browser/dist/Safari
|
2022-05-03 20:01:37 +02:00
|
|
|
key: ${{ runner.os }}-${{ github.run_id }}-safari-extension
|
|
|
|
|
2024-02-28 19:06:50 +01:00
|
|
|
- name: Login to Azure
|
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
|
|
|
|
|
|
|
- name: Download Provisioning Profiles secrets
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
2024-02-28 19:06:50 +01:00
|
|
|
ACCOUNT_NAME: bitwardenci
|
|
|
|
CONTAINER_NAME: profiles
|
2022-05-03 20:01:37 +02:00
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/secrets
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
az storage blob download --account-name $ACCOUNT_NAME --container-name $CONTAINER_NAME \
|
|
|
|
--name bitwarden_desktop_appstore.provisionprofile \
|
|
|
|
--file $HOME/secrets/bitwarden_desktop_appstore.provisionprofile \
|
|
|
|
--output none
|
|
|
|
|
|
|
|
- name: Get certificates
|
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/certificates
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/bitwarden-desktop-key |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/bitwarden-desktop-key.p12
|
2024-03-06 14:59:18 +01:00
|
|
|
|
2024-02-28 19:06:50 +01:00
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/appstore-app-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/appstore-app-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/appstore-installer-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/appstore-installer-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/devid-app-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/devid-app-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/devid-installer-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/devid-installer-cert.p12
|
|
|
|
|
|
|
|
az keyvault secret show --id https://bitwarden-ci.vault.azure.net/certificates/macdev-cert |
|
|
|
|
jq -r .value | base64 -d > $HOME/certificates/macdev-cert.p12
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Set up keychain
|
|
|
|
env:
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
security create-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security default-keychain -s build.keychain
|
|
|
|
security unlock-keychain -p $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
security set-keychain-settings -lut 1200 build.keychain
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/bitwarden-desktop-key.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/devid-app-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/devid-installer-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/appstore-app-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/appstore-installer-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
|
|
|
security import "$HOME/certificates/macdev-cert.p12" -k build.keychain -P "" \
|
2022-05-03 20:01:37 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
|
2024-11-14 11:42:10 +01:00
|
|
|
- name: Set up provisioning profiles
|
|
|
|
run: |
|
|
|
|
cp $HOME/secrets/bitwarden_desktop_appstore.provisionprofile \
|
|
|
|
$GITHUB_WORKSPACE/apps/desktop/bitwarden_desktop_appstore.provisionprofile
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Increment version
|
|
|
|
shell: pwsh
|
|
|
|
env:
|
|
|
|
BUILD_NUMBER: ${{ needs.setup.outputs.build_number }}
|
|
|
|
run: |
|
2022-05-05 22:20:16 +02:00
|
|
|
$package = Get-Content -Raw -Path electron-builder.json | ConvertFrom-Json
|
|
|
|
$package | Add-Member -MemberType NoteProperty -Name buildVersion -Value "$env:BUILD_NUMBER"
|
|
|
|
$package | ConvertTo-Json -Depth 32 | Set-Content -Path electron-builder.json
|
2024-09-16 19:15:34 +02:00
|
|
|
Write-Output "### MacOS Dev build number: $env:BUILD_NUMBER"
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2022-06-02 15:18:29 +02:00
|
|
|
- name: Install Node dependencies
|
2022-05-03 20:01:37 +02:00
|
|
|
run: npm ci
|
2022-06-02 15:18:29 +02:00
|
|
|
working-directory: ./
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-11-19 13:59:59 +01:00
|
|
|
- name: Download SDK Artifacts
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
uses: bitwarden/gh-actions/download-artifacts@main
|
|
|
|
with:
|
|
|
|
github_token: ${{secrets.GITHUB_TOKEN}}
|
|
|
|
workflow: build-wasm-internal.yml
|
|
|
|
workflow_conclusion: success
|
|
|
|
branch: ${{ inputs.sdk_branch }}
|
|
|
|
artifacts: sdk-internal
|
|
|
|
repo: bitwarden/sdk-internal
|
|
|
|
path: ../sdk-internal
|
|
|
|
if_no_artifact_found: fail
|
|
|
|
|
|
|
|
- name: Override SDK
|
|
|
|
if: ${{ inputs.sdk_branch != '' }}
|
|
|
|
working-directory: ./
|
|
|
|
run: |
|
|
|
|
ls -l ../
|
|
|
|
npm link ../sdk-internal
|
|
|
|
|
2022-07-25 13:24:13 +02:00
|
|
|
- name: Cache Native Module
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
2022-07-25 13:24:13 +02:00
|
|
|
id: cache
|
|
|
|
with:
|
2024-10-01 16:28:56 +02:00
|
|
|
path: |
|
|
|
|
apps/desktop/desktop_native/napi/*.node
|
|
|
|
apps/desktop/desktop_native/dist/*
|
2022-07-25 13:24:13 +02:00
|
|
|
key: rust-${{ runner.os }}-${{ hashFiles('apps/desktop/desktop_native/**/*') }}
|
|
|
|
|
|
|
|
- name: Build Native Module
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
2024-10-01 16:28:56 +02:00
|
|
|
working-directory: apps/desktop/desktop_native
|
|
|
|
run: node build.js cross-platform
|
2022-07-25 13:24:13 +02:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Build
|
|
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
|
|
run: npm run build
|
|
|
|
|
2022-10-19 17:22:57 +02:00
|
|
|
- name: Download Browser artifact
|
2024-08-26 22:45:28 +02:00
|
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
2022-05-18 16:31:02 +02:00
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}/browser-build-artifacts
|
|
|
|
|
|
|
|
- name: Unzip Safari artifact
|
2022-05-03 20:01:37 +02:00
|
|
|
run: |
|
2022-05-18 16:31:02 +02:00
|
|
|
SAFARI_DIR=$(find $GITHUB_WORKSPACE/browser-build-artifacts -name 'dist-safari-*.zip')
|
|
|
|
echo $SAFARI_DIR
|
|
|
|
unzip $SAFARI_DIR/dist-safari.zip -d $GITHUB_WORKSPACE/browser-build-artifacts
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Load Safari extension for App Store
|
|
|
|
run: |
|
|
|
|
mkdir PlugIns
|
2022-05-18 16:31:02 +02:00
|
|
|
cp -r $GITHUB_WORKSPACE/browser-build-artifacts/Safari/masdev/build/Release/safari.appex PlugIns/safari.appex
|
2022-05-03 20:01:37 +02:00
|
|
|
|
2024-08-13 18:14:15 +02:00
|
|
|
- name: Set up private auth key
|
|
|
|
run: |
|
|
|
|
mkdir ~/private_keys
|
|
|
|
cat << EOF > ~/private_keys/AuthKey_6TV9MKN3GP.p8
|
|
|
|
${{ secrets.APP_STORE_CONNECT_AUTH_KEY }}
|
|
|
|
EOF
|
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
- name: Build dev application for App Store
|
|
|
|
env:
|
2024-08-13 18:14:15 +02:00
|
|
|
APP_STORE_CONNECT_TEAM_ISSUER: ${{ secrets.APP_STORE_CONNECT_TEAM_ISSUER }}
|
|
|
|
APP_STORE_CONNECT_AUTH_KEY_PATH: ~/private_keys/AuthKey_6TV9MKN3GP.p8
|
|
|
|
run: npm run pack:mac:masdev
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Zip masdev asset
|
2024-05-31 21:58:10 +02:00
|
|
|
run: |
|
|
|
|
cd dist/mas-dev-universal
|
|
|
|
zip -r Bitwarden-${{ env._PACKAGE_VERSION }}-masdev-universal.zip Bitwarden.app
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Upload masdev artifact
|
2024-10-17 16:45:49 +02:00
|
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
|
|
|
name: Bitwarden-${{ env._PACKAGE_VERSION }}-masdev-universal.zip
|
2024-05-31 21:58:10 +02:00
|
|
|
path: apps/desktop/dist/mas-dev-universal/Bitwarden-${{ env._PACKAGE_VERSION }}-masdev-universal.zip
|
2022-05-03 20:01:37 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
|
|
|
|
crowdin-push:
|
|
|
|
name: Crowdin Push
|
2023-12-12 20:57:50 +01:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2022-05-03 20:01:37 +02:00
|
|
|
needs:
|
|
|
|
- linux
|
|
|
|
- windows
|
|
|
|
- macos-package-github
|
|
|
|
- macos-package-mas
|
2024-02-08 21:56:39 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2022-05-03 20:01:37 +02:00
|
|
|
steps:
|
2024-11-07 19:01:54 +01:00
|
|
|
- name: Check out repo
|
2024-10-30 16:29:15 +01:00
|
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-07 19:01:54 +01:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
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-13 21:38:47 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
keyvault: "bitwarden-ci"
|
2022-10-13 21:38:47 +02:00
|
|
|
secrets: "crowdin-api-token"
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Upload Sources
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: crowdin/github-action@30849777a3cba6ee9a09e24e195272b8287a0a5b # v1.20.4
|
2022-05-03 20:01:37 +02:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }}
|
2022-05-10 16:20:32 +02:00
|
|
|
CROWDIN_PROJECT_ID: "299360"
|
2022-05-03 20:01:37 +02:00
|
|
|
with:
|
2022-05-09 15:53:48 +02:00
|
|
|
config: apps/desktop/crowdin.yml
|
2023-12-12 20:57:50 +01:00
|
|
|
crowdin_branch_name: main
|
2022-05-03 20:01:37 +02:00
|
|
|
upload_sources: true
|
|
|
|
upload_translations: false
|
|
|
|
|
|
|
|
|
|
|
|
check-failures:
|
|
|
|
name: Check for failures
|
|
|
|
if: always()
|
2024-02-08 21:56:39 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2022-05-03 20:01:37 +02:00
|
|
|
needs:
|
2022-06-02 15:18:29 +02:00
|
|
|
- electron-verify
|
2022-10-19 17:22:57 +02:00
|
|
|
- browser-build
|
2022-05-03 20:01:37 +02:00
|
|
|
- setup
|
|
|
|
- linux
|
|
|
|
- windows
|
|
|
|
- macos-build
|
|
|
|
- macos-package-github
|
|
|
|
- macos-package-mas
|
|
|
|
- crowdin-push
|
|
|
|
steps:
|
|
|
|
- name: Check if any job failed
|
2024-11-07 21:15:44 +01:00
|
|
|
if: |
|
|
|
|
github.event_name != 'pull_request_target'
|
2024-11-11 22:38:03 +01:00
|
|
|
&& (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc-desktop')
|
2024-11-07 21:15:44 +01:00
|
|
|
&& contains(needs.*.result, 'failure')
|
2024-03-06 14:59:18 +01:00
|
|
|
run: exit 1
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Login to Azure - Prod Subscription
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2022-05-03 20:01:37 +02:00
|
|
|
if: failure()
|
|
|
|
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
|
|
|
|
if: failure()
|
2023-11-08 19:08:34 +01:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@main
|
2022-10-13 21:38:47 +02:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
keyvault: "bitwarden-ci"
|
2022-10-13 21:38:47 +02:00
|
|
|
secrets: "devops-alerts-slack-webhook-url"
|
2022-05-03 20:01:37 +02:00
|
|
|
|
|
|
|
- name: Notify Slack on failure
|
2024-08-26 22:45:28 +02:00
|
|
|
uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
|
2022-05-03 20:01:37 +02:00
|
|
|
if: failure()
|
|
|
|
env:
|
|
|
|
SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }}
|
|
|
|
with:
|
|
|
|
status: ${{ job.status }}
|