Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 4.18.0 #306

Merged
merged 24 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a5b685e
Provide apple credential env vars to mac-builder workflow
ZIMkaRU Nov 14, 2023
83bda1e
Add apple credential env vars to .env file
ZIMkaRU Nov 14, 2023
6699674
Add required apple app sandbox entitlements
ZIMkaRU Nov 14, 2023
6a5c610
Add mac dmg target release
ZIMkaRU Nov 14, 2023
2febf24
Set mac type opt as distribution
ZIMkaRU Nov 14, 2023
e4a1567
Enable dark mode support for mac
ZIMkaRU Nov 14, 2023
b323193
Hardcode 11 minimum system version for mac
ZIMkaRU Nov 14, 2023
5931d6e
Add ability to set teamId from env var
ZIMkaRU Nov 14, 2023
fa19678
Add ability to turn off notarizing
ZIMkaRU Jan 9, 2024
e735d35
Imprive parsing env val to bool
ZIMkaRU Jan 9, 2024
c9fe9c7
Turn off apple app sandbox for standard darwin build
ZIMkaRU Jan 10, 2024
abb0eb6
Add ability to build zip release with native mac tool
ZIMkaRU Jan 12, 2024
c3b39bc
Fix arch opt for mac build
ZIMkaRU Jan 12, 2024
c20694c
Increase mac-builder timeout
ZIMkaRU Jan 12, 2024
cad4d38
Skip backup file creation on mac when using sed cli
ZIMkaRU Jan 15, 2024
eab5331
Fix mac release size to exclude cache dir
ZIMkaRU Jan 15, 2024
e6324f3
Replace macos sed with gnu sed
ZIMkaRU Jan 15, 2024
8571b61
Cleanup electron-builder config
ZIMkaRU Jan 16, 2024
b8c107b
Bump version up to v4.18.0
ZIMkaRU Jan 19, 2024
1b69762
Add changelog for v4.18.0
ZIMkaRU Jan 19, 2024
a1b52ee
Update sub-modules
ZIMkaRU Jan 31, 2024
0b24fc4
Extend changelog
ZIMkaRU Jan 31, 2024
f3f8b10
Merge pull request #299 from ZIMkaRU/feature/add-apple-signing-and-no…
ezewer Jan 31, 2024
44124ef
Merge pull request #305 from ZIMkaRU/feature/release-electron-app
ezewer Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ IS_DEV_ENV=0
IS_AUTO_UPDATE_DISABLED=0
EP_GH_IGNORE_TIME=true
GH_TOKEN=

NOTARIZE=0
APPLE_TEAM_ID=
APPLE_ID=
APPLE_APP_SPECIFIC_PASSWORD=
CSC_LINK=
CSC_KEY_PASSWORD=
33 changes: 28 additions & 5 deletions .github/workflows/build-electron-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ on:
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
Expand Down Expand Up @@ -96,13 +99,17 @@ jobs:
sudo chown -R $(id -u):$(id -g) ~/.cache/electron-builder

mac-builder:
timeout-minutes: 90
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 \
Expand All @@ -118,6 +125,10 @@ jobs:
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: |
Expand All @@ -132,7 +143,7 @@ jobs:
cache-name: electron-cache-v1
with:
path: |
~/Library/Caches/electron
${{ runner.temp }}/.cache/electron
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
Expand All @@ -141,14 +152,26 @@ jobs:
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: ~/Library/Caches/electron
ELECTRON_CACHE: ${{ runner.temp }}/.cache/electron
with:
timeout_minutes: 20
timeout_minutes: 40
retry_wait_seconds: 10
max_attempts: 3
retry_on: any
command: ./scripts/build-release.sh -mp
command: |
if [[ -z "${APPLE_TEAM_ID}" ]]; then unset NOTARIZE; fi
if [[ -z "${APPLE_TEAM_ID}" ]]; then unset APPLE_TEAM_ID; fi
if [[ -z "${APPLE_ID}" ]]; then unset APPLE_ID; fi
if [[ -z "${APPLE_APP_SPECIFIC_PASSWORD}" ]]; then unset APPLE_APP_SPECIFIC_PASSWORD; fi
if [[ -z "${CSC_LINK}" ]]; then unset CSC_LINK; fi
if [[ -z "${CSC_KEY_PASSWORD}" ]]; 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
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [4.18.0] - 2024-01-31

### Added

