Skip to content

Commit 9e9ec2c

Browse files
author
alynx
committed
feat: add termux (linux/arm) support
1 parent 922a778 commit 9e9ec2c

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: build linux
2424
run: GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o ssh-inject-linux-amd64 .
2525

26+
- name: build linux arm (termux)
27+
run: GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-s -w" -o ssh-inject-linux-arm .
28+
2629
- name: build mac
2730
run: GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o ssh-inject-darwin-amd64 .
2831

@@ -38,6 +41,7 @@ jobs:
3841
name: binaries
3942
path: |
4043
ssh-inject-linux-amd64
44+
ssh-inject-linux-arm
4145
ssh-inject-darwin-amd64
4246
ssh-inject-darwin-arm64
4347
ssh-inject-windows-amd64.exe

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
run: |
2424
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o ssh-inject-linux-amd64 .
2525
GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o ssh-inject-linux-arm64 .
26+
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags "-s -w" -o ssh-inject-linux-arm .
2627
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o ssh-inject-darwin-amd64 .
2728
GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w" -o ssh-inject-darwin-arm64 .
2829
GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o ssh-inject-windows-amd64.exe .
@@ -45,6 +46,7 @@ jobs:
4546
|---|---|---|
4647
| linux | x64 | `ssh-inject-linux-amd64` |
4748
| linux | arm64 | `ssh-inject-linux-arm64` |
49+
| linux / termux | arm (32-bit) | `ssh-inject-linux-arm` |
4850
| macos | intel | `ssh-inject-darwin-amd64` |
4951
| macos | apple silicon | `ssh-inject-darwin-arm64` |
5052
| windows | x64 | `ssh-inject-windows-amd64.exe` |
@@ -61,6 +63,7 @@ jobs:
6163
files: |
6264
ssh-inject-linux-amd64
6365
ssh-inject-linux-arm64
66+
ssh-inject-linux-arm
6467
ssh-inject-darwin-amd64
6568
ssh-inject-darwin-arm64
6669
ssh-inject-windows-amd64.exe

build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ build_all() {
3737
platforms=(
3838
"linux/amd64"
3939
"linux/arm64"
40+
"linux/arm"
4041
"darwin/amd64"
4142
"darwin/arm64"
4243
"windows/amd64"
@@ -53,7 +54,11 @@ build_all() {
5354
fi
5455

5556
echo -e "${YELLOW} $GOOS/$GOARCH${NC}"
56-
GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "$LDFLAGS" -o "$output" .
57+
if [ "$GOARCH" = "arm" ]; then
58+
GOOS=$GOOS GOARCH=$GOARCH GOARM=7 go build -ldflags "$LDFLAGS" -o "$output" .
59+
else
60+
GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "$LDFLAGS" -o "$output" .
61+
fi
5762
done
5863

5964
echo ""

0 commit comments

Comments
 (0)