Skip to content

Commit 08e6719

Browse files
authored
Merge pull request #306 from bitfinexcom/staging
Release version 4.18.0
2 parents 2ef39b2 + 44124ef commit 08e6719

12 files changed

Lines changed: 121 additions & 20 deletions

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ IS_DEV_ENV=0
44
IS_AUTO_UPDATE_DISABLED=0
55
EP_GH_IGNORE_TIME=true
66
GH_TOKEN=
7+
8+
NOTARIZE=0
9+
APPLE_TEAM_ID=
10+
APPLE_ID=
11+
APPLE_APP_SPECIFIC_PASSWORD=
12+
CSC_LINK=
13+
CSC_KEY_PASSWORD=

.github/workflows/build-electron-app.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
isBfxApiStaging:
2020
description: 'Is it necessary to use BFX API Staging? (true / 1)?'
2121
required: false
22+
isNotarizeDisabled:
23+
description: 'Is notarize disabled (true / 1)?'
24+
required: false
2225

2326
env:
2427
DOCKER_BUILDKIT: 1
@@ -96,13 +99,17 @@ jobs:
9699
sudo chown -R $(id -u):$(id -g) ~/.cache/electron-builder
97100
98101
mac-builder:
99-
timeout-minutes: 90
102+
timeout-minutes: 150
100103
runs-on: macos-12
101104
steps:
102105
- name: Checkout
103106
uses: actions/checkout@v4
104107
with:
105108
submodules: recursive
109+
- name: Replace macOS’s sed with GNU’s sed
110+
run: |
111+
brew install gnu-sed
112+
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
106113
- name: Set repo owner
107114
run: |
108115
sed -i -e \
@@ -118,6 +125,10 @@ jobs:
118125
name: Turn off auto-update
119126
run: |
120127
echo "IS_AUTO_UPDATE_DISABLED=1" >> $GITHUB_ENV
128+
- if: ${{ !contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isNotarizeDisabled) }}
129+
name: Turn on notarize
130+
run: |
131+
echo "NOTARIZE=1" >> $GITHUB_ENV
121132
- if: contains(fromJson('["true", "1", true, 1]'), github.event.inputs.isBfxApiStaging)
122133
name: Use BFX API Staging for queries
123134
run: |
@@ -132,7 +143,7 @@ jobs:
132143
cache-name: electron-cache-v1
133144
with:
134145
path: |
135-
~/Library/Caches/electron
146+
${{ runner.temp }}/.cache/electron
136147
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }}
137148
restore-keys: |
138149
${{ runner.os }}-build-${{ env.cache-name }}-
@@ -141,14 +152,26 @@ jobs:
141152
uses: nick-fields/retry@v2
142153
continue-on-error: false
143154
env:
155+
APPLE_TEAM_ID: ${{ secrets.BFX_APPLE_TEAM_ID }}
156+
APPLE_ID: ${{ secrets.BFX_APPLE_ID_USERNAME }}
157+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.BFX_APPLE_ID_REPORT_PASSWORD }}
158+
CSC_LINK: ${{ secrets.BFX_APPLE_BUILD_CERTIFICATE_B64 }}
159+
CSC_KEY_PASSWORD: ${{ secrets.BFX_APPLE_BUILD_CERTIFICATE_PASSWORD }}
144160
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145-
ELECTRON_CACHE: ~/Library/Caches/electron
161+
ELECTRON_CACHE: ${{ runner.temp }}/.cache/electron
146162
with:
147-
timeout_minutes: 20
163+
timeout_minutes: 40
148164
retry_wait_seconds: 10
149165
max_attempts: 3
150166
retry_on: any
151-
command: ./scripts/build-release.sh -mp
167+
command: |
168+
if [[ -z "${APPLE_TEAM_ID}" ]]; then unset NOTARIZE; fi
169+
if [[ -z "${APPLE_TEAM_ID}" ]]; then unset APPLE_TEAM_ID; fi
170+
if [[ -z "${APPLE_ID}" ]]; then unset APPLE_ID; fi
171+
if [[ -z "${APPLE_APP_SPECIFIC_PASSWORD}" ]]; then unset APPLE_APP_SPECIFIC_PASSWORD; fi
172+
if [[ -z "${CSC_LINK}" ]]; then unset CSC_LINK; fi
173+
if [[ -z "${CSC_KEY_PASSWORD}" ]]; then unset CSC_KEY_PASSWORD; fi
174+
./scripts/build-release.sh -mp
152175
- name: Zip Mac Unpacked build
153176
run: zip -r dist/mac.zip dist/mac
154177
- name: Upload Mac Unpacked build

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [4.18.0] - 2024-01-31
11+
12+
### Added
13+
14+
- Added Apple signing and notarization workflow. PR: [bfx-report-electron#299](https://github.com/bitfinexcom/bfx-report-electron/pull/299)
15+
- 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)
16+
- 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)
17+
- 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)
18+
19+
### Changed
20+
21+
- Improved user informing about the initial synchronization. PR: [bfx-report-ui#760](https://github.com/bitfinexcom/bfx-report-ui/pull/760)
22+
- Improved login to sign in when `otp` length is `6`. PR: [bfx-report-ui#758](https://github.com/bitfinexcom/bfx-report-ui/pull/758)
23+
24+
### Fixed
25+
26+
- Fixed lint error. PR: [bfx-report-ui#763](https://github.com/bitfinexcom/bfx-report-ui/pull/763)
27+
28+
### Security
29+
30+
- 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)
31+
- 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)
32+
1033
## [4.17.0] - 2024-01-10
1134

1235
### Added

bfx-report-ui

Submodule bfx-report-ui updated 96 files

bfx-reports-framework

build/entitlements.mac.plist

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>com.apple.security.app-sandbox</key>
5+
<key>com.apple.security.inherit</key>
66
<true/>
77
<key>com.apple.security.network.client</key>
88
<true/>
@@ -22,5 +22,13 @@
2222
<true/>
2323
<key>com.apple.security.cs.disable-library-validation</key>
2424
<true/>
25+
<key>com.apple.security.cs.allow-jit</key>
26+
<true/>
27+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
28+
<true/>
29+
<key>com.apple.security.cs.debugger</key>
30+
<true/>
31+
<key>com.apple.security.automation.apple-events</key>
32+
<true/>
2533
</dict>
2634
</plist>

build/entitlements.mas.inherit.plist

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>com.apple.security.app-sandbox</key>
6-
<true/>
75
<key>com.apple.security.inherit</key>
86
<true/>
97
<key>com.apple.security.network.client</key>
@@ -24,5 +22,13 @@
2422
<true/>
2523
<key>com.apple.security.cs.disable-library-validation</key>
2624
<true/>
25+
<key>com.apple.security.cs.allow-jit</key>
26+
<true/>
27+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
28+
<true/>
29+
<key>com.apple.security.cs.debugger</key>
30+
<true/>
31+
<key>com.apple.security.automation.apple-events</key>
32+
<true/>
2733
</dict>
2834
</plist>

electron-builder-config.js

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
11
'use strict'
22

3+
require('dotenv').config()
34
const fs = require('fs')
45
const path = require('path')
56
const zlib = require('zlib')
67
const { promisify } = require('util')
78
const archiver = require('archiver')
89
const exec = promisify(require('child_process').exec)
910

11+
const parseEnvValToBool = require(
12+
'./src/helpers/parse-env-val-to-bool'
13+
)
14+
1015
let version
1116
let zippedAppImageArtifactPath
1217
let zippedMacArtifactPath
1318
const appOutDirs = new Map()
19+
const isNotarize = parseEnvValToBool(process.env.NOTARIZE)
20+
const arch = process.env.ARCH ?? 'x64'
21+
22+
// Notarize can be done only on MacOS
23+
const macNotarize = (
24+
process.platform === 'darwin' &&
25+
isNotarize
26+
)
27+
? {
28+
notarize: {
29+
teamId: process.env.APPLE_TEAM_ID
30+
}
31+
}
32+
: {}
33+
// DMG can be built only on MacOS
34+
const macSpecificTargets = process.platform === 'darwin'
35+
? ['dmg', 'zip']
36+
: []
1437

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

@@ -60,7 +83,7 @@ module.exports = {
6083
extends: null,
6184
asar: false,
6285
productName: 'Bitfinex Report',
63-
artifactName: 'BitfinexReport-${version}-x64-${os}.${ext}',
86+
artifactName: 'BitfinexReport-${version}-' + arch + '-${os}.${ext}',
6487
appId: 'com.bitfinex.report',
6588
publish: {
6689
provider: 'github',
@@ -92,14 +115,18 @@ module.exports = {
92115
verifyUpdateCodeSignature: false
93116
},
94117
mac: {
95-
type: 'development',
118+
type: 'distribution',
96119
hardenedRuntime: true,
97120
gatekeeperAssess: false,
98121
entitlements: 'build/entitlements.mac.plist',
99122
entitlementsInherit: 'build/entitlements.mas.inherit.plist',
100123
category: 'public.app-category.finance',
124+
minimumSystemVersion: '11',
125+
darkModeSupport: true,
126+
...macNotarize,
101127
target: [
102-
'dir'
128+
'dir',
129+
...macSpecificTargets
103130
]
104131
},
105132
files: [
@@ -213,14 +240,16 @@ module.exports = {
213240
? 'exe'
214241
: targetName
215242
const foundAppFilePath = artifactPaths.find((path) => (
216-
new RegExp(`${targetPlatform}.*${ext}$`, 'i').test(path)
243+
new RegExp(`${arch}.*${targetPlatform}.*${ext}$`, 'i').test(path)
217244
))
218245
const appFilePath = foundAppFilePath ?? path.join(
219246
outDir,
220-
`BitfinexReport-${version}-x64-${targetPlatform}.${ext}`
247+
`BitfinexReport-${version}-${arch}-${targetPlatform}.${ext}`
221248
)
222249

223250
if (
251+
// Outside darwin zip release can't be built successfully
252+
process.platform !== 'darwin' &&
224253
targetPlatform === 'mac' &&
225254
targetName === 'zip'
226255
) {
@@ -261,7 +290,7 @@ module.exports = {
261290
) {
262291
zippedAppImageArtifactPath = path.join(
263292
outDir,
264-
`BitfinexReport-${version}-x64-${targetPlatform}.AppImage.zip`
293+
`BitfinexReport-${version}-${arch}-${targetPlatform}.AppImage.zip`
265294
)
266295
await new Promise((resolve, reject) => {
267296
try {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bfx-report-electron",
3-
"version": "4.17.0",
3+
"version": "4.18.0",
44
"repository": "https://github.com/bitfinexcom/bfx-report-electron",
55
"description": "Reporting tool",
66
"author": "bitfinex.com",
@@ -42,6 +42,7 @@
4242
"@wdio/spec-reporter": "8.21.0",
4343
"app-builder-bin": "4.2.0",
4444
"cross-env": "7.0.3",
45+
"dotenv": "16.3.1",
4546
"electron": "27.2.0",
4647
"electron-builder": "24.10.0",
4748
"mocha": "10.2.0",

scripts/build-release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ COLOR_YELLOW=${COLOR_YELLOW:-"\033[33m"}
1717
COLOR_BLUE=${COLOR_BLUE:-"\033[34m"}
1818
COLOR_NORMAL=${COLOR_NORMAL:-"\033[39m"}
1919

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

@@ -230,7 +230,7 @@ fi
230230

231231
rm -rf "$DIST_FOLDER/"*"$targetPlatform"*
232232
node "$ROOT/node_modules/.bin/electron-builder" \
233-
"build" "--$targetPlatform" \
233+
"build" "--$targetPlatform" "--$ARCH" \
234234
"--config" "$ELECTRON_BUILDER_CONFIG_FILE_PATH" \
235235
$publishOption
236236

0 commit comments

Comments
 (0)