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:
|
|
|
|
- 'master'
|
|
|
|
- '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:
|
|
|
|
cloc:
|
2021-09-02 22:03:47 +02:00
|
|
|
name: CLOC
|
2021-09-28 00:55:53 +02:00
|
|
|
runs-on: ubuntu-20.04
|
2021-02-02 00:27:08 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2022-05-03 20:01:37 +02:00
|
|
|
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
|
2021-02-02 00:27:08 +01:00
|
|
|
|
|
|
|
- name: Set up cloc
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt -y install cloc
|
2022-05-04 16:59:05 +02:00
|
|
|
|
2021-02-02 00:27:08 +01:00
|
|
|
- name: Print lines of code
|
|
|
|
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
|
|
|
|
2022-03-15 22:08:43 +01:00
|
|
|
|
2021-02-02 00:27:08 +01:00
|
|
|
setup:
|
2021-09-02 22:03:47 +02:00
|
|
|
name: Setup
|
2021-09-28 00:55:53 +02:00
|
|
|
runs-on: ubuntu-20.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 }}
|
|
|
|
steps:
|
|
|
|
- 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
|
|
|
|
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
|
2021-09-28 00:55:53 +02:00
|
|
|
runs-on: ubuntu-20.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
|
2022-05-03 20:01:37 +02:00
|
|
|
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.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
|
2021-09-28 00:55:53 +02:00
|
|
|
runs-on: windows-2019
|
|
|
|
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 }}
|
2022-05-04 16:59:05 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: apps/browser
|
2021-05-13 01:52:27 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2022-05-03 20:01:37 +02:00
|
|
|
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
|
2021-05-13 01:52:27 +02:00
|
|
|
|
|
|
|
- name: Set up Node
|
2022-06-09 18:31:13 +02:00
|
|
|
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
|
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'
|
2021-12-10 16:11:44 +01:00
|
|
|
node-version: '16'
|
2021-05-13 01:52:27 +02:00
|
|
|
|
2022-06-02 15:18:29 +02:00
|
|
|
- name: Install node-gyp
|
|
|
|
run: |
|
|
|
|
npm install -g node-gyp
|
|
|
|
node-gyp install $(node -v)
|
|
|
|
|
2021-05-13 01:52:27 +02:00
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
node --version
|
|
|
|
npm --version
|
|
|
|
|
2022-06-02 15:18:29 +02:00
|
|
|
- name: NPM setup
|
|
|
|
run: npm ci
|
|
|
|
working-directory: ./
|
|
|
|
|
2022-08-25 10:06:31 +02:00
|
|
|
- name: Build
|
2022-10-19 17:22:57 +02:00
|
|
|
run: npm run dist
|
2021-02-02 00:27:08 +01:00
|
|
|
|
2022-08-18 18:07:02 +02:00
|
|
|
- name: Build Manifest v3
|
2022-10-19 17:22:57 +02:00
|
|
|
run: npm run dist:mv3
|
2022-08-18 18:07:02 +02:00
|
|
|
|
2021-09-02 22:03:47 +02:00
|
|
|
- name: Gulp
|
2021-02-02 00:27:08 +01:00
|
|
|
run: gulp ci
|
2021-02-02 18:56:34 +01:00
|
|
|
|
2021-09-28 00:55:53 +02:00
|
|
|
- name: Build sources for reviewers
|
|
|
|
shell: cmd
|
|
|
|
run: |
|
2022-06-09 18:31:13 +02:00
|
|
|
REM Remove ".git" directory
|
|
|
|
rmdir /S /Q ".git"
|
|
|
|
|
|
|
|
REM Copy root level files to source directory
|
|
|
|
mkdir browser-source
|
|
|
|
copy * browser-source
|
|
|
|
|
|
|
|
REM Copy apps\browser to Browser source directory
|
|
|
|
mkdir browser-source\apps\browser
|
|
|
|
xcopy apps\browser\* browser-source\apps\browser /E
|
2022-06-20 18:23:11 +02:00
|
|
|
|
2022-06-09 18:31:13 +02:00
|
|
|
REM Copy libs to Browser source directory
|
|
|
|
mkdir browser-source\libs
|
|
|
|
xcopy libs\* browser-source\libs /E
|
|
|
|
|
|
|
|
call 7z a browser-source.zip "browser-source\*"
|
|
|
|
working-directory: ./
|
2021-09-28 00:55:53 +02:00
|
|
|
|
2021-09-02 22:03:47 +02:00
|
|
|
- name: Upload Opera artifact
|
2022-05-04 16:59:05 +02:00
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.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
|
2022-05-03 20:25:18 +02:00
|
|
|
path: 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
|
|
|
|
2022-10-19 14:31:04 +02:00
|
|
|
- name: Upload Opera MV3 artifact
|
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
|
|
|
|
with:
|
|
|
|
name: dist-opera-MV3-${{ env._BUILD_NUMBER }}.zip
|
|
|
|
path: apps/browser/dist/dist-opera-mv3.zip
|
|
|
|
if-no-files-found: error
|
2022-12-05 16:04:04 +01:00
|
|
|
|
2021-09-02 22:03:47 +02:00
|
|
|
- name: Upload Chrome artifact
|
2022-05-03 20:01:37 +02:00
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
|
2021-02-02 00:27:08 +01:00
|
|
|
with:
|
2021-09-02 22:03:47 +02:00
|
|
|
name: dist-chrome-${{ env._BUILD_NUMBER }}.zip
|
2022-05-03 20:25:18 +02:00
|
|
|
path: apps/browser/dist/dist-chrome.zip
|
2021-09-14 21:03:36 +02:00
|
|
|
if-no-files-found: error
|
2021-02-02 00:27:08 +01:00
|
|
|
|
2022-08-18 18:07:02 +02:00
|
|
|
- name: Upload Chrome MV3 artifact
|
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
|
|
|
|
with:
|
|
|
|
name: dist-chrome-MV3-${{ env._BUILD_NUMBER }}.zip
|
2022-10-19 14:31:04 +02:00
|
|
|
path: apps/browser/dist/dist-chrome-mv3.zip
|
2022-08-18 18:07:02 +02:00
|
|
|
if-no-files-found: error
|
|
|
|
|
2021-09-02 22:03:47 +02:00
|
|
|
- name: Upload Firefox artifact
|
2022-05-03 20:01:37 +02:00
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.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
|
2022-05-03 20:25:18 +02:00
|
|
|
path: 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
|
|
|
|
2021-09-02 22:03:47 +02:00
|
|
|
- name: Upload Edge artifact
|
2022-05-03 20:01:37 +02:00
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.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
|
2022-05-03 20:25:18 +02:00
|
|
|
path: 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
|
|
|
|
2022-10-19 14:31:04 +02:00
|
|
|
- name: Upload Edge MV3 artifact
|
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
|
|
|
|
with:
|
|
|
|
name: dist-edge-MV3-${{ env._BUILD_NUMBER }}.zip
|
|
|
|
path: apps/browser/dist/dist-edge-mv3.zip
|
|
|
|
if-no-files-found: error
|
|
|
|
|
2021-09-28 00:55:53 +02:00
|
|
|
- name: Upload browser source
|
2022-05-03 20:01:37 +02:00
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.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
|
|
|
|
|
2021-02-02 22:27:15 +01:00
|
|
|
- name: Upload coverage artifact
|
2021-09-14 21:53:25 +02:00
|
|
|
if: false
|
2022-05-03 20:01:37 +02:00
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
|
2021-02-02 00:27:08 +01:00
|
|
|
with:
|
2021-09-02 22:03:47 +02:00
|
|
|
name: coverage-${{ env._BUILD_NUMBER }}.zip
|
2022-05-03 20:25:18 +02:00
|
|
|
path: apps/browser/coverage/coverage-${{ env._BUILD_NUMBER }}.zip
|
2021-09-14 21:03:36 +02:00
|
|
|
if-no-files-found: error
|
2021-10-13 23:54:22 +02:00
|
|
|
|
2022-05-18 16:31:02 +02:00
|
|
|
build-safari:
|
|
|
|
name: Build Safari
|
|
|
|
runs-on: macos-11
|
|
|
|
needs:
|
|
|
|
- setup
|
|
|
|
- locales-test
|
|
|
|
env:
|
|
|
|
_BUILD_NUMBER: ${{ needs.setup.outputs.adj_build_number }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
|
|
|
|
|
|
|
|
- name: Set up Node
|
2022-06-09 18:31:13 +02:00
|
|
|
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.3.0
|
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'
|
2022-05-18 16:31:02 +02:00
|
|
|
node-version: '16'
|
|
|
|
|
|
|
|
- name: Print environment
|
|
|
|
run: |
|
|
|
|
node --version
|
|
|
|
npm --version
|
|
|
|
|
|
|
|
- name: Decrypt secrets
|
|
|
|
env:
|
|
|
|
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/secrets
|
|
|
|
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
|
|
|
--output "$HOME/secrets/bitwarden-desktop-key.p12" \
|
|
|
|
"$GITHUB_WORKSPACE/.github/secrets/bitwarden-desktop-key.p12.gpg"
|
|
|
|
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
|
|
|
--output "$HOME/secrets/appstore-app-cert.p12" \
|
|
|
|
"$GITHUB_WORKSPACE/.github/secrets/appstore-app-cert.p12.gpg"
|
|
|
|
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
|
|
|
--output "$HOME/secrets/appstore-installer-cert.p12" \
|
|
|
|
"$GITHUB_WORKSPACE/.github/secrets/appstore-installer-cert.p12.gpg"
|
|
|
|
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
|
|
|
--output "$HOME/secrets/devid-app-cert.p12" \
|
|
|
|
"$GITHUB_WORKSPACE/.github/secrets/devid-app-cert.p12.gpg"
|
|
|
|
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
|
|
|
--output "$HOME/secrets/devid-installer-cert.p12" \
|
|
|
|
"$GITHUB_WORKSPACE/.github/secrets/devid-installer-cert.p12.gpg"
|
|
|
|
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
|
|
|
--output "$HOME/secrets/macdev-cert.p12" \
|
|
|
|
"$GITHUB_WORKSPACE/.github/secrets/macdev-cert.p12.gpg"
|
|
|
|
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
|
|
|
|
--output "$HOME/secrets/bitwarden_desktop_appstore.provisionprofile" \
|
|
|
|
"$GITHUB_WORKSPACE/.github/secrets/bitwarden_desktop_appstore.provisionprofile.gpg"
|
|
|
|
|
|
|
|
- name: Set up keychain
|
|
|
|
env:
|
|
|
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
|
|
DESKTOP_KEY_PASSWORD: ${{ secrets.DESKTOP_KEY_PASSWORD }}
|
|
|
|
DEVID_CERT_PASSWORD: ${{ secrets.DEVID_CERT_PASSWORD }}
|
|
|
|
APPSTORE_CERT_PASSWORD: ${{ secrets.APPSTORE_CERT_PASSWORD }}
|
|
|
|
MACDEV_CERT_PASSWORD: ${{ secrets.MACDEV_CERT_PASSWORD }}
|
|
|
|
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_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
|
|
|
|
security import "$HOME/secrets/bitwarden-desktop-key.p12" -k build.keychain -P $DESKTOP_KEY_PASSWORD \
|
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
|
|
security import "$HOME/secrets/devid-app-cert.p12" -k build.keychain -P $DEVID_CERT_PASSWORD \
|
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
|
|
security import "$HOME/secrets/devid-installer-cert.p12" -k build.keychain -P $DEVID_CERT_PASSWORD \
|
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
|
|
security import "$HOME/secrets/appstore-app-cert.p12" -k build.keychain -P $APPSTORE_CERT_PASSWORD \
|
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
|
|
security import "$HOME/secrets/appstore-installer-cert.p12" -k build.keychain -P $APPSTORE_CERT_PASSWORD \
|
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
|
|
security import "$HOME/secrets/macdev-cert.p12" -k build.keychain -P $MACDEV_CERT_PASSWORD \
|
|
|
|
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/productbuild
|
|
|
|
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
|
|
|
|
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
|
|
|
|
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
|
2021-11-04 21:04:59 +01:00
|
|
|
if: github.ref == 'refs/heads/master'
|
2021-11-04 21:02:06 +01:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs:
|
|
|
|
- build
|
2022-05-18 16:31:02 +02:00
|
|
|
- build-safari
|
2021-11-04 21:02:06 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout repo
|
2022-05-03 20:01:37 +02:00
|
|
|
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
|
2021-11-04 21:02:06 +01:00
|
|
|
|
|
|
|
- name: Login to Azure
|
2022-10-19 17:22:57 +02:00
|
|
|
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2
|
2021-11-04 21:02:06 +01:00
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
|
|
|
|
|
|
|
- name: Retrieve secrets
|
|
|
|
id: retrieve-secrets
|
2022-10-19 17:22:57 +02:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@471ae4aec27405f16c5b796e288f54262c406e5d
|
2022-10-13 21:38:47 +02:00
|
|
|
with:
|
|
|
|
keyvault: "bitwarden-prod-kv"
|
|
|
|
secrets: "crowdin-api-token"
|
2021-11-04 21:02:06 +01:00
|
|
|
|
|
|
|
- name: Upload Sources
|
2022-05-09 15:53:48 +02:00
|
|
|
uses: crowdin/github-action@ecd7eb0ef6f3cfa16293c79e9cbc4bc5b5fd9c49 # v1.4.9
|
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
|
2021-11-04 21:02:06 +01:00
|
|
|
crowdin_branch_name: master
|
|
|
|
upload_sources: true
|
|
|
|
upload_translations: false
|
|
|
|
|
2021-10-13 23:54:22 +02:00
|
|
|
check-failures:
|
|
|
|
name: Check for failures
|
|
|
|
if: always()
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs:
|
|
|
|
- cloc
|
|
|
|
- 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
|
2021-10-15 19:07:15 +02:00
|
|
|
if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') }}
|
2021-10-13 23:54:22 +02:00
|
|
|
env:
|
|
|
|
CLOC_STATUS: ${{ needs.cloc.result }}
|
|
|
|
SETUP_STATUS: ${{ needs.setup.result }}
|
|
|
|
LOCALES_TEST_STATUS: ${{ needs.locales-test.result }}
|
|
|
|
BUILD_STATUS: ${{ needs.build.result }}
|
2022-05-18 16:31:02 +02:00
|
|
|
SAFARI_BUILD_STATUS: ${{ needs.build-safari.result }}
|
2021-11-04 21:02:06 +01:00
|
|
|
CROWDIN_PUSH_STATUS: ${{ needs.crowdin-push.result }}
|
2021-10-13 23:54:22 +02:00
|
|
|
run: |
|
|
|
|
if [ "$CLOC_STATUS" = "failure" ]; then
|
|
|
|
exit 1
|
|
|
|
elif [ "$SETUP_STATUS" = "failure" ]; then
|
|
|
|
exit 1
|
|
|
|
elif [ "$LOCALES_TEST_STATUS" = "failure" ]; then
|
|
|
|
exit 1
|
|
|
|
elif [ "$BUILD_STATUS" = "failure" ]; then
|
|
|
|
exit 1
|
2022-05-18 16:31:02 +02:00
|
|
|
elif [ "$SAFARI_BUILD_STATUS" = "failure" ]; then
|
|
|
|
exit 1
|
2021-11-04 21:02:06 +01:00
|
|
|
elif [ "$CROWDIN_PUSH_STATUS" = "failure" ]; then
|
|
|
|
exit 1
|
2021-10-13 23:54:22 +02:00
|
|
|
fi
|
2021-11-04 21:02:06 +01:00
|
|
|
|
2021-10-13 23:54:22 +02:00
|
|
|
- name: Login to Azure - Prod Subscription
|
2022-10-19 17:22:57 +02:00
|
|
|
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2
|
2021-10-13 23:54:22 +02:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
|
|
|
|
|
|
|
- name: Retrieve secrets
|
|
|
|
id: retrieve-secrets
|
|
|
|
if: failure()
|
2022-10-19 17:22:57 +02:00
|
|
|
uses: bitwarden/gh-actions/get-keyvault-secrets@471ae4aec27405f16c5b796e288f54262c406e5d
|
2022-10-13 21:38:47 +02:00
|
|
|
with:
|
|
|
|
keyvault: "bitwarden-prod-kv"
|
|
|
|
secrets: "devops-alerts-slack-webhook-url"
|
2021-10-13 23:54:22 +02:00
|
|
|
|
|
|
|
- name: Notify Slack on failure
|
2022-05-03 20:01:37 +02:00
|
|
|
uses: act10ns/slack@da3191ebe2e67f49b46880b4633f5591a96d1d33 # v1.5.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 }}
|