2021-09-02 22:03:47 +02:00
|
|
|
---
|
2022-05-03 20:01:37 +02:00
|
|
|
name: Build Browser
|
2021-02-02 00:27:08 +01:00
|
|
|
|
|
|
|
on:
|
2022-05-24 16:26:09 +02:00
|
|
|
pull_request:
|
|
|
|
branches-ignore:
|
|
|
|
- 'l10n_master'
|
2022-06-20 21:16:51 +02:00
|
|
|
- 'cf-pages'
|
2022-05-24 16:26:09 +02:00
|
|
|
paths:
|
|
|
|
- 'apps/browser/**'
|
2022-06-08 19:53:35 +02:00
|
|
|
- 'libs/**'
|
2022-06-13 09:59:15 +02:00
|
|
|
- '*'
|
|
|
|
- '!*.md'
|
|
|
|
- '!*.txt'
|
2021-02-02 00:27:08 +01: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-browser'
|
2022-05-03 20:01:37 +02:00
|
|
|
paths:
|
2022-05-03 21:45:37 +02:00
|
|
|
- 'apps/browser/**'
|
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-browser.yml'
|
2022-10-19 17:22:57 +02:00
|
|
|
workflow_call:
|
|
|
|
inputs: {}
|
2021-02-02 00:27:08 +01:00
|
|
|
workflow_dispatch:
|
2021-09-28 00:55:53 +02:00
|
|
|
inputs: {}
|
2021-02-02 00:27:08 +01:00
|
|
|
|
2022-05-03 20:01:37 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2021-02-02 00:27:08 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
setup:
|
2021-09-02 22:03:47 +02:00
|
|
|
name: Setup
|
2023-09-06 15:51:40 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-02-02 00:27:08 +01:00
|
|
|
outputs:
|
|
|
|
repo_url: ${{ steps.gen_vars.outputs.repo_url }}
|
|
|
|
adj_build_number: ${{ steps.gen_vars.outputs.adj_build_number }}
|
2023-10-04 18:23:40 +02:00
|
|
|
node_version: ${{ steps.retrieve-node-version.outputs.node_version }}
|
2021-02-02 00:27:08 +01:00
|
|
|
steps:
|
2023-10-04 18:23:40 +02:00
|
|
|
- name: Checkout repo
|
2024-09-30 11:46:20 +02:00
|
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
2023-10-04 18:23:40 +02:00
|
|
|
|
2021-02-02 00:27:08 +01:00
|
|
|
- name: Get Package Version
|
|
|
|
id: gen_vars
|
|
|
|
run: |
|
2021-02-02 23:27:29 +01:00
|
|
|
repo_url=https://github.com/$GITHUB_REPOSITORY.git
|
|
|
|
adj_build_num=${GITHUB_SHA:0:7}
|
2021-02-02 00:27:08 +01:00
|
|
|
|
2022-12-05 16:04:04 +01:00
|
|
|
echo "repo_url=$repo_url" >> $GITHUB_OUTPUT
|
|
|
|
echo "adj_build_number=$adj_build_num" >> $GITHUB_OUTPUT
|
2021-02-02 00:27:08 +01:00
|
|
|
|
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-03-15 22:08:43 +01:00
|
|
|
|
2021-05-13 01:52:27 +02:00
|
|
|
locales-test:
|
2021-09-02 22:03:47 +02:00
|
|
|
name: Locales Test
|
2023-09-06 15:51:40 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2022-01-28 19:48:09 +01:00
|
|
|
needs:
|
2022-01-28 19:29:49 +01:00
|
|
|
- setup
|
2022-05-04 16:59:05 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: apps/browser
|
2021-02-02 00:27:08 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-09-30 11:46:20 +02:00
|
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
2021-02-02 00:27:08 +01:00
|
|
|
|
2021-05-13 22:28:36 +02:00
|
|
|
- name: Testing locales - extName length
|
2021-05-13 00:25:13 +02:00
|
|
|
run: |
|
2021-05-13 22:43:19 +02:00
|
|
|
found_error=false
|
|
|
|
|
|
|
|
echo "Locales Test"
|
|
|
|
echo "============"
|
|
|
|
echo "extName string must be 40 characters or less"
|
|
|
|
echo
|
|
|
|
for locale in $(ls src/_locales/); do
|
|
|
|
string_length=$(jq '.extName.message | length' src/_locales/$locale/messages.json)
|
|
|
|
if [[ $string_length -gt 40 ]]; then
|
|
|
|
echo "$locale: $string_length"
|
|
|
|
found_error=true
|
|
|
|
fi
|
|
|
|
done
|
2021-09-02 22:03:47 +02:00
|
|
|
|
2021-05-13 22:43:19 +02:00
|
|
|
if $found_error; then
|
|
|
|
echo
|
|
|
|
echo "Please fix 'extName' for the locales listed above."
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Test passed!"
|
2021-09-02 22:03:47 +02:00
|
|
|
fi
|
2021-05-13 00:27:47 +02:00
|
|
|
|
2022-03-15 22:08:43 +01:00
|
|
|
|
2021-05-13 01:52:27 +02:00
|
|
|
build:
|
2021-09-02 22:03:47 +02:00
|
|
|
name: Build
|
2023-09-06 15:51:40 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-09-28 00:55:53 +02:00
|
|
|
needs:
|
|
|
|
- setup
|
|
|
|
- locales-test
|
2021-05-13 01:52:27 +02:00
|
|
|
env:
|
2021-09-02 22:03:47 +02:00
|
|
|
_BUILD_NUMBER: ${{ needs.setup.outputs.adj_build_number }}
|
2023-10-04 18:23:40 +02:00
|
|
|
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
|
2021-05-13 01:52:27 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-09-30 11:46:20 +02:00
|
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
2021-05-13 01:52:27 +02:00
|
|
|
|
|
|
|
- name: Set up Node
|
2024-09-24 17:35:01 +02:00
|
|
|
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
|
2021-05-13 01:52:27 +02:00
|
|
|
with:
|
2022-03-15 22:08:43 +01:00
|
|
|
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 }}
|
2021-05-13 01:52:27 +02:00
|
|
|
|
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
node --version
|
|
|
|
npm --version
|
|
|
|
|
2021-09-28 00:55:53 +02:00
|
|
|
- name: Build sources for reviewers
|
|
|
|
run: |
|
2023-09-06 15:51:40 +02:00
|
|
|
# Include hidden files in glob copy
|
|
|
|
shopt -s dotglob
|
2022-06-09 18:31:13 +02:00
|
|
|
|
2023-09-06 15:51:40 +02:00
|
|
|
# Remove ".git" directory
|
|
|
|
rm -r .git
|
|
|
|
|
|
|
|
# Copy root level files to source directory
|
2022-06-09 18:31:13 +02:00
|
|
|
mkdir browser-source
|
2023-09-06 15:51:40 +02:00
|
|
|
FILES=$(find . -maxdepth 1 -type f)
|
|
|
|
for FILE in $FILES; do cp "$FILE" browser-source/; done
|
2022-06-09 18:31:13 +02:00
|
|
|
|
2023-09-20 17:09:12 +02:00
|
|
|
# Copy patches to the Browser source directory
|
|
|
|
mkdir -p browser-source/patches
|
|
|
|
cp -r patches/* browser-source/patches
|
|
|
|
|
|
|
|
# Copy apps/browser to the Browser source directory
|
2023-09-06 15:51:40 +02:00
|
|
|
mkdir -p browser-source/apps/browser
|
|
|
|
cp -r apps/browser/* browser-source/apps/browser
|
2022-06-20 18:23:11 +02:00
|
|
|
|
2023-09-06 15:51:40 +02:00
|
|
|
# Copy libs to Browser source directory
|
|
|
|
mkdir browser-source/libs
|
|
|
|
cp -r libs/* browser-source/libs
|
2022-06-09 18:31:13 +02:00
|
|
|
|
2023-09-06 15:51:40 +02:00
|
|
|
zip -r browser-source.zip browser-source
|
2023-09-13 16:21:02 +02:00
|
|
|
|
|
|
|
- name: NPM setup
|
|
|
|
run: npm ci
|
|
|
|
working-directory: browser-source/
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: npm run dist
|
|
|
|
working-directory: browser-source/apps/browser
|
|
|
|
|
2024-04-17 16:38:47 +02:00
|
|
|
- name: Build Manifest v3
|
|
|
|
run: npm run dist:mv3
|
|
|
|
working-directory: browser-source/apps/browser
|
2023-09-13 16:21:02 +02:00
|
|
|
|
2024-04-26 21:15:36 +02:00
|
|
|
- name: Build Chrome Manifest v3 Beta
|
|
|
|
run: npm run dist:chrome:beta
|
|
|
|
working-directory: browser-source/apps/browser
|
|
|
|
|
2021-09-02 22:03:47 +02:00
|
|
|
- name: Upload Opera artifact
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2021-02-02 00:27:08 +01:00
|
|
|
with:
|
2021-09-02 22:03:47 +02:00
|
|
|
name: dist-opera-${{ env._BUILD_NUMBER }}.zip
|
2023-09-13 16:21:02 +02:00
|
|
|
path: browser-source/apps/browser/dist/dist-opera.zip
|
2021-09-14 21:03:36 +02:00
|
|
|
if-no-files-found: error
|
2021-02-02 00:27:08 +01:00
|
|
|
|
2024-08-15 16:54:18 +02:00
|
|
|
- name: Upload Opera MV3 artifact (DO NOT USE FOR PROD)
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2024-08-15 16:54:18 +02:00
|
|
|
with:
|
|
|
|
name: DO-NOT-USE-FOR-PROD-dist-opera-MV3-${{ env._BUILD_NUMBER }}.zip
|
|
|
|
path: browser-source/apps/browser/dist/dist-opera-mv3.zip
|
|
|
|
if-no-files-found: error
|
2022-12-05 16:04:04 +01:00
|
|
|
|
2024-06-14 18:59:47 +02:00
|
|
|
- name: Upload Chrome MV3 artifact
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2021-02-02 00:27:08 +01:00
|
|
|
with:
|
2024-06-14 18:59:47 +02:00
|
|
|
name: dist-chrome-MV3-${{ env._BUILD_NUMBER }}.zip
|
2024-04-16 23:35:53 +02:00
|
|
|
path: browser-source/apps/browser/dist/dist-chrome-mv3.zip
|
|
|
|
if-no-files-found: error
|
2022-08-18 18:07:02 +02:00
|
|
|
|
2024-04-26 21:15:36 +02:00
|
|
|
- name: Upload Chrome MV3 Beta artifact (DO NOT USE FOR PROD)
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2024-04-26 21:15:36 +02:00
|
|
|
with:
|
|
|
|
name: DO-NOT-USE-FOR-PROD-dist-chrome-MV3-beta-${{ env._BUILD_NUMBER }}.zip
|
|
|
|
path: browser-source/apps/browser/dist/dist-chrome-mv3-beta.zip
|
|
|
|
if-no-files-found: error
|
|
|
|
|
2021-09-02 22:03:47 +02:00
|
|
|
- name: Upload Firefox artifact
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2021-02-02 00:27:08 +01:00
|
|
|
with:
|
2021-09-02 22:03:47 +02:00
|
|
|
name: dist-firefox-${{ env._BUILD_NUMBER }}.zip
|
2023-09-13 16:21:02 +02:00
|
|
|
path: browser-source/apps/browser/dist/dist-firefox.zip
|
2021-09-14 21:03:36 +02:00
|
|
|
if-no-files-found: error
|
2021-02-02 00:27:08 +01:00
|
|
|
|
2024-08-15 16:54:18 +02:00
|
|
|
- name: Upload Firefox MV3 artifact (DO NOT USE FOR PROD)
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2024-08-15 16:54:18 +02:00
|
|
|
with:
|
|
|
|
name: DO-NOT-USE-FOR-PROD-dist-firefox-MV3-${{ env._BUILD_NUMBER }}.zip
|
|
|
|
path: browser-source/apps/browser/dist/dist-firefox-mv3.zip
|
|
|
|
if-no-files-found: error
|
|
|
|
|
2021-09-02 22:03:47 +02:00
|
|
|
- name: Upload Edge artifact
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2021-02-02 00:27:08 +01:00
|
|
|
with:
|
2021-09-02 22:03:47 +02:00
|
|
|
name: dist-edge-${{ env._BUILD_NUMBER }}.zip
|
2023-09-13 16:21:02 +02:00
|
|
|
path: browser-source/apps/browser/dist/dist-edge.zip
|
2021-09-14 21:03:36 +02:00
|
|
|
if-no-files-found: error
|
2021-02-02 00:27:08 +01:00
|
|
|
|
2024-08-15 16:54:18 +02:00
|
|
|
- name: Upload Edge MV3 artifact (DO NOT USE FOR PROD)
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2024-08-15 16:54:18 +02:00
|
|
|
with:
|
|
|
|
name: DO-NOT-USE-FOR-PROD-dist-edge-MV3-${{ env._BUILD_NUMBER }}.zip
|
|
|
|
path: browser-source/apps/browser/dist/dist-edge-mv3.zip
|
|
|
|
if-no-files-found: error
|
2022-10-19 14:31:04 +02:00
|
|
|
|
2021-09-28 00:55:53 +02:00
|
|
|
- name: Upload browser source
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2021-09-28 00:55:53 +02:00
|
|
|
with:
|
|
|
|
name: browser-source-${{ env._BUILD_NUMBER }}.zip
|
2022-06-09 18:31:13 +02:00
|
|
|
path: browser-source.zip
|
2021-09-28 00:55:53 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
2022-05-18 16:31:02 +02:00
|
|
|
build-safari:
|
|
|
|
name: Build Safari
|
2024-02-08 21:57:25 +01:00
|
|
|
runs-on: macos-13
|
2022-05-18 16:31:02 +02:00
|
|
|
needs:
|
|
|
|
- setup
|
|
|
|
- locales-test
|
|
|
|
env:
|
|
|
|
_BUILD_NUMBER: ${{ needs.setup.outputs.adj_build_number }}
|
2023-10-04 18:23:40 +02:00
|
|
|
_NODE_VERSION: ${{ needs.setup.outputs.node_version }}
|
2022-05-18 16:31:02 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-09-30 11:46:20 +02:00
|
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
2022-05-18 16:31:02 +02:00
|
|
|
|
|
|
|
- name: Set up Node
|
2024-09-24 17:35:01 +02:00
|
|
|
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
|
2022-05-18 16:31:02 +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-18 16:31:02 +02:00
|
|
|
|
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
node --version
|
|
|
|
npm --version
|
|
|
|
|
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-18 16:31:02 +02:00
|
|
|
env:
|
2024-02-28 19:06:50 +01:00
|
|
|
ACCOUNT_NAME: bitwardenci
|
|
|
|
CONTAINER_NAME: profiles
|
2022-05-18 16:31:02 +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-18 16:31:02 +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-18 16:31:02 +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-18 16:31:02 +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-18 16:31:02 +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-18 16:31:02 +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-18 16:31:02 +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-18 16:31:02 +02:00
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
2024-02-28 19:06:50 +01:00
|
|
|
|
2022-05-18 16:31:02 +02:00
|
|
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain
|
|
|
|
|
2022-06-02 15:18:29 +02:00
|
|
|
- name: NPM setup
|
|
|
|
run: npm ci
|
|
|
|
working-directory: ./
|
|
|
|
|
2022-05-18 16:31:02 +02:00
|
|
|
- name: Build Safari extension
|
2022-06-02 15:18:29 +02:00
|
|
|
run: npm run dist:safari
|
2022-05-18 16:31:02 +02:00
|
|
|
working-directory: apps/browser
|
|
|
|
|
|
|
|
- name: Zip Safari build artifact
|
|
|
|
run: |
|
|
|
|
cd apps/browser/dist
|
|
|
|
zip dist-safari.zip ./Safari/**/build/Release/safari.appex -r
|
|
|
|
pwd
|
|
|
|
ls -la
|
|
|
|
|
|
|
|
- name: Upload Safari artifact
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
2022-05-18 16:31:02 +02:00
|
|
|
with:
|
|
|
|
name: dist-safari-${{ env._BUILD_NUMBER }}.zip
|
|
|
|
path: apps/browser/dist/dist-safari.zip
|
|
|
|
if-no-files-found: error
|
2021-10-13 23:54:22 +02:00
|
|
|
|
2021-11-04 21:02:06 +01:00
|
|
|
crowdin-push:
|
|
|
|
name: Crowdin Push
|
2023-12-12 20:57:50 +01:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2023-09-06 15:51:40 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-11-04 21:02:06 +01:00
|
|
|
needs:
|
|
|
|
- build
|
2022-05-18 16:31:02 +02:00
|
|
|
- build-safari
|
2021-11-04 21:02:06 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2024-09-30 11:46:20 +02:00
|
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
2021-11-04 21:02:06 +01:00
|
|
|
|
|
|
|
- name: Login to Azure
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2021-11-04 21:02:06 +01:00
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
2021-11-04 21:02:06 +01: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"
|
2021-11-04 21:02:06 +01:00
|
|
|
|
|
|
|
- name: Upload Sources
|
2024-09-04 15:44:00 +02:00
|
|
|
uses: crowdin/github-action@30849777a3cba6ee9a09e24e195272b8287a0a5b # v1.20.4
|
2021-11-04 21:02:06 +01: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: "268134"
|
2021-11-04 21:02:06 +01:00
|
|
|
with:
|
2022-05-04 14:37:24 +02:00
|
|
|
config: apps/browser/crowdin.yml
|
2023-12-12 20:57:50 +01:00
|
|
|
crowdin_branch_name: main
|
2021-11-04 21:02:06 +01:00
|
|
|
upload_sources: true
|
|
|
|
upload_translations: false
|
|
|
|
|
2021-10-13 23:54:22 +02:00
|
|
|
check-failures:
|
|
|
|
name: Check for failures
|
|
|
|
if: always()
|
2023-09-06 15:51:40 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2021-10-13 23:54:22 +02:00
|
|
|
needs:
|
|
|
|
- setup
|
|
|
|
- locales-test
|
|
|
|
- build
|
2022-05-18 16:31:02 +02:00
|
|
|
- build-safari
|
2021-11-04 21:02:06 +01:00
|
|
|
- crowdin-push
|
2021-10-13 23:54:22 +02:00
|
|
|
steps:
|
|
|
|
- name: Check if any job failed
|
2024-03-06 14:59:18 +01:00
|
|
|
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc') && contains(needs.*.result, 'failure')
|
|
|
|
run: exit 1
|
2021-11-04 21:02:06 +01:00
|
|
|
|
2021-10-13 23:54:22 +02:00
|
|
|
- name: Login to Azure - Prod Subscription
|
2024-02-08 20:38:19 +01:00
|
|
|
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
|
2021-10-13 23:54:22 +02:00
|
|
|
if: failure()
|
|
|
|
with:
|
2023-04-11 18:37:58 +02:00
|
|
|
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
|
2021-10-13 23:54:22 +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"
|
2021-10-13 23:54:22 +02:00
|
|
|
|
|
|
|
- name: Notify Slack on failure
|
2024-08-26 22:45:28 +02:00
|
|
|
uses: act10ns/slack@44541246747a30eb3102d87f7a4cc5471b0ffb7d # v2.1.0
|
2021-10-13 23:54:22 +02:00
|
|
|
if: failure()
|
|
|
|
env:
|
|
|
|
SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }}
|
|
|
|
with:
|
|
|
|
status: ${{ job.status }}
|