From e1ea72fda2b5b06f6d0d468c0da47016b591773f Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Wed, 5 Feb 2020 19:40:36 +0800 Subject: [PATCH] Enable osx and windows build on circle-ci, disable LTO --- .circleci/config.yml | 68 +++++++++++++++++++++++++++++++++++++++----- Cargo.toml | 4 +-- build/build-release | 4 +-- 3 files changed, 65 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4807ae58..5bde8c99 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,24 +1,78 @@ version: 2.1 + +orbs: + win: circleci/windows@2.4.0 + jobs: - build: + build-linux: docker: - image: circleci/rust:latest + environment: + SODIUM_USE_PKG_CONFIG: "1" + OPENSSL_STATIC: "1" steps: - checkout - run: | sudo apt-get update sudo apt-get install -y libssl-dev libsodium-dev - restore_cache: - key: cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} - - run: | - export SODIUM_USE_PKG_CONFIG=1 - export OPENSSL_STATIC=1 - ./build-host-release + key: cargo-cache-{{ arch }} + - run: ./build-host-release - save_cache: paths: - /usr/local/cargo/registry - ./target - key: cargo-cache-{{ arch }}-{{ checksum "Cargo.lock" }} + key: cargo-cache-{{ arch }} - store_artifacts: path: ./build/release destination: releases + + build-osx: + macos: + xcode: 11.3.1 + environment: + SODIUM_USE_PKG_CONFIG: "1" + steps: + - checkout + - run: brew install libsodium + - restore_cache: + key: cargo-cache-{{ arch }} + - run: ./build-host-release + - save_cache: + paths: + - /usr/local/cargo/registry + - ./target + key: cargo-cache-{{ arch }} + - store_artifacts: + path: ./build/release + destination: releases + + build-windows: + executor: win/default + + environment: + OPENSSL_STATIC: "1" + steps: + - checkout + - run: | + Start-FileDownload "http://slproweb.com/download/Win64OpenSSL-1_1_1d.exe" + Win64OpenSSL-1_1_1d.exe /SILENT /VERYSILENT /SP- /DIR="C:\OpenSSL" + - restore_cache: + key: cargo-cache-{{ arch }} + - run: ./build-host-release + - save_cache: + paths: + - /usr/local/cargo/registry + - ./target + key: cargo-cache-{{ arch }} + - store_artifacts: + path: ./build/release + destination: releases + +workflows: + version: 2 + build-releases: + jobs: + - build-linux + - build-osx + - build-windows diff --git a/Cargo.toml b/Cargo.toml index 5f3bf881..c32232e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,8 +32,8 @@ path = "src/bin/redir.rs" name = "ssurl" path = "src/bin/ssurl.rs" -[profile.release] -lto = true +#[profile.release] +#lto = true [features] default = ["sodium", "rc4", "aes-cfb", "aes-ctr", "trust-dns"] diff --git a/build/build-release b/build/build-release index 6e3b049e..11cb4bf6 100755 --- a/build/build-release +++ b/build/build-release @@ -43,7 +43,7 @@ function build() { mkdir -p "${PKG_DIR}" if [[ "$TARGET" == *"-linux-"* ]]; then - PKG_NAME="shadowsocks-v${VERSION}.${TARGET}.tar.xz" + PKG_NAME="shadowsocks-v${VERSION}-stable.${TARGET}.tar.xz" PKG_PATH="${PKG_DIR}/${PKG_NAME}" echo "* Packaging XZ in ${PKG_PATH} ..." @@ -62,7 +62,7 @@ function build() { cd "${PKG_DIR}" shasum -a 256 "${PKG_NAME}" > "${PKG_NAME}.sha256" elif [[ "$TARGET" == *"-windows-"* ]]; then - PKG_NAME="shadowsocks-v${VERSION}.${TARGET}.zip" + PKG_NAME="shadowsocks-v${VERSION}-stable.${TARGET}.zip" PKG_PATH="${PKG_DIR}/${PKG_NAME}" echo "* Packaging ZIP in ${PKG_PATH} ..."