forked from dswd/vpncloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
311 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
name: 'build-deb' | ||
description: 'Create deb packages' | ||
inputs: | ||
rust: | ||
description: Rust version | ||
default: 'stable' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
env: | ||
RUST: ${{ inputs.rust }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
name: 'build-deb' | ||
description: 'Create deb packages' | ||
inputs: | ||
rust: | ||
description: Rust version | ||
default: 'stable' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
env: | ||
RUST: ${{ inputs.rust }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
curl \ | ||
gcc-aarch64-linux-gnu \ | ||
gcc-arm-linux-gnueabihf \ | ||
libc6-dev-arm64-cross \ | ||
libc6-dev-armhf-cross \ | ||
libc6-dev-i386 \ | ||
gcc-5-multilib \ | ||
asciidoctor \ | ||
musl musl-dev musl-tools \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
ADD entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT /entrypoint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: 'build-static' | ||
description: 'Create static binaries' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
TOOLCHAIN=$(grep -e '^toolchain =' Cargo.toml | sed -e 's/toolchain = "\(.*\)"/\1/') | ||
UPX_VERSION=$(grep -e '^upx_version =' Cargo.toml | sed -e 's/upx_version = "\(.*\)"/\1/') | ||
|
||
VERSION=$(grep -e '^version =' Cargo.toml | sed -e 's/version = "\(.*\)"/\1/') | ||
DEB_VERSION=$(echo "$VERSION" | sed -e 's/-/~/g') | ||
|
||
ln -s asm-generic/ /usr/include/asm | ||
ln -s /usr/bin/aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-musl-gcc | ||
ln -s /usr/bin/arm-linux-gnueabihf-gcc /usr/bin/arm-linux-musleabihf-gcc | ||
|
||
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${TOOLCHAIN} | ||
source $HOME/.cargo/env | ||
|
||
rustup target add x86_64-unknown-linux-musl | ||
rustup target add i686-unknown-linux-musl | ||
rustup target add armv7-unknown-linux-musleabihf | ||
rustup target add aarch64-unknown-linux-musl | ||
|
||
curl https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz -Lf | tar -xJ --strip-components=1 -C /opt/rust/cargo/bin | ||
|
||
mkdir dist | ||
|
||
build_static() { | ||
ARCH=$1 | ||
TARGET=$2 | ||
cargo build --release --features installer --target ${TARGET} && upx --lzma target/${TARGET}/release/vpncloud | ||
cp target/${TARGET}/release/vpncloud ../dist/vpncloud_${VERSION}_static_${ARCH} | ||
} | ||
|
||
build_static amd64 x86_64-unknown-linux-musl | ||
#build_static i386 i686-unknown-linux-musl | ||
build_static armhf armv7-unknown-linux-musleabihf | ||
build_static arm64 aarch64-unknown-linux-musl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.