forked from betaflight/betaflight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
119 lines (105 loc) · 3.89 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Builds the Betaflight 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. betaflight
# "repoName" - The name of the repository to release to e.g. betaflight-configurator-nightly
variables:
owner: betaflight
repoName: betaflight-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:
batch: true
branches:
include:
- master
- "*-maintenance"
pr:
drafts: false
branches:
include:
- master
- "*-maintenance"
stages:
- stage: Build
jobs:
- job: 'Linux'
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: make arm_sdk_install
displayName: 'Install the build toolchain'
- script: sudo apt-get install -y libblocksruntime-dev
displayName: 'Install extra packages'
- script: make checks
displayName: 'Run sanity checks'
- script: make test-all
displayName: 'Run all unit tests'
- script: make all
displayName: 'Build all oficial targets'
- script: mkdir release; cp obj/*.hex release/
displayName: 'Copy artefacts'
- task: PublishPipelineArtifact@1
displayName: 'Publish Linux release'
inputs:
artifactName: betaflight
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)/betaflight/**
githubReuseRelease: true
githubReuseDraftOnly: false
githubSkipDuplicatedAssets: false
githubEditRelease: true
githubDeleteEmptyTag: false