forked from betaflight/betaflight-tx-lua-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
70 lines (66 loc) · 2.66 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
# Builds the Betaflight TX lua scripts.
#
# 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-tx-lua-scripts-nightlies
releaseNotes: This is a nightly build off the tip of 'master'. It may be unstable and result in corrupted configurations or data loss. **Use only for testing.**
name: $(Date:yyyyMMdd).$(BuildID)
trigger:
batch: true
branches:
include:
- master
pr: none
stages:
- stage: Build
jobs:
- job: 'Linux'
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: sudo apt-get -y install lua5.2
displayName: 'Install lua compiler.'
- script: make release -C $(System.DefaultWorkingDirectory)
displayName: 'Test and build the release.'
- powershell: Set-Content -Path '$(System.DefaultWorkingDirectory)/release/log.txt' -Value $env:BUILD_SOURCEVERSIONMESSAGE
- task: PublishPipelineArtifact@1
displayName: 'Publish release'
inputs:
artifactName: betaflight-tx-lua-scripts
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=releaseNotes;]$(gc $(Pipeline.Workspace)/betaflight-tx-lua-scripts/log.txt)")
- task: GitHubReleasePublish@1
inputs:
githubEndpoint: '$(endpoint)'
manuallySetRepository: true
githubOwner: '$(owner)'
githubRepositoryName: '$(repoName)'
githubReleaseNotes: '$(releaseNotes)'
githubReleaseDraft: false
githubReleasePrerelease: false
githubIgnoreAssets: false
githubReleaseAsset: |
$(Pipeline.Workspace)/betaflight-tx-lua-scripts/**
githubReuseRelease: true
githubReuseDraftOnly: true
githubSkipDuplicatedAssets: false
githubEditRelease: false
githubDeleteEmptyTag: false