2019-03-06 20:25:34 +00:00
|
|
|
# AppVeyor CI configuration for building Windows binaries for ffsend.
|
|
|
|
# These Windows binaries are published on GitHub as release files.
|
|
|
|
#
|
|
|
|
# The main CI runs on GitLab CI at: https://gitlab.com/timvisee/ffsend/pipelines
|
|
|
|
|
2019-03-05 06:59:54 +00:00
|
|
|
# Only build version tags
|
2019-03-08 16:13:49 +00:00
|
|
|
skip_non_tags: true
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- /v\d*\.\d*\.\d*/
|
2019-03-05 06:59:54 +00:00
|
|
|
|
|
|
|
# Build for the x86_64 Windows target
|
2019-03-04 19:38:27 +00:00
|
|
|
platform: x64
|
2019-03-04 15:53:35 +00:00
|
|
|
environment:
|
2019-03-04 16:07:40 +00:00
|
|
|
SSL_CERT_FILE: "C:\\OpenSSL\\cacert.pem"
|
2019-03-04 15:53:35 +00:00
|
|
|
RUSTUP_USE_HYPER: 1
|
|
|
|
CARGO_HTTP_CHECK_REVOKE: false
|
|
|
|
GITHUB_TOKEN:
|
|
|
|
secure: jqZ4q5oOthKX/pBL1tRsBJsfGPIee3q+N/UBSCZNjCrlFUNfQSfibBPzzICYg1he
|
2019-03-07 20:26:15 +00:00
|
|
|
CHOCOLATEY_TOKEN:
|
|
|
|
secure: k5Q57xoXa6qSFScSpRaww2puW0yjYoH19uIq3qS1emOG+lNs9TYCnWYhUzQ2gzfc
|
2019-03-04 15:53:35 +00:00
|
|
|
|
|
|
|
matrix:
|
|
|
|
- TARGET: x86_64-pc-windows-msvc
|
2019-03-04 16:07:40 +00:00
|
|
|
BITS: 64
|
|
|
|
OPENSSL_VERSION: 1_1_0j
|
|
|
|
OPENSSL_DIR: C:\OpenSSL
|
2019-03-04 15:53:35 +00:00
|
|
|
|
2019-03-05 06:59:54 +00:00
|
|
|
# Extract release binary artifacts
|
2019-03-04 19:38:27 +00:00
|
|
|
artifacts:
|
|
|
|
- path: .\ffsend*.exe
|
2019-03-07 20:12:46 +00:00
|
|
|
- path: .\ffsend.*.nupkg
|
2019-03-04 19:38:27 +00:00
|
|
|
|
2019-03-05 08:59:36 +00:00
|
|
|
# Install dependencies: Rust and OpenSSL
|
2019-03-04 15:53:35 +00:00
|
|
|
install:
|
2019-03-04 16:07:40 +00:00
|
|
|
# Install OpenSSL
|
2019-03-07 20:26:15 +00:00
|
|
|
- mkdir C:\OpenSSL
|
|
|
|
- ps: if (Test-Path env:OPENSSL_VERSION) { Start-FileDownload "http://slproweb.com/download/Win${env:BITS}OpenSSL-${env:OPENSSL_VERSION}.exe" }
|
|
|
|
- if defined OPENSSL_VERSION Win%BITS%OpenSSL-%OPENSSL_VERSION%.exe /SILENT /VERYSILENT /SP- /DIR="C:\OpenSSL"
|
|
|
|
- appveyor DownloadFile https://curl.haxx.se/ca/cacert.pem -FileName C:\OpenSSL\cacert.pem
|
2019-03-07 20:14:44 +00:00
|
|
|
- choco install openssl.light --version 1.1.0.80000000 -y -f
|
2019-03-04 16:07:40 +00:00
|
|
|
|
|
|
|
# Install Rust
|
2019-03-04 15:53:35 +00:00
|
|
|
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
|
2019-03-05 08:59:36 +00:00
|
|
|
- rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain stable
|
2019-03-04 15:53:35 +00:00
|
|
|
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
|
|
|
|
- rustc -V
|
|
|
|
- cargo -V
|
|
|
|
- git submodule update --init
|
|
|
|
|
2019-03-05 08:59:36 +00:00
|
|
|
# Build dynamic and static Windows binaries, release on GitHub
|
2019-03-04 15:53:35 +00:00
|
|
|
build_script:
|
2019-03-08 16:13:49 +00:00
|
|
|
# Build dynamic release binary
|
|
|
|
- cargo build --release --features no-color --verbose
|
|
|
|
- copy .\target\release\ffsend.exe .\ffsend-%TARGET%.exe
|
2019-03-04 17:49:38 +00:00
|
|
|
|
|
|
|
# Build static release binary
|
2019-03-04 17:18:38 +00:00
|
|
|
- set RUSTFLAGS=-Ctarget-feature=+crt-static
|
2019-03-04 19:38:27 +00:00
|
|
|
- cargo build --release --features no-color --verbose
|
2019-03-04 17:49:38 +00:00
|
|
|
- copy .\target\release\ffsend.exe .\ffsend-%TARGET%-static.exe
|
|
|
|
|
|
|
|
# Install github-release
|
|
|
|
- appveyor DownloadFile https://github.com/tfausak/github-release/releases/download/1.2.4/github-release-windows.zip -FileName github-release.zip
|
|
|
|
- 7z e github-release.zip
|
|
|
|
|
2019-03-07 20:12:46 +00:00
|
|
|
# Collect binary, set package version and build chocolatey package
|
|
|
|
- copy .\ffsend-%TARGET%-static.exe .\pkg\choco\ffsend\tools\ffsend.exe
|
|
|
|
- cd .\pkg\choco\ffsend\
|
2019-03-08 15:21:28 +00:00
|
|
|
- ps: echo $env:APPVEYOR_REPO_TAG_NAME
|
2019-03-08 15:54:03 +00:00
|
|
|
- ps: ((Get-Content -path .\ffsend.nuspec -Raw) -replace "0.0.0",$env:APPVEYOR_REPO_TAG_NAME.Substring(1)) | Set-Content -Path .\ffsend.nuspec
|
2019-03-07 20:12:46 +00:00
|
|
|
- choco pack
|
2019-03-07 20:45:48 +00:00
|
|
|
- copy ffsend.*.nupkg ..\..\..\
|
2019-03-07 20:12:46 +00:00
|
|
|
- cd ..\..\..\
|
|
|
|
|
2019-03-08 16:13:49 +00:00
|
|
|
# Create the release, upload the binaries
|
2019-03-10 17:50:16 +00:00
|
|
|
- ps: .\github-release.exe release --token $env:GITHUB_TOKEN --owner timvisee --repo ffsend --tag $env:APPVEYOR_REPO_TAG_NAME --title "ffsend $env:APPVEYOR_REPO_TAG_NAME"
|
|
|
|
- ps: .\github-release.exe upload --token $env:GITHUB_TOKEN --owner timvisee --repo ffsend --tag $env:APPVEYOR_REPO_TAG_NAME --file .\ffsend-$env:TARGET.exe --name ffsend-$env:APPVEYOR_REPO_TAG_NAME-windows-x64.exe
|
|
|
|
- ps: .\github-release.exe upload --token $env:GITHUB_TOKEN --owner timvisee --repo ffsend --tag $env:APPVEYOR_REPO_TAG_NAME --file .\ffsend-$env:TARGET-static.exe --name ffsend-$env:APPVEYOR_REPO_TAG_NAME-windows-x64-static.exe
|
|
|
|
- ps: .\github-release.exe upload --token $env:GITHUB_TOKEN --owner timvisee --repo ffsend --tag $env:APPVEYOR_REPO_TAG_NAME --file (Get-Item .\ffsend.*.nupkg).FullName --name ffsend-$env:APPVEYOR_REPO_TAG_NAME.nupkg
|
2019-03-07 20:12:46 +00:00
|
|
|
|
2019-03-09 23:54:58 +00:00
|
|
|
# Publish the chocolatey package
|
2019-03-10 19:28:37 +00:00
|
|
|
# TODO: re-enable when chocolatey is properly accepting packages again
|
|
|
|
# - cd .\pkg\choco\ffsend\
|
|
|
|
# - choco push --api-key %CHOCOLATEY_TOKEN%
|
|
|
|
# - cd ..\..\..\
|
2019-03-09 23:54:58 +00:00
|
|
|
|
2019-03-05 08:59:36 +00:00
|
|
|
# We don't test anything here
|
2019-03-04 15:53:35 +00:00
|
|
|
test: false
|