Skip to content

Commit db28646

Browse files
authored
Update build.yml
1 parent 5b3e70d commit db28646

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,28 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717

18-
- name: Set up Go
19-
uses: actions/setup-go@v5
20-
with:
21-
go-version: '1.22.x'
18+
# - name: Set up Go
19+
# uses: actions/setup-go@v5
20+
# with:
21+
# go-version: '1.22.x'
2222

23-
- name: Get Android NDK
24-
run: |
25-
wget https://dl.google.com/android/repository/${ANDROID_NDK_ZIP}
26-
unzip -q ${ANDROID_NDK_ZIP}
23+
# - name: Get Android NDK
24+
# run: |
25+
# wget https://dl.google.com/android/repository/${ANDROID_NDK_ZIP}
26+
# unzip -q ${ANDROID_NDK_ZIP}
2727

2828
- name: Build Kopia (Android/arm64, CGO, netcgo)
29+
env:
30+
ANDROID_NDK: ${{ env.ANDROID_NDK }}
2931
run: |
30-
export ANDROID_NDK="${PWD}/${ANDROID_NDK_DIR}"
3132
export CC="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
3233
export CXX="$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++"
3334
export GOOS=android GOARCH=arm64 CGO_ENABLED=1
34-
mkdir -p "$GOBIN"
35-
# netcgo ensures the cgo DNS resolver is used
36-
go install -tags netcgo github.com/kopia/kopia@v0.21.1
37-
ls -l "$GOBIN"
35+
mkdir -p out
36+
# Use go build (NOT go install) to avoid the GOBIN/cross-compile restriction.
37+
go build -tags netcgo -trimpath -ldflags="-s -w" \
38+
-o out/kopia github.com/kopia/kopia@v0.21.1
39+
file out/kopia
3840
3941
- name: Upload Android binary
4042
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)