From 89d7bd1416314e956ac67a3d7c82b3466704eec3 Mon Sep 17 00:00:00 2001 From: Aleksey Komarov Date: Sat, 25 Jan 2025 12:04:04 +0300 Subject: [PATCH 1/4] feat(client/linux): drop AppImage linux version --- client/electron/electron-builder.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/electron/electron-builder.json b/client/electron/electron-builder.json index b4ba54c123..421441677b 100644 --- a/client/electron/electron-builder.json +++ b/client/electron/electron-builder.json @@ -39,9 +39,6 @@ "arch": [ "x64" ], - "target": "AppImage" - }, { - "arch": "x64", "target": "deb" }] }, From f952c540f5c6edca869873f6e2e7e62c9a8f3084 Mon Sep 17 00:00:00 2001 From: Aleksey Komarov Date: Sat, 25 Jan 2025 14:15:54 +0300 Subject: [PATCH 2/4] feat(client/linux): add arm64 linux version of client --- client/build/get_build_parameters.mjs | 2 ++ client/electron/electron-builder.json | 5 +++-- client/go/Taskfile.yml | 4 ++++ client/go/build.action.mjs | 5 +++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/client/build/get_build_parameters.mjs b/client/build/get_build_parameters.mjs index b897650184..d8ca3edd54 100644 --- a/client/build/get_build_parameters.mjs +++ b/client/build/get_build_parameters.mjs @@ -33,6 +33,7 @@ export function getBuildParameters(cliArguments) { verbose = false, versionName = '0.0.0', sentryDsn = process.env.SENTRY_DSN, + arch = '', } = minimist(cliArguments); if (platform && !VALID_PLATFORMS.includes(platform)) { @@ -56,5 +57,6 @@ export function getBuildParameters(cliArguments) { versionName: buildMode === 'release' ? versionName : `${versionName}-${buildMode}`, sentryDsn, buildNumber: Math.floor(Date.now() / MS_PER_HOUR), + arch, }; } diff --git a/client/electron/electron-builder.json b/client/electron/electron-builder.json index 421441677b..c696057257 100644 --- a/client/electron/electron-builder.json +++ b/client/electron/electron-builder.json @@ -1,6 +1,6 @@ { "productName": "Outline", - "artifactName": "Outline-Client.${ext}", + "artifactName": "Outline-Client-${arch}.${ext}", "asarUnpack": [ "client" ], "directories": { "buildResources": "output/client/electron", @@ -37,7 +37,8 @@ "maintainer": "Jigsaw LLC", "target": [{ "arch": [ - "x64" + "x64", + "arm64" ], "target": "deb" }] diff --git a/client/go/Taskfile.yml b/client/go/Taskfile.yml index 5994e02e1d..f502d2a1ac 100644 --- a/client/go/Taskfile.yml +++ b/client/go/Taskfile.yml @@ -65,6 +65,10 @@ tasks: desc: "Build the tun2socks binary and library for Linux" cmds: [{task: electron, vars: {TARGET_OS: "linux", TARGET_ARCH: "amd64"}}] + linux_arm64: + desc: "Build the tun2socks binary and library for Linux" + cmds: [{task: electron, vars: {TARGET_OS: "linux", TARGET_ARCH: "arm64"}}] + android: desc: "Build the tun2socks.aar library for Android" vars: diff --git a/client/go/build.action.mjs b/client/go/build.action.mjs index 0c72a0200f..03102b599f 100644 --- a/client/go/build.action.mjs +++ b/client/go/build.action.mjs @@ -24,8 +24,9 @@ import {getBuildParameters} from '../build/get_build_parameters.mjs'; * @param {string[]} parameters */ export async function main(...parameters) { - const {platform: targetPlatform} = getBuildParameters(parameters); - await spawnStream('go', 'run', 'github.com/go-task/task/v3/cmd/task', '-v', `client:tun2socks:${targetPlatform}`); + const {platform: targetPlatform, arch: targetArch} = getBuildParameters(parameters); + const targetName = targetArch !== '' ? `${targetPlatform}_${targetArch}` : targetPlatform; + await spawnStream('go', 'run', 'github.com/go-task/task/v3/cmd/task', '-v', `client:tun2socks:${targetName}`); } if (import.meta.url === url.pathToFileURL(process.argv[1]).href) { From 96ce59cf1ef02382db2600da6d59e62ffabfe4bc Mon Sep 17 00:00:00 2001 From: Aleksey Komarov Date: Sat, 25 Jan 2025 14:17:42 +0300 Subject: [PATCH 3/4] ci: add CI for arm64 linux version of client --- .../workflows/build_and_test_debug_client.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/build_and_test_debug_client.yml b/.github/workflows/build_and_test_debug_client.yml index a43eb87438..51cd80e1de 100644 --- a/.github/workflows/build_and_test_debug_client.yml +++ b/.github/workflows/build_and_test_debug_client.yml @@ -102,6 +102,41 @@ jobs: - name: Build Linux Client run: npm run action client/electron/build linux + linux_arm64_debug_build: + name: Linux arm64 Debug Build + runs-on: ubuntu-24.04-arm + timeout-minutes: 20 + needs: [web_test, backend_test] + steps: + - name: Checkout + uses: actions/checkout@v2.3.4 + + - name: Install Node + uses: actions/setup-node@v3 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: ./package-lock.json + + - name: Install NPM Dependencies + run: | + sudo apt update && sudo apt install chromium-browser + npm ci + + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version-file: '${{ github.workspace }}/go.mod' + + - name: Build Linux Client + # electron-builder has no arm64 version fpm, so install it from + # gem and force to use system one. Based on this workaround: + # https://github.com/jordansissel/fpm/issues/1801#issuecomment-919877499 + run: | + sudo gem install fpm + export USE_SYSTEM_FPM=true + npm run action client/electron/build linux -- --arch arm64 + windows_debug_build: name: Windows Debug Build runs-on: windows-2019 From 171d47caa389ebf7ef3e10900aff34ba59893d9f Mon Sep 17 00:00:00 2001 From: Aleksey Komarov Date: Sat, 25 Jan 2025 14:46:59 +0300 Subject: [PATCH 4/4] Fix linting errors --- client/build/get_build_parameters.mjs | 13 +++++++++++-- client/go/build.action.mjs | 14 +++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/client/build/get_build_parameters.mjs b/client/build/get_build_parameters.mjs index d8ca3edd54..095facaf99 100644 --- a/client/build/get_build_parameters.mjs +++ b/client/build/get_build_parameters.mjs @@ -14,7 +14,15 @@ import minimist from 'minimist'; -const VALID_PLATFORMS = ['linux', 'windows', 'ios', 'macos', 'maccatalyst', 'android', 'browser']; +const VALID_PLATFORMS = [ + 'linux', + 'windows', + 'ios', + 'macos', + 'maccatalyst', + 'android', + 'browser', +]; const VALID_BUILD_MODES = ['debug', 'release']; const MS_PER_HOUR = 1000 * 60 * 60; @@ -54,7 +62,8 @@ export function getBuildParameters(cliArguments) { platform, buildMode, verbose, - versionName: buildMode === 'release' ? versionName : `${versionName}-${buildMode}`, + versionName: + buildMode === 'release' ? versionName : `${versionName}-${buildMode}`, sentryDsn, buildNumber: Math.floor(Date.now() / MS_PER_HOUR), arch, diff --git a/client/go/build.action.mjs b/client/go/build.action.mjs index 03102b599f..706ae0c54b 100644 --- a/client/go/build.action.mjs +++ b/client/go/build.action.mjs @@ -24,9 +24,17 @@ import {getBuildParameters} from '../build/get_build_parameters.mjs'; * @param {string[]} parameters */ export async function main(...parameters) { - const {platform: targetPlatform, arch: targetArch} = getBuildParameters(parameters); - const targetName = targetArch !== '' ? `${targetPlatform}_${targetArch}` : targetPlatform; - await spawnStream('go', 'run', 'github.com/go-task/task/v3/cmd/task', '-v', `client:tun2socks:${targetName}`); + const {platform: targetPlatform, arch: targetArch} = + getBuildParameters(parameters); + const targetName = + targetArch !== '' ? `${targetPlatform}_${targetArch}` : targetPlatform; + await spawnStream( + 'go', + 'run', + 'github.com/go-task/task/v3/cmd/task', + '-v', + `client:tun2socks:${targetName}` + ); } if (import.meta.url === url.pathToFileURL(process.argv[1]).href) {