Skip to content

Commit

Permalink
build go binaries in action and revert github config
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellacosse committed Nov 14, 2023
1 parent 70078ca commit 2611e58
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
30 changes: 6 additions & 24 deletions .github/workflows/build_and_test_debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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/[email protected]
with:
Expand All @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
2 changes: 2 additions & 0 deletions src/electron/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions src/tun2socks/build.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 2611e58

Please sign in to comment.