-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipelines.yml
83 lines (69 loc) · 2.37 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
variables:
GITHUB_OAUTH_CONNECTION_NAME: 'github-pulkin'
GITHUB_REPO: 'pulkin/openmx-hks'
GITHUB_RELEASE_TAG: 'latest-build'
stages:
- stage: build
displayName: 'Build and test'
jobs:
- job: build_ubuntu_latest
displayName: 'Ubuntu build'
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- script: |
sudo apt-get update
sudo apt-get install build-essential gcc-multilib
sudo apt-get install libhdf5-dev python-h5py python-scipy
displayName: 'Install compiler and dependencies'
- script: sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial.so /usr/lib/x86_64-linux-gnu/libhdf5.so
displayName: 'Patch Ubintu hdf5'
- script: |
CFLAGS=-I/usr/include/hdf5/serial make -C src
displayName: 'Build'
- script: |
cd test
./test.py
displayName: 'Test'
- task: PublishPipelineArtifact@1
displayName: 'Collect the build'
inputs:
targetPath: '$(Build.Repository.LocalPath)/build'
artifact: 'build_ubuntu_latest'
- stage: publish
displayName: 'Publish builds'
dependsOn: build
jobs:
- job: publish
displayName: 'Download and publish builds'
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download all builds'
inputs:
buildType: 'current'
targetPath: '$(Build.BinariesDirectory)'
- script: |
mv $(Build.BinariesDirectory)/build_ubuntu_latest/* $(Build.BinariesDirectory)
rm -rf $(Build.BinariesDirectory)/build_ubuntu_latest
displayName: 'Sort and filter binaries'
- task: GitHubRelease@0
displayName: 'Publish on Github releases'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
gitHubConnection: $(GITHUB_OAUTH_CONNECTION_NAME)
repositoryName: $(GITHUB_REPO)
action: 'edit'
target: '$(Build.SourceVersion)'
tag: $(GITHUB_RELEASE_TAG)
title: 'Latest master build'
releaseNotesSource: 'input'
releaseNotes: |
The latest successful `master` build.
Binaries
--------
- [ubuntu-latest x86_64](https://github.com/$(GITHUB_REPO)/releases/download/$(GITHUB_RELEASE_TAG)/openmx-hks)
assets: '$(Build.BinariesDirectory)/*'
assetUploadMode: 'replace'
isPreRelease: true
addChangeLog: false