Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

improve CI, make release binaries #51

Merged
merged 2 commits into from
Apr 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
trigger:
branches:
include:
- refs/heads/master
- refs/tags/*

jobs:
- job: test_wrangler
displayName: "Run wrangler tests, fmt, and clippy"
Expand All @@ -18,3 +24,113 @@ jobs:
- template: ci/azure-install-rust.yml
- script: cargo test --locked
displayName: "cargo test --locked"

- job: test_wrangler_nightly
displayName: "Run wrangler tests (nightly)"
steps:
- template: ci/azure-install-rust.yml
parameters:
toolchain: nightly
- script: cargo test --locked
displayName: "cargo test --locked"

- job: dist_linux
displayName: "Dist Linux binary"
steps:
- template: ci/azure-install-rust.yml
- script: rustup target add x86_64-unknown-linux-musl
- script: |
sudo apt update -y
sudo apt install musl-tools -y
displayName: "Install musl-tools"
- script: |
set -ex
cargo build --target x86_64-unknown-linux-musl --features vendored-openssl --release
- template: ci/azure-create-tarball.yml
parameters:
artifacts: target/x86_64-unknown-linux-musl/release
name: dist_linux

- job: dist_darwin
displayName: "Dist Darwin binary"
pool:
vmImage: macOS-10.13
steps:
- template: ci/azure-install-rust.yml
- script: cargo build --release
env:
MACOSX_DEPLOYMENT_TARGET: 10.7
- template: ci/azure-create-tarball.yml
parameters:
name: dist_darwin

- job: dist_windows
displayName: "Dist Windows binary"
pool:
vmImage: vs2017-win2016
steps:
- template: ci/azure-install-rust.yml
- script: cargo build --release
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
- template: ci/azure-create-tarball.yml
parameters:
name: dist_windows

- job: deploy
dependsOn:
- dist_linux
- dist_darwin
- dist_windows
displayName: "Deploy release binaries"
steps:
- template: ci/azure-install-rust.yml
- task: DownloadPipelineArtifact@0
displayName: "Download dist - windows"
inputs:
artifactName: dist_windows
targetPath: tmp/windows
- task: DownloadPipelineArtifact@0
displayName: "Download dist - linux"
inputs:
artifactName: dist_linux
targetPath: tmp/linux
- task: DownloadPipelineArtifact@0
displayName: "Download dist - darwin"
inputs:
artifactName: dist_darwin
targetPath: tmp/darwin
- script: |
set -ex
mkdir -p gh-release
find .
tag=`git describe --tags`
mk() {
target=$1
src=$2
name=wrangler-$tag-$target
mkdir -p tmp/$name
cp README.md \
LICENSE-MIT \
LICENSE-APACHE \
tmp/$src/wrangler* \
tmp/$name/
chmod +x tmp/$name/wrangler*
tar czvf gh-release/$name.tar.gz -C tmp $name
}
mk x86_64-unknown-linux-musl linux
mk x86_64-apple-darwin darwin
mk x86_64-pc-windows-msvc windows
displayName: "prepare the github releases tarball artifacts"
- task: PublishPipelineArtifact@0
displayName: "publish gh_release artifact"
inputs:
artifactName: gh_release
targetPath: gh-release
- task: GithubRelease@0
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: 'Create GitHub Release'
inputs:
gitHubConnection: ashleygwilliams-token
repositoryName: cloudflare/wrangler
assets: gh-release/*.tar.gz
14 changes: 14 additions & 0 deletions ci/azure-create-tarball.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
parameters:
artifacts: 'target/release'
name: ''

steps:
- bash: |
set -ex
dst=$BUILD_ARTIFACTSTAGINGDIRECTORY
cp ${{ parameters.artifacts }}/wrangler $dst/
displayName: Create distribution tarball
- task: PublishPipelineArtifact@0
inputs:
artifactName: ${{ parameters.name }}
targetPath: '$(Build.ArtifactStagingDirectory)'