1
0
Fork 0
mirror of synced 2024-12-21 22:21:07 -05:00

Merge pull request #1 from pashcovich/rc/1.0.3

binaries for arm
This commit is contained in:
Ilya Sosnovsky 2021-10-21 09:57:31 +03:00 committed by GitHub
commit 116886a660
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 6 deletions

View file

@ -1,6 +1,5 @@
# .github/workflows/release.yaml
on:
name: Build and publish binaries (releases only)
on:
release:
types: [created]
@ -10,7 +9,6 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/386, darwin/amd64
goos: [linux]
goarch: ["386", amd64]
steps:

28
.github/workflows/release_arm.yaml vendored Normal file
View file

@ -0,0 +1,28 @@
name: Build and publish arm binaries (releases only)
on:
release:
types: [created]
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
env:
CGO_ENABLED: 1
strategy:
matrix:
goos: [linux]
goarch: ["arm", "arm64"]
steps:
- name: checkout code
uses: actions/checkout@v2
- name: build binaries
uses: wangyoucao577/go-release-action@v1.20
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
build_command: bash ./build_arm.sh
pre_command: bash ./install-deps_arm.sh
binary_name: "openvpn-user-${{ matrix.goarch }}"
asset_name: openvpn-user-${{ matrix.goos }}-${{ matrix.goarch }}.

10
build_arm.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
if [[ "$GOOS" == "linux" ]]; then
if [[ "$GOARCH" == "arm" ]]; then
CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm go build -ldflags "-linkmode external -extldflags -static -s -w" -o openvpn-user-arm
fi
if [[ "$GOARCH" == "arm64" ]]; then
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -ldflags "-linkmode external -extldflags -static -s -w" -o openvpn-user-arm64
fi
fi

4
install-deps-arm.sh Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env bash
apt-get update
apt-get install -y gcc gcc-multilib sqlite3 libc6-dev-arm64-cross gcc-arm-linux-gnueabi gcc-aarch64-linux-gnu

View file

@ -1,5 +1,4 @@
#!/usr/bin/env bash
set -e
apt-get update
apt-get install -y gcc gcc-multilib sqlite3

View file

@ -11,7 +11,7 @@ import (
)
const (
version = "1.0.3-rc.1"
version = "1.0.3"
)
var (