diff --git a/.github/workflows/build_and_test_debug.yml b/.github/workflows/build_and_test_debug.yml index d386d33bcc..f3716bee64 100644 --- a/.github/workflows/build_and_test_debug.yml +++ b/.github/workflows/build_and_test_debug.yml @@ -68,11 +68,8 @@ jobs: with: go-version: 1.18 - - name: Build Go Binaries - run: go build -o ./bin/ github.com/crazy-max/xgo - - name: Build Linux Client - run: PATH="$(pwd)/bin:$PATH" npm run action electron/build linux + run: npm run action electron/build linux windows_debug_build: name: Windows Debug Build @@ -100,11 +97,8 @@ jobs: with: go-version: 1.18 - - name: Build Go Binaries - run: go build -o ./bin/ github.com/crazy-max/xgo - - name: Build Windows Client - run: PATH="$(pwd)/bin:$PATH" npm run action electron/build windows + run: npm run action electron/build windows macos_debug_build: name: MacOS Debug Build @@ -132,14 +126,11 @@ jobs: with: go-version: 1.18 - - name: Build Go Binaries - run: go build -o ./bin/ golang.org/x/mobile/cmd/gomobile golang.org/x/mobile/cmd/gobind - - name: Test OutlineAppleLib run: npm run action cordova/test macos - name: Build MacOS Client - run: PATH="$(pwd)/bin:$PATH" npm run action cordova/build macos + run: npm run action cordova/build macos - uses: codecov/codecov-action@v3 with: @@ -173,14 +164,11 @@ jobs: with: go-version: 1.18 - - name: Build Go Binaries - run: go build -o ./bin/ golang.org/x/mobile/cmd/gomobile golang.org/x/mobile/cmd/gobind - - name: Test OutlineAppleLib run: npm run action cordova/test ios - name: Build iOS Client - run: PATH="$(pwd)/bin:$PATH" npm run action cordova/build ios + run: npm run action cordova/build ios - uses: codecov/codecov-action@v3 with: @@ -214,14 +202,11 @@ jobs: with: go-version: 1.18 - - name: Build Go Binaries - run: go build -o ./bin/ golang.org/x/mobile/cmd/gomobile golang.org/x/mobile/cmd/gobind - - name: Test OutlineAppleLib run: npm run action cordova/test maccatalyst - name: Build Mac Catalyst Client - run: PATH="$(pwd)/bin:$PATH" npm run action cordova/build maccatalyst + run: npm run action cordova/build maccatalyst - uses: codecov/codecov-action@v3 with: @@ -252,9 +237,6 @@ jobs: with: go-version: 1.18 - - name: Build Go Binaries - run: go build -o ./bin/ golang.org/x/mobile/cmd/gomobile golang.org/x/mobile/cmd/gobind - - name: Install Java uses: actions/setup-java@v1.4.3 with: @@ -264,4 +246,4 @@ jobs: run: bash ./tools/build/setup_linux_android.sh - name: Build Android Client - run: PATH="$(pwd)/bin:$PATH" npm run action cordova/build android -- --verbose + run: npm run action cordova/build android -- --verbose diff --git a/README.md b/README.md index 398dd5d194..e3007051a1 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ To join our Outline Community, [sign up for the IFF Mattermost](https://internet ## Requirements for all builds -All builds require [Node](https://nodejs.org/) 18 (lts/hydrogen), in addition to other per-platform requirements. +All builds require [Node](https://nodejs.org/) 18 (lts/hydrogen), and [Go](https://golang.org/) 1.18 installed in addition to other per-platform requirements. > 💡 NOTE: if you have `nvm` installed, run `nvm use` to switch to the correct node version! diff --git a/src/electron/README.md b/src/electron/README.md index 9c59290747..d09fdb4d2a 100644 --- a/src/electron/README.md +++ b/src/electron/README.md @@ -2,6 +2,8 @@ Unlike the Android and Apple clients, the Windows and Linux clients use the Electron framework, rather than Cordova. +You will need [Docker](https://www.docker.com/) installed to build the Electron clients. + To build the Electron clients, run (it will also package an installer executable into `build/dist`): ```sh diff --git a/src/tun2socks/build.action.mjs b/src/tun2socks/build.action.mjs index bdde8e25a2..08e6086931 100644 --- a/src/tun2socks/build.action.mjs +++ b/src/tun2socks/build.action.mjs @@ -26,8 +26,22 @@ import {getRootDir} from '../build/get_root_dir.mjs'; export async function main(...parameters) { const {platform} = getBuildParameters(parameters); + const binDir = `${getRootDir()}/build/bin`; const outputDir = `${getRootDir()}/build/${platform}`; + // install go tools locally + await spawnStream( + 'go', + 'build', + '-o', + binDir, + 'golang.org/x/mobile/cmd/gomobile', + 'golang.org/x/mobile/cmd/gobind', + 'github.com/crazy-max/xgo' + ); + + process.env.PATH = `${binDir}:${process.env.PATH}`; + switch (platform) { case 'android': return spawnStream(