Skip to content

Commit

Permalink
setup NDK r26c for cgo and compile with sdk34
Browse files Browse the repository at this point in the history
  • Loading branch information
whalechoi committed Mar 29, 2024
1 parent a06835d commit 6bf2706
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ jobs:
include:
- goos: android
goarch: arm64
cc: aarch64-linux-android34-clang
cx: aarch64-linux-android34-clang++
- goos: android
goarch: amd64
cc: x86_64-linux-android34-clang
cx: x86_64-linux-android34-clang++
fail-fast: false

runs-on: ubuntu-latest
Expand All @@ -38,10 +42,20 @@ jobs:
- name: Checkout codebase
uses: actions/checkout@v4

- name: Show workflow information
- name: Set up NDK
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: r26c

- name: Show workflow information
run: |
export _NAME=$(jq ".[\"$GOOS-$GOARCH\"].friendlyName" -r < .github/build/friendly-filenames.json)
echo "GOOS: $GOOS, GOARCH: $GOARCH, RELEASE_NAME: $_NAME"
export _CC=${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/${{ matrix.cc }}
export _CX=${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/${{ matrix.cx }}
echo "GOOS: $GOOS, GOARCH: $GOARCH, CC: $_CC, CX: $_CX, RELEASE_NAME: $_NAME"
echo "CC=$_CC" >> $GITHUB_ENV
echo "CX=$_CX" >> $GITHUB_ENV
echo "ASSET_NAME=$_NAME" >> $GITHUB_ENV
- name: Set up Go
Expand All @@ -52,7 +66,7 @@ jobs:

- name: Get project dependencies
run: go get ./main

- name: Build XrayHelper
run: |
mkdir -p build_assets
Expand Down

0 comments on commit 6bf2706

Please sign in to comment.