-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipeline.yml
129 lines (126 loc) · 3.48 KB
/
azure-pipeline.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
trigger:
branches:
include:
- 'master'
tags:
include:
- 'v*'
resources:
- repo: self
variables:
tag: '$(Build.BuildId)'
stages:
- stage: Build
displayName: Build and test
jobs:
- job: Build
displayName: Build and test
pool:
vmImage: 'ubuntu-latest'
container: cenotelie/hime-build-env:latest
steps:
- script: ./build.sh
- stage: BuildPublishableArtifacts
displayName: Build publishable artifacts
# condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
jobs:
- job: linux
pool:
vmImage: 'ubuntu-latest'
container: cenotelie/hime-build-env:latest
steps:
- script: |
cargo build --release --target x86_64-unknown-linux-musl
displayName: Build
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)/target/x86_64-unknown-linux-musl/release'
contents: |
himecc
hime_sdk_debugger
hime_parseit
hime_langserv
targetFolder: '$(Build.ArtifactStagingDirectory)'
overWrite: true
- task: PublishPipelineArtifact@1
inputs:
path: '$(Build.ArtifactStagingDirectory)'
artifact: linux-musl
- job: windows
pool:
vmImage: 'windows-latest'
steps:
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-host x86_64-pc-windows-msvc
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
cargo --version
displayName: Install Rust
- script: |
cargo build --release
displayName: Build
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)/target/release'
contents: |
himecc.exe
hime_sdk_debugger.exe
hime_parseit.exe
hime_langserv.exe
targetFolder: '$(Build.ArtifactStagingDirectory)'
overWrite: true
- task: PublishPipelineArtifact@1
inputs:
path: '$(Build.ArtifactStagingDirectory)'
artifact: windows
- job: macos
pool:
vmImage: 'macOS-latest'
steps:
- script: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
cargo --version
displayName: Install Rust
- script: |
cargo build --release
displayName: Build
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)/target/release'
contents: |
himecc
hime_sdk_debugger
hime_parseit
hime_langserv
targetFolder: '$(Build.ArtifactStagingDirectory)'
overWrite: true
- task: PublishPipelineArtifact@1
inputs:
path: '$(Build.ArtifactStagingDirectory)'
artifact: macos
- stage: PublishArtifacts
displayName: Publish artifacts
# condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
jobs:
- job: Publish
pool:
vmImage: 'ubuntu-latest'
steps:
- script: |
mkdir target
- task: DownloadPipelineArtifact@2
inputs:
source: 'current'
path: $(Build.SourcesDirectory)/target
- task: DownloadSecureFile@1
name: s3config
inputs:
secureFile: 's3.json'
- script: |
source build-env.sh
curl -o s3cli "https://cenotelie.s3.fr-par.scw.cloud/s3cli"
chmod +x s3cli
./build-publish-s3.sh $(s3config.secureFilePath)