forked from cleanflight/cleanflight
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
101 lines (88 loc) · 3.54 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Builds the Cleanflight firmware
#
# After building, artifacts are released to a seperate repository.
#
# Azure Pipelines requires the following extensions to be installed:
# - GitHub Tool: https://marketplace.visualstudio.com/items?itemName=marcelo-formentao.github-tools
#
# You'll also need to setup the follwing pipeline variables:
# "releaseNotes" - This is used to add the release notes in the windows job in the build stage so they can be published as part of the github release in the release stage
# "endpoint" - The name of the github endpoint link setup in AzDo - setup when linking AzDo and GitHub
# "owner" - The owner of the repository to release to e.g. cleanflight
# "repoName" - The name of the repository to release to e.g. cleanflight-configurator-nightly
variables:
owner: cleanflight
repoName: cleanflight-firmware-pull-requests
releaseNotes: This is a build of a community provided pull request. It may be unstable and result in corrupted configurations or data loss. **Use only for testing.**
name: $(Build.RequestedFor)_$(Build.SourceBranchName)_$(BuildID)
trigger: none
stages:
- stage: Build
jobs:
- job: 'Linux'
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: make arm_sdk_install
displayName: 'Install the build toolchain'
- script: make unified
displayName: 'Build the Unified Targets'
- script: mkdir release; cp obj/*.hex release/
displayName: 'Copy artefacts'
- task: PublishPipelineArtifact@1
displayName: 'Publish Linux release'
inputs:
artifactName: cleanflight
targetPath: '$(System.DefaultWorkingDirectory)/release/'
- stage: Release
jobs:
- job: Release
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
targetPath: '$(Pipeline.Workspace)'
- powershell: Write-Output ("##vso[task.setvariable variable=today;]$(Get-Date -Format yyyyMMdd)")
- task: GitHubReleasePublish@1
inputs:
githubEndpoint: '$(endpoint)'
manuallySetRepository: true
githubOwner: '$(owner)'
githubRepositoryName: '$(repoName)'
githubTag: $(today).$(Build.Repository.Name).$(Build.SourceBranchName)
githubReleaseTitle: '$(Build.Repository.Name): $(Build.SourceBranchName) ($(today))'
githubReleaseNotes: |+
$(releaseNotes)
### Repository:
$(Build.Repository.Name) ([link]($(Build.Repository.Uri)))
### Pull request branch:
$(Build.SourceBranchName) ([link]($(Build.Repository.Uri)/tree/$(Build.SourceBranchName)))
### Author:
$(Build.RequestedFor)
### Latest changeset:
$(Build.SourceVersion) ([link]($(Build.Repository.Uri)/commit/$(Build.SourceVersion)))
### Changes:
$(Build.SourceVersionMessage)
### Debug:
Build.SourceBranchName
$(Build.SourceBranchName)
Build.Repository.Name
$(Build.Repository.Name)
Build.Repository.ID
$(Build.Repository.ID)
Build.Repository.Uri
$(Build.Repository.Uri)
Build.RequestedFor
$(Build.RequestedFor)
Build.QueuedBy
$(Build.QueuedBy)
githubReleaseDraft: false
githubReleasePrerelease: false
githubIgnoreAssets: false
githubReleaseAsset: |
$(Pipeline.Workspace)/cleanflight/**
githubReuseRelease: true
githubReuseDraftOnly: false
githubSkipDuplicatedAssets: false
githubEditRelease: true
githubDeleteEmptyTag: false