- Added Apple signing and notarization workflow. PR: [bfx-report-electron#299](https://github.com/bitfinexcom/bfx-report-electron/pull/299)
- Implemented users informing about the [platform maintenance](https://bitfinex.statuspage.io/) mode. PR: [bfx-report-ui#756](https://github.com/bitfinexcom/bfx-report-ui/pull/756)
- Implemented configurable balances representation `Filter` for the `Summary by Asset` section. PR: [bfx-report-ui#753](https://github.com/bitfinexcom/bfx-report-ui/pull/753)
- Implemented `Google Tag Manager` support for the `Reports` and events tracking. PR: [bfx-report-ui#762](https://github.com/bitfinexcom/bfx-report-ui/pull/762)

### Changed

- Improved user informing about the initial synchronization. PR: [bfx-report-ui#760](https://github.com/bitfinexcom/bfx-report-ui/pull/760)
- Improved login to sign in when `otp` length is `6`. PR: [bfx-report-ui#758](https://github.com/bitfinexcom/bfx-report-ui/pull/758)

### Fixed

- Fixed lint error. PR: [bfx-report-ui#763](https://github.com/bitfinexcom/bfx-report-ui/pull/763)

### Security

- Resolved `dependabot` dependency updates, bumped `follow-redirects` from `1.15.3` to `1.15.4`. PR: [bfx-report-ui#755](https://github.com/bitfinexcom/bfx-report-ui/pull/755)
- Replaced `Lodash` `_isObject` helper usage with the corresponding one from the internal library for security reasons. PR: [bfx-report-ui#761](https://github.com/bitfinexcom/bfx-report-ui/pull/761)

## [4.17.0] - 2024-01-10

### Added
Expand Down
2 changes: 1 addition & 1 deletion bfx-report-ui
Submodule bfx-report-ui updated 96 files
+2,530 −4,038 package-lock.json
+3 −1 package.json
+17 −1 public/locales/en/translations.json
+18 −8 src/components/AppSummary/AppSummary.byAsset.js
+102 −0 src/components/AppSummary/AppSummary.filters.js
+8 −3 src/components/AppSummary/AppSummary.helpers.js
+131 −3 src/components/AppSummary/_AppSummary.scss
+3 −0 src/components/Auth/Auth.js
+7 −3 src/components/Auth/InputKey/InputKey.js
+7 −1 src/components/Auth/LoginOtp/LoginOtp.js
+4 −0 src/components/Auth/PasswordRecovery/PasswordRecovery.js
+6 −0 src/components/Auth/SignIn/SignIn.js
+2 −0 src/components/Auth/SignInList/SignInList.menu.js
+6 −0 src/components/Auth/SignUp/SignUp.js
+3 −0 src/components/ErrorDialog/ErrorDialog.js
+1 −0 src/components/ExportDialog/ExportDialog.TargetsSelector.js
+10 −3 src/components/ExportDialog/ExportDialog.js
+8 −2 src/components/ExportSuccessDialog/ExportSuccessDialog.js
+7 −1 src/components/ExtraInfoDialog/ExtraInfoDialog.js
+8 −1 src/components/GoToRangeDialog/GoToRangeDialog.js
+18 −6 src/components/Header/AccountMenu/AccountMenu.js
+19 −11 src/components/Header/Export/Export.js
+6 −1 src/components/Header/HamburgerMenu/HamburgerMenu.js
+2 −0 src/components/Header/QueryMode/QueryMode.js
+19 −2 src/components/Header/SyncMode/SyncMode.container.js
+6 −4 src/components/Header/SyncMode/SyncMode.helpers.js
+85 −13 src/components/Header/SyncMode/SyncMode.js
+35 −0 src/components/Header/SyncMode/_SyncMode.scss
+9 −2 src/components/Header/TopNavigation/TopNavigation.js
+4 −0 src/components/Header/_Header.scss
+2 −0 src/components/Main/Main.js
+47 −0 src/components/MaintenanceDialog/MaintenanceDialog.js
+9 −0 src/components/MaintenanceDialog/_MaintenanceDialog.scss
+1 −0 src/components/MaintenanceDialog/index.js
+14 −3 src/components/Preferences/Preferences.js
+4 −2 src/components/SubAccounts/SubAccount/SubAccount.js
+9 −2 src/components/TimeFrameDialog/TimeFrameDialog.js
+3 −0 src/icons/filter-summary.svg
+2 −0 src/icons/index.js
+15 −0 src/state/summaryByAsset/actions.js
+2 −0 src/state/summaryByAsset/constants.js
+14 −0 src/state/summaryByAsset/reducer.js
+5 −1 src/state/summaryByAsset/selectors.js
+15 −0 src/state/sync/actions.js
+2 −0 src/state/sync/constants.js
+14 −0 src/state/sync/reducer.js
+8 −0 src/state/sync/saga.js
+4 −0 src/state/sync/selectors.js
+8 −0 src/state/ui/actions.js
+1 −0 src/state/ui/constants.js
+6 −0 src/state/ui/reducer.js
+2 −0 src/state/ui/selectors.js
+2 −0 src/state/ws/constants.js
+15 −1 src/state/ws/saga.js
+13 −0 src/styles/index.scss
+3 −0 src/styles/themes/_dark.scss
+3 −0 src/styles/themes/_light.scss
+1 −0 src/ui/BalancePrecisionSelector/BalancePrecisionSelector.js
+6 −2 src/ui/CandlesSyncPref/CandlesSyncPref.js
+16 −9 src/ui/ClearFiltersButton/ClearFiltersButton.js
+7 −4 src/ui/ColumnsFilter/ColumnsFilter.js
+4 −2 src/ui/ColumnsSelect/ColumnsSelect.js
+1 −0 src/ui/DateFormatSelector/DateFormatSelector.js
+2 −0 src/ui/DateInput/DateInput.js
+4 −0 src/ui/DerivativesSyncPref/DerivativesSyncPref.js
+17 −9 src/ui/GoToButton/GoToButton.js
+1 −0 src/ui/LangMenu/LangMenu.js
+1 −0 src/ui/LedgersCategorySelect/LedgersCategorySelect.js
+1 −0 src/ui/MultiPairSelector/MultiPairSelector.js
+3 −0 src/ui/MultiSelect/MultiSelect.js
+2 −0 src/ui/MultiSelect/MultiSymbolSelector.props.js
+15 −4 src/ui/NavMenu/NavMenu.js
+6 −1 src/ui/NavSwitcher/NavSwitcher.js
+8 −1 src/ui/QueryButton/QueryButton.js
+8 −1 src/ui/RefreshButton/RefreshButton.js
+1 −0 src/ui/ReportTypeSelector/ReportTypeSelector.js
+2 −1 src/ui/SectionSwitch/SectionSwitch.js
+9 −4 src/ui/Select/Select.js
+3 −0 src/ui/ShowMilliseconds/ShowMilliseconds.js
+1 −0 src/ui/SymbolSelector/SymbolSelector.js
+7 −1 src/ui/SyncAfterUpdatePref/SyncAfterUpdatePref.js
+4 −0 src/ui/SyncPrefButton/SyncPrefButton.js
+3 −0 src/ui/SyncSymbolPrefButton/SyncSymbolPrefButton.js
+7 −1 src/ui/TableScrollPref/TableScrollPref.js
+2 −0 src/ui/ThemeSwitcher/ThemeSwitcher.js
+19 −11 src/ui/TimeRange/TimeRange.js
+8 −1 src/ui/TimeRangePreservePref/TimeRangePreservePref.js
+2 −0 src/ui/TimezonePicker/TimezonePicker.js
+1 −0 src/ui/UnrealizedProfitSelector/UnrealizedProfitSelector.js
+25 −0 src/utils/api.js
+22 −0 src/utils/browser.js
+100 −0 src/utils/cookieBanner.js
+109 −0 src/utils/goggleTag.js
+63 −0 src/utils/logger.js
+39 −0 src/utils/trackers.js
+62 −0 src/var/platform.js
2 changes: 1 addition & 1 deletion bfx-reports-framework
10 changes: 9 additions & 1 deletion build/entitlements.mac.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<key>com.apple.security.inherit</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
Expand All @@ -22,5 +22,13 @@
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
<key>com.apple.security.automation.apple-events</key>
<true/>
</dict>
</plist>
10 changes: 8 additions & 2 deletions build/entitlements.mas.inherit.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.inherit</key>
<true/>
<key>com.apple.security.network.client</key>
Expand All @@ -24,5 +22,13 @@
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.debugger</key>
<true/>
<key>com.apple.security.automation.apple-events</key>
<true/>
</dict>
</plist>
41 changes: 35 additions & 6 deletions electron-builder-config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
'use strict'

require('dotenv').config()
const fs = require('fs')
const path = require('path')
const zlib = require('zlib')
const { promisify } = require('util')
const archiver = require('archiver')
const exec = promisify(require('child_process').exec)

const parseEnvValToBool = require(
'./src/helpers/parse-env-val-to-bool'
)

let version
let zippedAppImageArtifactPath
let zippedMacArtifactPath
const appOutDirs = new Map()
const isNotarize = parseEnvValToBool(process.env.NOTARIZE)
const arch = process.env.ARCH ?? 'x64'

// Notarize can be done only on MacOS
const macNotarize = (
process.platform === 'darwin' &&
isNotarize
)
? {
notarize: {
teamId: process.env.APPLE_TEAM_ID
}
}
: {}
// DMG can be built only on MacOS
const macSpecificTargets = process.platform === 'darwin'
? ['dmg', 'zip']
: []

/* eslint-disable no-template-curly-in-string */

Expand Down Expand Up @@ -60,7 +83,7 @@ module.exports = {
extends: null,
asar: false,
productName: 'Bitfinex Report',
artifactName: 'BitfinexReport-${version}-x64-${os}.${ext}',
artifactName: 'BitfinexReport-${version}-' + arch + '-${os}.${ext}',
appId: 'com.bitfinex.report',
publish: {
provider: 'github',
Expand Down Expand Up @@ -92,14 +115,18 @@ module.exports = {
verifyUpdateCodeSignature: false
},
mac: {
type: 'development',
type: 'distribution',
hardenedRuntime: true,
gatekeeperAssess: false,
entitlements: 'build/entitlements.mac.plist',
entitlementsInherit: 'build/entitlements.mas.inherit.plist',
category: 'public.app-category.finance',
minimumSystemVersion: '11',
darkModeSupport: true,
...macNotarize,
target: [
'dir'
'dir',
...macSpecificTargets
]
},
files: [
Expand Down Expand Up @@ -213,14 +240,16 @@ module.exports = {
? 'exe'
: targetName
const foundAppFilePath = artifactPaths.find((path) => (
new RegExp(`${targetPlatform}.*${ext}$`, 'i').test(path)
new RegExp(`${arch}.*${targetPlatform}.*${ext}$`, 'i').test(path)
))
const appFilePath = foundAppFilePath ?? path.join(
outDir,
`BitfinexReport-${version}-x64-${targetPlatform}.${ext}`
`BitfinexReport-${version}-${arch}-${targetPlatform}.${ext}`
)

if (
// Outside darwin zip release can't be built successfully
process.platform !== 'darwin' &&
targetPlatform === 'mac' &&
targetName === 'zip'
) {
Expand Down Expand Up @@ -261,7 +290,7 @@ module.exports = {
) {
zippedAppImageArtifactPath = path.join(
outDir,
`BitfinexReport-${version}-x64-${targetPlatform}.AppImage.zip`
`BitfinexReport-${version}-${arch}-${targetPlatform}.AppImage.zip`
)
await new Promise((resolve, reject) => {
try {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bfx-report-electron",
"version": "4.17.0",
"version": "4.18.0",
"repository": "https://github.com/bitfinexcom/bfx-report-electron",
"description": "Reporting tool",
"author": "bitfinex.com",
Expand Down Expand Up @@ -42,6 +42,7 @@
"@wdio/spec-reporter": "8.21.0",
"app-builder-bin": "4.2.0",
"cross-env": "7.0.3",
"dotenv": "16.3.1",
"electron": "27.2.0",
"electron-builder": "24.10.0",
"mocha": "10.2.0",
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ COLOR_YELLOW=${COLOR_YELLOW:-"\033[33m"}
COLOR_BLUE=${COLOR_BLUE:-"\033[34m"}
COLOR_NORMAL=${COLOR_NORMAL:-"\033[39m"}

ARCH="x64"
export ARCH=${ARCH:-"x64"}
BFX_API_URL="https://api-pub.bitfinex.com"
STAGING_BFX_API_URL="https://api.staging.bitfinex.com"

Expand Down Expand Up @@ -230,7 +230,7 @@ fi

rm -rf "$DIST_FOLDER/"*"$targetPlatform"*
node "$ROOT/node_modules/.bin/electron-builder" \
"build" "--$targetPlatform" \
"build" "--$targetPlatform" "--$ARCH" \
"--config" "$ELECTRON_BUILDER_CONFIG_FILE_PATH" \
$publishOption

Expand Down
3 changes: 2 additions & 1 deletion scripts/node/generate-mac-zipand-blockmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

'use strict'

require('dotenv').config()
const path = require('path')
const { chmodSync } = require('fs')
const {
Expand All @@ -24,7 +25,7 @@ const {
version: APP_VERSION
} = require(packageJsonPath)

const ARCH = 'x64'
const ARCH = process.env.ARCH ?? 'x64'
const APP_NAME = productName.replace(/\s/g, '')
const APP_DIST_PATH = path.join(cwd, 'dist')
const appReleaseFileName = `${APP_NAME}-${APP_VERSION}-${ARCH}-mac.zip`
Expand Down
3 changes: 3 additions & 0 deletions src/helpers/parse-env-val-to-bool.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ module.exports = (value) => {
if (typeof value === 'boolean') {
return value
}
if (!value) {
return false
}

const normalizedValue = value.toString()
.trim()
Expand Down
Loading