|
| 1 | +# Builds the Betaflight TX lua scripts. |
| 2 | +# |
| 3 | +# After building, artifacts are released to a seperate repository. |
| 4 | +# |
| 5 | +# Azure Pipelines requires the following extensions to be installed: |
| 6 | +# - GitHub Tool: https://marketplace.visualstudio.com/items?itemName=marcelo-formentao.github-tools |
| 7 | +# |
| 8 | +# You'll also need to setup the follwing pipeline variables: |
| 9 | +# "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 |
| 10 | +# "endpoint" - The name of the github endpoint link setup in AzDo - setup when linking AzDo and GitHub |
| 11 | +# "owner" - The owner of the repository to release to e.g. betaflight |
| 12 | +# "repoName" - The name of the repository to release to e.g. betaflight-configurator-nightly |
| 13 | + |
| 14 | +name: $(Date:yyyyMMdd).$(BuildID) |
| 15 | +trigger: |
| 16 | + batch: true |
| 17 | + branches: |
| 18 | + include: |
| 19 | + - master |
| 20 | +pr: none |
| 21 | + |
| 22 | +stages: |
| 23 | +- stage: Build |
| 24 | + jobs: |
| 25 | + - job: 'Linux' |
| 26 | + pool: |
| 27 | + vmImage: 'ubuntu-16.04' |
| 28 | + steps: |
| 29 | + - script: sudo apt-get -y install lua5.2 |
| 30 | + displayName: 'Install lua compiler.' |
| 31 | + - script: make release -C $(System.DefaultWorkingDirectory) |
| 32 | + displayName: 'Test and build the release.' |
| 33 | + - powershell: Set-Content -Path '$(System.DefaultWorkingDirectory)/release/log.txt' -Value $env:BUILD_SOURCEVERSIONMESSAGE |
| 34 | + - task: PublishPipelineArtifact@1 |
| 35 | + displayName: 'Publish release' |
| 36 | + inputs: |
| 37 | + artifactName: betaflight-tx-lua-scripts |
| 38 | + targetPath: '$(System.DefaultWorkingDirectory)/release' |
| 39 | + |
| 40 | +- stage: Release |
| 41 | + jobs: |
| 42 | + - job: Release |
| 43 | + steps: |
| 44 | + - task: DownloadPipelineArtifact@2 |
| 45 | + inputs: |
| 46 | + buildType: 'current' |
| 47 | + targetPath: '$(Pipeline.Workspace)' |
| 48 | + - powershell: Write-Output ("##vso[task.setvariable variable=releaseNotes;]$(gc $(Pipeline.Workspace)/betaflight-tx-lua-scripts/log.txt)") |
| 49 | + - task: GitHubReleasePublish@1 |
| 50 | + inputs: |
| 51 | + githubEndpoint: '$(endpoint)' |
| 52 | + manuallySetRepository: true |
| 53 | + githubOwner: '$(owner)' |
| 54 | + githubRepositoryName: '$(repoName)' |
| 55 | + githubReleaseNotes: '$(releaseNotes)' |
| 56 | + githubReleaseDraft: false |
| 57 | + githubReleasePrerelease: false |
| 58 | + githubIgnoreAssets: false |
| 59 | + githubReleaseAsset: | |
| 60 | + $(Pipeline.Workspace)/betaflight-tx-lua-scripts/** |
| 61 | + githubReuseRelease: true |
| 62 | + githubReuseDraftOnly: true |
| 63 | + githubSkipDuplicatedAssets: false |
| 64 | + githubEditRelease: false |
| 65 | + githubDeleteEmptyTag: false |
0 commit comments