diff --git a/.ci/install.yml b/.ci/install.yml new file mode 100644 index 00000000..18900540 --- /dev/null +++ b/.ci/install.yml @@ -0,0 +1,10 @@ +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' ) \ No newline at end of file diff --git a/.ci/linux-release.yml b/.ci/linux-release.yml new file mode 100644 index 00000000..80c9789a --- /dev/null +++ b/.ci/linux-release.yml @@ -0,0 +1,48 @@ +steps: + - script: 'cargo build --release' + displayName: Build Release + condition: succeeded() + - 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)' + - 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: 'vault713/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 + compareWith: 'lastFullRelease' \ No newline at end of file diff --git a/.ci/macos-release.yml b/.ci/macos-release.yml new file mode 100644 index 00000000..b7ca289a --- /dev/null +++ b/.ci/macos-release.yml @@ -0,0 +1,47 @@ +steps: + - script: 'cargo build --release' + displayName: Build Release + condition: succeeded() + - 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)' + - 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: 'vault713/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: false \ No newline at end of file diff --git a/.ci/windows-release.yml b/.ci/windows-release.yml new file mode 100644 index 00000000..684d67e6 --- /dev/null +++ b/.ci/windows-release.yml @@ -0,0 +1,47 @@ +steps: + - script: 'cargo build --release' + displayName: Build Release + condition: succeeded() + - 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)' + - 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.exe' + archiveType: '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 + 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: 'vault713/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: false \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..bb2aa8dd --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,45 @@ +trigger: + tags: + include: ['*'] + +pr: + branches: + 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/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