From 95a7e1bb02e7f50739c29cbfcce95ef678252a23 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 24 Sep 2019 23:51:01 +0200 Subject: [PATCH] Fix Windows release. --- azure-pipelines.yml | 10 +++++++++- ci/build_release.sh | 11 +++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b89953252..b59ac32dc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -90,7 +90,15 @@ steps: condition: and(startsWith(variables['TAG'], 'v'), eq(variables['CRATES_IO_PUBLISH'], '1')) - bash: ci/build_release.sh displayName: Build Release - condition: and(startsWith(variables['TAG'], 'v'), eq(variables['DEPLOY'], '1')) + condition: eq(variables['DEPLOY'], '1') + - task: ArchiveFiles@2 + inputs: + includeRootFolder: false + archiveType: tar + tarCompression: gz + archiveFile: $(Build.ArtifactStagingDirectory)/cross-$(TAG)-$(TARGET).tar.gz + verbose: true + condition: eq(variables['DEPLOY'], '1') - task: GithubRelease@0 displayName: Create GitHub Release inputs: diff --git a/ci/build_release.sh b/ci/build_release.sh index 15bec6a6f..3e9bfdcb0 100755 --- a/ci/build_release.sh +++ b/ci/build_release.sh @@ -3,6 +3,13 @@ set -eux cargo install --path . --force -cross rustc --target "${TARGET}" --release -- -C lto +cross build --target "${TARGET}" --release -tar czf "${BUILD_ARTIFACTSTAGINGDIRECTORY}/cross-${TAG}-${TARGET}.tar.gz" -C "target/${TARGET}/release" cross +rm -rf "${BUILD_BINARIESDIRECTORY}" +mkdir "${BUILD_BINARIESDIRECTORY}" + +if [[ -f "target/${TARGET}/release/cross.exe" ]]; then + mv "target/${TARGET}/release/cross.exe" "${BUILD_BINARIESDIRECTORY}/" +else + mv "target/${TARGET}/release/cross" "${BUILD_BINARIESDIRECTORY}/" +fi