Files
shadowsocks-rust/.circleci/config.yml
2020-02-05 23:46:39 +08:00

74 lines
2.5 KiB
YAML

version: 2.1
orbs:
windows: circleci/windows@2.4.0
jobs:
build-linux:
docker:
- image: circleci/rust:stretch
environment:
OPENSSL_STATIC: "1"
OPENSSL_LIB_DIR: "/usr/lib/x86_64-linux-gnu/"
OPENSSL_INCLUDE_DIR: "/usr/include/x86_64-linux-gnu/"
RUSTFLAGS: "-Ctarget-feature=+aes,+ssse3"
steps:
- checkout
- run: |
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev
- run: |
rustc --version >rust-version
test -e Cargo.lock || cargo generate-lockfile
- restore_cache:
key: cargo-cache-{{ arch }}-{{ checksum "rust-version" }}-{{ checksum "Cargo.lock" }}
- run: ./build-host-release
- save_cache:
paths:
- /usr/local/cargo/registry
- ./target
key: cargo-cache-{{ arch }}-{{ checksum "rust-version" }}-{{ checksum "Cargo.lock" }}
- store_artifacts:
path: ./build/release
destination: releases
build-windows:
executor: windows/default
environment:
OPENSSL_STATIC: "1"
OPENSSL_DIR: "C:\\OpenSSL"
RUSTFLAGS: "-Ctarget-feature=+aes,+ssse3"
steps:
- checkout
- run: |
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest -Uri "http://slproweb.com/download/Win64OpenSSL-1_1_1d.exe" -OutFile "C:\Win64OpenSSL-1_1_1d.exe"
& C:\Win64OpenSSL-1_1_1d.exe /SILENT /VERYSILENT /SP- /DIR="C:\OpenSSL"
- run: |
rustc --version | Out-File -FilePath "rust-version"
if (Test-Path "Cargo.lock" -PathType Leaf) {
cargo generate-lockfile
}
- restore_cache:
key: cargo-cache-{{ arch }}-{{ checksum "rust-version" }}-{{ checksum "Cargo.lock" }}
- run: ./build-host-release
- save_cache:
paths:
- /usr/local/cargo/registry
- ./target
key: cargo-cache-{{ arch }}-{{ checksum "rust-version" }}-{{ checksum "Cargo.lock" }}
- store_artifacts:
path: ./build/release
destination: releases
workflows:
version: 2
build-releases:
jobs:
- build-linux
- build-windows