Release version: Commit 80d8d8b7745c9483503a57abf74e76e4317846d7 #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build release | |
run-name: 'Release version: Commit ${{ github.sha }}' | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Release version' | |
required: false | |
isAutoUpdateDisabled: | |
description: 'Is auto-update disabled (true / 1)?' | |
required: false | |
isBfxApiStaging: | |
description: 'Is it necessary to use BFX API Staging? (true / 1)?' | |
required: false | |
isNotarizeDisabled: | |
description: 'Is notarize disabled (true / 1)?' | |
required: false | |
env: | |
DOCKER_BUILDKIT: 1 | |
COMPOSE_DOCKER_CLI_BUILD: 1 | |
jobs: | |
linux-win-docker-builder: | |
timeout-minutes: 90 | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set repo owner | |
run: | | |
sed -i -e \ | |
"s/owner: '.*'/owner: '${{ github.repository_owner }}'/g" \ | |
"./electron-builder-config.js" | |
- if: github.event.inputs.version != '' | |
name: Set release version | |
run: | | |
sed -i -e \ | |
"s/\"version\": \".*\"/\"version\": \"${{ github.event.inputs.version }}\"/g" \ | |
"./package.json" | |
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isAutoUpdateDisabled) | |
name: Turn off auto-update | |
run: | | |
echo "IS_AUTO_UPDATE_DISABLED=1" >> $GITHUB_ENV | |
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isBfxApiStaging) | |
name: Use BFX API Staging for queries | |
run: | | |
echo "IS_BFX_API_STAGING=1" >> $GITHUB_ENV | |
- name: Cache Electron binaries | |
id: electron-cache | |
uses: actions/cache@v3 | |
env: | |
cache-name: electron-cache-v1 | |
with: | |
path: | | |
~/.cache/electron | |
~/.cache/electron-builder | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
- name: Build release | |
id: release-builder | |
uses: nick-fields/retry@v2 | |
continue-on-error: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
timeout_minutes: 20 | |
retry_wait_seconds: 10 | |
max_attempts: 3 | |
retry_on: any | |
command: ./scripts/launch.sh -lwp | |
- name: Zip Linux Unpacked build | |
run: zip -r dist/linux-unpacked.zip dist/linux-unpacked | |
- name: Upload Linux Unpacked build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-unpacked | |
path: dist/linux-unpacked.zip | |
- name: Zip Win Unpacked build | |
run: zip -r dist/win-unpacked.zip dist/win-unpacked | |
- name: Upload Win Unpacked build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: win-unpacked | |
path: dist/win-unpacked.zip | |
- name: Prepare cache folders | |
run: | | |
sudo chown -R $(id -u):$(id -g) ~/.cache/electron | |
sudo chown -R $(id -u):$(id -g) ~/.cache/electron-builder | |
mac-builder: | |
timeout-minutes: 150 | |
runs-on: macos-12 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Replace macOS’s sed with GNU’s sed | |
run: | | |
brew install gnu-sed | |
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH | |
- name: Set repo owner | |
run: | | |
sed -i -e \ | |
"s/owner: '.*'/owner: '${{ github.repository_owner }}'/g" \ | |
"./electron-builder-config.js" | |
- if: github.event.inputs.version != '' | |
name: Set release version | |
run: | | |
sed -i -e \ | |
"s/\"version\": \".*\"/\"version\": \"${{ github.event.inputs.version }}\"/g" \ | |
"./package.json" | |
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isAutoUpdateDisabled) | |
name: Turn off auto-update | |
run: | | |
echo "IS_AUTO_UPDATE_DISABLED=1" >> $GITHUB_ENV | |
- if: ${{ !contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isNotarizeDisabled) }} | |
name: Turn on notarize | |
run: | | |
echo "NOTARIZE=1" >> $GITHUB_ENV | |
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isBfxApiStaging) | |
name: Use BFX API Staging for queries | |
run: | | |
echo "IS_BFX_API_STAGING=1" >> $GITHUB_ENV | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17.1 | |
- name: Cache Electron binaries | |
id: electron-cache | |
uses: actions/cache@v3 | |
env: | |
cache-name: electron-cache-v1 | |
with: | |
path: | | |
${{ runner.temp }}/.cache/electron | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
- name: Build release | |
id: release-builder | |
uses: nick-fields/retry@v2 | |
continue-on-error: false | |
env: | |
APPLE_TEAM_ID: ${{ secrets.BFX_APPLE_TEAM_ID }} | |
APPLE_ID: ${{ secrets.BFX_APPLE_ID_USERNAME }} | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.BFX_APPLE_ID_REPORT_PASSWORD }} | |
CSC_LINK: ${{ secrets.BFX_APPLE_BUILD_CERTIFICATE_B64 }} | |
CSC_KEY_PASSWORD: ${{ secrets.BFX_APPLE_BUILD_CERTIFICATE_PASSWORD }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ELECTRON_CACHE: ${{ runner.temp }}/.cache/electron | |
with: | |
timeout_minutes: 40 | |
retry_wait_seconds: 10 | |
max_attempts: 3 | |
retry_on: any | |
command: | | |
if [[ -z "${APPLE_TEAM_ID}" || "${NOTARIZE:-}" != "1" ]]; then unset NOTARIZE; fi | |
if [[ -z "${APPLE_TEAM_ID}" || "${NOTARIZE:-}" != "1" ]]; then unset APPLE_TEAM_ID; fi | |
if [[ -z "${APPLE_ID}" || "${NOTARIZE:-}" != "1" ]]; then unset APPLE_ID; fi | |
if [[ -z "${APPLE_APP_SPECIFIC_PASSWORD}" || "${NOTARIZE:-}" != "1" ]]; then unset APPLE_APP_SPECIFIC_PASSWORD; fi | |
if [[ -z "${CSC_LINK}" || "${NOTARIZE:-}" != "1" ]]; then unset CSC_LINK; fi | |
if [[ -z "${CSC_KEY_PASSWORD}" || "${NOTARIZE:-}" != "1" ]]; then unset CSC_KEY_PASSWORD; fi | |
./scripts/build-release.sh -mp | |
- name: Zip Mac Unpacked build | |
run: zip -r dist/mac.zip dist/mac | |
- name: Upload Mac Unpacked build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mac-unpacked | |
path: dist/mac.zip | |
linux-e2e-test-runner: | |
name: Linux E2E Test Runner | |
timeout-minutes: 30 | |
runs-on: ubuntu-22.04 | |
needs: [linux-win-docker-builder] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17.1 | |
- name: Install main dev deps | |
run: npm i --development --no-audit --progress=false --force | |
- name: Download Linux Unpacked build | |
uses: actions/download-artifact@v3 | |
with: | |
name: linux-unpacked | |
path: dist | |
- name: Unzip Linux Unpacked build | |
run: unzip dist/linux-unpacked.zip | |
- name: Run tests | |
uses: coactions/setup-xvfb@v1.0.1 | |
with: | |
run: npm run e2e | |
- name: Normalize E2E test report | |
run: node ./scripts/node/normalize-e2e-test-report e2e-test-report.xml | |
- name: Upload Linux E2E test results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-e2e-test-results | |
path: e2e-test-report.xml | |
win-e2e-test-runner: | |
name: Win E2E Test Runner | |
timeout-minutes: 30 | |
runs-on: windows-2022 | |
needs: [linux-win-docker-builder] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17.1 | |
- name: Install main dev deps | |
run: npm i --development --no-audit --progress=false --force | |
- name: Download Linux Unpacked build | |
uses: actions/download-artifact@v3 | |
with: | |
name: win-unpacked | |
path: dist | |
- name: Unzip Win Unpacked build | |
run: 7z -y x dist/win-unpacked.zip | |
- name: Run tests | |
uses: coactions/setup-xvfb@v1.0.1 | |
with: | |
run: npm run e2e | |
- name: Normalize E2E test report | |
run: node ./scripts/node/normalize-e2e-test-report e2e-test-report.xml | |
- name: Upload Win E2E test results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: win-e2e-test-results | |
path: e2e-test-report.xml | |
mac-e2e-test-runner: | |
name: Mac E2E Test Runner | |
timeout-minutes: 30 | |
runs-on: macos-12 | |
needs: [mac-builder] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare Mac runner | |
uses: ./.github/actions/prepare-mac-runner | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.17.1 | |
- name: Install main dev deps | |
run: npm i --development --no-audit --progress=false --force | |
- name: Download Mac Unpacked build | |
uses: actions/download-artifact@v3 | |
with: | |
name: mac-unpacked | |
path: dist | |
- name: Unzip Mac Unpacked build | |
run: unzip dist/mac.zip | |
- name: Run tests | |
uses: coactions/setup-xvfb@v1.0.1 | |
with: | |
run: npm run e2e | |
- name: Normalize E2E test report | |
run: node ./scripts/node/normalize-e2e-test-report e2e-test-report.xml | |
- name: Upload Mac E2E test results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mac-e2e-test-results | |
path: e2e-test-report.xml |