From b6784f9f907b05c6bf12e72109aae43b352d85f6 Mon Sep 17 00:00:00 2001 From: jaspervdm Date: Sun, 14 Jul 2019 15:42:00 +0200 Subject: [PATCH 1/6] Azure pipelines test --- .ci/install.yml | 19 +++++++++++++++++ .ci/linux-release.yml | 47 +++++++++++++++++++++++++++++++++++++++++ .ci/macos-release.yml | 47 +++++++++++++++++++++++++++++++++++++++++ .ci/windows-release.yml | 47 +++++++++++++++++++++++++++++++++++++++++ azure-pipelines.yml | 42 ++++++++++++++++++++++++++++++++++++ 5 files changed, 202 insertions(+) create mode 100644 .ci/install.yml create mode 100644 .ci/linux-release.yml create mode 100644 .ci/macos-release.yml create mode 100644 .ci/windows-release.yml create mode 100644 azure-pipelines.yml diff --git a/.ci/install.yml b/.ci/install.yml new file mode 100644 index 00000000..b2134712 --- /dev/null +++ b/.ci/install.yml @@ -0,0 +1,19 @@ +steps: + - script: | + choco install -y llvm + displayName: Windows Install LLVM + condition: eq( variables['Agent.OS'], 'Windows_NT' ) + - script: | + curl https://sh.rustup.rs -sSf | sh -s -- -y + echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" + displayName: macOS Install Rust + condition: eq( variables['Agent.OS'], 'Darwin' ) + - script: | + wget https://www.openssl.org/source/openssl-1.1.0j.tar.gz + tar -xf openssl-1.1.0j.tar.gz + cd openssl-1.1.0j + ./config + make + cd .. + displayName: Linux Install OpenSSL + condition: eq( variables['Agent.OS'], 'Linux' ) \ No newline at end of file diff --git a/.ci/linux-release.yml b/.ci/linux-release.yml new file mode 100644 index 00000000..f79daac4 --- /dev/null +++ b/.ci/linux-release.yml @@ -0,0 +1,47 @@ +steps: + - script: 'OPENSSL_LIB_DIR=./openssl-1.1.0 OPENSSL_INCLUDE_DIR=./openssl-1.1.0/include cargo build --release' + displayName: Build Release + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + - script: | + MY_TAG="$(Build.SourceBranch)" + MY_TAG=${MY_TAG#refs/tags/} + echo $MY_TAG + echo "##vso[task.setvariable variable=build.my_tag]$MY_TAG" + echo "##vso[task.setvariable variable=build.platform]$PLATFORM" + displayName: "Create my tag variable" + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + - task: CopyFiles@2 + displayName: Copy assets + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + inputs: + sourceFolder: '$(Build.SourcesDirectory)/target/release' + contents: 'wallet713' + targetFolder: '$(Build.BinariesDirectory)/wallet713' + - task: ArchiveFiles@2 + displayName: Gather assets + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + inputs: + rootFolderOrFile: '$(Build.BinariesDirectory)/wallet713' + archiveType: 'tar' + tarCompression: 'gz' + archiveFile: '$(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform).tar.gz' + - script: | + openssl sha256 $(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform).tar.gz > $(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform)-sha256sum.txt + displayName: Create Checksum + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + - task: GithubRelease@0 + displayName: Github release + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + inputs: + gitHubConnection: 'jaspervdm' + repositoryName: 'jaspervdm/wallet713' + action: 'edit' + target: '$(build.sourceVersion)' + tagSource: 'manual' + tag: '$(build.my_tag)' + assets: | + $(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform).tar.gz + $(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform)-sha256sum.txt + title: '$(build.my_tag)' + assetUploadMode: 'replace' + addChangeLog: true \ No newline at end of file diff --git a/.ci/macos-release.yml b/.ci/macos-release.yml new file mode 100644 index 00000000..35153e62 --- /dev/null +++ b/.ci/macos-release.yml @@ -0,0 +1,47 @@ +steps: + - script: 'cargo build --release' + displayName: Build Release + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + - script: | + MY_TAG="$(Build.SourceBranch)" + MY_TAG=${MY_TAG#refs/tags/} + echo $MY_TAG + echo "##vso[task.setvariable variable=build.my_tag]$MY_TAG" + echo "##vso[task.setvariable variable=build.platform]$PLATFORM" + displayName: "Create my tag variable" + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + - task: CopyFiles@2 + displayName: Copy assets + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + inputs: + sourceFolder: '$(Build.SourcesDirectory)/target/release' + contents: 'wallet713' + targetFolder: '$(Build.BinariesDirectory)/wallet713' + - task: ArchiveFiles@2 + displayName: Gather assets + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + inputs: + rootFolderOrFile: '$(Build.BinariesDirectory)/wallet713' + archiveType: 'tar' + tarCompression: 'gz' + archiveFile: '$(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform).tar.gz' + - script: | + openssl sha256 $(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform).tar.gz > $(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform)-sha256sum.txt + displayName: Create Checksum + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + - task: GithubRelease@0 + displayName: Github release + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + inputs: + gitHubConnection: 'jaspervdm' + repositoryName: 'jaspervdm/wallet713' + action: 'edit' + target: '$(build.sourceVersion)' + tagSource: 'manual' + tag: '$(build.my_tag)' + assets: | + $(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform).tar.gz + $(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform)-sha256sum.txt + title: '$(build.my_tag)' + assetUploadMode: 'replace' + addChangeLog: true \ No newline at end of file diff --git a/.ci/windows-release.yml b/.ci/windows-release.yml new file mode 100644 index 00000000..cdb71b12 --- /dev/null +++ b/.ci/windows-release.yml @@ -0,0 +1,47 @@ +steps: + - script: 'cargo build --release' + displayName: Build Release + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + - script: | + SET MY_TAG=$(Build.SourceBranch) + SET MY_TAG=%MY_TAG:~10% + echo %MY_TAG% + echo %PLATFORM% + echo ##vso[task.setvariable variable=build.my_tag]%MY_TAG% + echo ##vso[task.setvariable variable=build.platform]%PLATFORM% + displayName: "Create my tag variable" + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + - task: CopyFiles@2 + displayName: Copy assets + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + inputs: + sourceFolder: '$(Build.SourcesDirectory)\target\release' + contents: 'wallet713.exe' + targetFolder: '$(Build.BinariesDirectory)\wallet713' + - task: ArchiveFiles@2 + displayName: Gather assets + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + inputs: + rootFolderOrFile: '$(Build.BinariesDirectory)\wallet713' + archiveType: 'zip' + archiveFile: '$(Build.ArtifactStagingDirectory)\wallet613-$(build.my_tag)-$(build.platform).zip' + - script: | + powershell -Command "get-filehash -algorithm sha256 $(Build.ArtifactStagingDirectory)\wallet713-$(build.my_tag)-$(build.platform).zip | Format-List | Out-String | ForEach-Object { $_.Trim() } > $(Build.ArtifactStagingDirectory)\wallet713-$(build.my_tag)-$(build.platform)-sha256sum.txt" + displayName: Create Checksum + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + - task: GithubRelease@0 + displayName: Github release + condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + inputs: + gitHubConnection: 'jaspervdm' + repositoryName: 'jaspervdm/wallet713' + action: 'edit' + target: '$(build.sourceVersion)' + tagSource: 'manual' + tag: '$(build.my_tag)' + assets: | + $(Build.ArtifactStagingDirectory)\wallet713-$(build.my_tag)-$(build.platform).zip + $(Build.ArtifactStagingDirectory)\wallet713-$(build.my_tag)-$(build.platform)-sha256sum.txt + title: '$(build.my_tag)' + assetUploadMode: 'replace' + addChangeLog: true \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..e3e8c7b3 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,42 @@ +trigger: + tags: + include: ['*'] + +variables: + RUST_BACKTRACE: '1' + RUSTFLAGS: '-C debug-assertions' + +jobs: +- job: linux + pool: + vmImage: ubuntu-16.04 + strategy: + matrix: + release: + CI_JOB: release + PLATFORM: linux-amd64 + steps: + - template: '.ci/install.yml' + - template: '.ci/linux-release.yml' +- job: macos + pool: + vmImage: macos-10.14 + strategy: + matrix: + release: + CI_JOB: release + PLATFORM: macos + steps: + - template: '.ci/install.yml' + - template: '.ci/macos-release.yml' +- job: windows + pool: + vmImage: windows-2019 + strategy: + matrix: + release: + CI_JOB: release + PLATFORM: win-x64 + steps: + - template: '.ci/install.yml' + - template: '.ci/windows-release.yml' \ No newline at end of file From 6eed935058cf0f5bb1e28f52688cd49efa894a1f Mon Sep 17 00:00:00 2001 From: jaspervdm Date: Sun, 14 Jul 2019 16:30:56 +0200 Subject: [PATCH 2/6] Install OpenSSL via apt-get --- .ci/install.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.ci/install.yml b/.ci/install.yml index b2134712..e3e4c01f 100644 --- a/.ci/install.yml +++ b/.ci/install.yml @@ -9,11 +9,6 @@ steps: displayName: macOS Install Rust condition: eq( variables['Agent.OS'], 'Darwin' ) - script: | - wget https://www.openssl.org/source/openssl-1.1.0j.tar.gz - tar -xf openssl-1.1.0j.tar.gz - cd openssl-1.1.0j - ./config - make - cd .. + sudo apt-get install openssl displayName: Linux Install OpenSSL condition: eq( variables['Agent.OS'], 'Linux' ) \ No newline at end of file From fcb7ffcfdc829d3c831e636babb8929dca00774c Mon Sep 17 00:00:00 2001 From: jaspervdm Date: Sun, 14 Jul 2019 16:38:29 +0200 Subject: [PATCH 3/6] No need to install OpenSSL --- .ci/install.yml | 6 +----- .ci/linux-release.yml | 4 ++-- .ci/macos-release.yml | 2 +- .ci/windows-release.yml | 2 +- azure-pipelines.yml | 1 - 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.ci/install.yml b/.ci/install.yml index e3e4c01f..18900540 100644 --- a/.ci/install.yml +++ b/.ci/install.yml @@ -7,8 +7,4 @@ steps: curl https://sh.rustup.rs -sSf | sh -s -- -y echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" displayName: macOS Install Rust - condition: eq( variables['Agent.OS'], 'Darwin' ) - - script: | - sudo apt-get install openssl - displayName: Linux Install OpenSSL - condition: eq( variables['Agent.OS'], 'Linux' ) \ No newline at end of file + condition: eq( variables['Agent.OS'], 'Darwin' ) \ No newline at end of file diff --git a/.ci/linux-release.yml b/.ci/linux-release.yml index f79daac4..7e7b31b4 100644 --- a/.ci/linux-release.yml +++ b/.ci/linux-release.yml @@ -1,7 +1,7 @@ steps: - - script: 'OPENSSL_LIB_DIR=./openssl-1.1.0 OPENSSL_INCLUDE_DIR=./openssl-1.1.0/include cargo build --release' + - script: 'cargo build --release' displayName: Build Release - condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + condition: succeeded() - script: | MY_TAG="$(Build.SourceBranch)" MY_TAG=${MY_TAG#refs/tags/} diff --git a/.ci/macos-release.yml b/.ci/macos-release.yml index 35153e62..7e7b31b4 100644 --- a/.ci/macos-release.yml +++ b/.ci/macos-release.yml @@ -1,7 +1,7 @@ steps: - script: 'cargo build --release' displayName: Build Release - condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + condition: succeeded() - script: | MY_TAG="$(Build.SourceBranch)" MY_TAG=${MY_TAG#refs/tags/} diff --git a/.ci/windows-release.yml b/.ci/windows-release.yml index cdb71b12..69692a8b 100644 --- a/.ci/windows-release.yml +++ b/.ci/windows-release.yml @@ -1,7 +1,7 @@ steps: - script: 'cargo build --release' displayName: Build Release - condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) + condition: succeeded() - script: | SET MY_TAG=$(Build.SourceBranch) SET MY_TAG=%MY_TAG:~10% diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e3e8c7b3..65a2b779 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,7 +16,6 @@ jobs: CI_JOB: release PLATFORM: linux-amd64 steps: - - template: '.ci/install.yml' - template: '.ci/linux-release.yml' - job: macos pool: From e06ce1b905a9a5cf16901cfea0236d581d2ff2d6 Mon Sep 17 00:00:00 2001 From: jaspervdm Date: Sun, 14 Jul 2019 16:43:29 +0200 Subject: [PATCH 4/6] Trigger on PR --- azure-pipelines.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 65a2b779..bb2aa8dd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,6 +2,10 @@ trigger: tags: include: ['*'] +pr: + branches: + include: ['*'] + variables: RUST_BACKTRACE: '1' RUSTFLAGS: '-C debug-assertions' From fe8c540a3786d812391ca1d210e2d405a4285b0f Mon Sep 17 00:00:00 2001 From: jaspervdm Date: Sun, 14 Jul 2019 17:08:28 +0200 Subject: [PATCH 5/6] No directory --- .ci/linux-release.yml | 2 +- .ci/macos-release.yml | 2 +- .ci/windows-release.yml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.ci/linux-release.yml b/.ci/linux-release.yml index 7e7b31b4..3fc499ee 100644 --- a/.ci/linux-release.yml +++ b/.ci/linux-release.yml @@ -16,7 +16,7 @@ steps: inputs: sourceFolder: '$(Build.SourcesDirectory)/target/release' contents: 'wallet713' - targetFolder: '$(Build.BinariesDirectory)/wallet713' + targetFolder: '$(Build.BinariesDirectory)' - task: ArchiveFiles@2 displayName: Gather assets condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) diff --git a/.ci/macos-release.yml b/.ci/macos-release.yml index 7e7b31b4..3fc499ee 100644 --- a/.ci/macos-release.yml +++ b/.ci/macos-release.yml @@ -16,7 +16,7 @@ steps: inputs: sourceFolder: '$(Build.SourcesDirectory)/target/release' contents: 'wallet713' - targetFolder: '$(Build.BinariesDirectory)/wallet713' + targetFolder: '$(Build.BinariesDirectory)' - task: ArchiveFiles@2 displayName: Gather assets condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) diff --git a/.ci/windows-release.yml b/.ci/windows-release.yml index 69692a8b..cf720de5 100644 --- a/.ci/windows-release.yml +++ b/.ci/windows-release.yml @@ -17,14 +17,14 @@ steps: inputs: sourceFolder: '$(Build.SourcesDirectory)\target\release' contents: 'wallet713.exe' - targetFolder: '$(Build.BinariesDirectory)\wallet713' + targetFolder: '$(Build.BinariesDirectory)' - task: ArchiveFiles@2 displayName: Gather assets condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) inputs: - rootFolderOrFile: '$(Build.BinariesDirectory)\wallet713' + rootFolderOrFile: '$(Build.BinariesDirectory)\wallet713.exe' archiveType: 'zip' - archiveFile: '$(Build.ArtifactStagingDirectory)\wallet613-$(build.my_tag)-$(build.platform).zip' + archiveFile: '$(Build.ArtifactStagingDirectory)\wallet713-$(build.my_tag)-$(build.platform).zip' - script: | powershell -Command "get-filehash -algorithm sha256 $(Build.ArtifactStagingDirectory)\wallet713-$(build.my_tag)-$(build.platform).zip | Format-List | Out-String | ForEach-Object { $_.Trim() } > $(Build.ArtifactStagingDirectory)\wallet713-$(build.my_tag)-$(build.platform)-sha256sum.txt" displayName: Create Checksum From 0663fa73880c53330a668819aea05764e1c39d50 Mon Sep 17 00:00:00 2001 From: jaspervdm Date: Sun, 14 Jul 2019 17:44:03 +0200 Subject: [PATCH 6/6] Change azure repository name --- .ci/linux-release.yml | 5 +++-- .ci/macos-release.yml | 4 ++-- .ci/windows-release.yml | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.ci/linux-release.yml b/.ci/linux-release.yml index 3fc499ee..80c9789a 100644 --- a/.ci/linux-release.yml +++ b/.ci/linux-release.yml @@ -34,7 +34,7 @@ steps: condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) inputs: gitHubConnection: 'jaspervdm' - repositoryName: 'jaspervdm/wallet713' + repositoryName: 'vault713/wallet713' action: 'edit' target: '$(build.sourceVersion)' tagSource: 'manual' @@ -44,4 +44,5 @@ steps: $(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform)-sha256sum.txt title: '$(build.my_tag)' assetUploadMode: 'replace' - addChangeLog: true \ No newline at end of file + addChangeLog: true + compareWith: 'lastFullRelease' \ No newline at end of file diff --git a/.ci/macos-release.yml b/.ci/macos-release.yml index 3fc499ee..b7ca289a 100644 --- a/.ci/macos-release.yml +++ b/.ci/macos-release.yml @@ -34,7 +34,7 @@ steps: condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) inputs: gitHubConnection: 'jaspervdm' - repositoryName: 'jaspervdm/wallet713' + repositoryName: 'vault713/wallet713' action: 'edit' target: '$(build.sourceVersion)' tagSource: 'manual' @@ -44,4 +44,4 @@ steps: $(Build.ArtifactStagingDirectory)/wallet713-$(build.my_tag)-$(build.platform)-sha256sum.txt title: '$(build.my_tag)' assetUploadMode: 'replace' - addChangeLog: true \ No newline at end of file + addChangeLog: false \ No newline at end of file diff --git a/.ci/windows-release.yml b/.ci/windows-release.yml index cf720de5..684d67e6 100644 --- a/.ci/windows-release.yml +++ b/.ci/windows-release.yml @@ -34,7 +34,7 @@ steps: condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['CI_JOB'], 'release' )) inputs: gitHubConnection: 'jaspervdm' - repositoryName: 'jaspervdm/wallet713' + repositoryName: 'vault713/wallet713' action: 'edit' target: '$(build.sourceVersion)' tagSource: 'manual' @@ -44,4 +44,4 @@ steps: $(Build.ArtifactStagingDirectory)\wallet713-$(build.my_tag)-$(build.platform)-sha256sum.txt title: '$(build.my_tag)' assetUploadMode: 'replace' - addChangeLog: true \ No newline at end of file + addChangeLog: false \ No newline at end of file