Skip to content

Commit ac9d186

Browse files
committed
Added azure build.
1 parent e8ee759 commit ac9d186

File tree

2 files changed

+77
-6
lines changed

2 files changed

+77
-6
lines changed

Makefile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
all:
2-
bin/build.sh
1+
DIR := ${CURDIR}
2+
3+
all: files
4+
5+
files:
6+
@bin/build.sh
37

48
clean:
5-
rm -rf obj/*
9+
@rm -rf obj/*
610

7-
release: clean all
11+
release: clean files
12+
@RELEASE_DIR=release; \
813
FILE_NAME="betaflight-tx-lua-scripts_$$(git describe --abbrev=0 --tags).zip"; \
9-
rm -f $${FILE_NAME}; \
10-
zip -r $${FILE_NAME} obj/
14+
mkdir -p $${RELEASE_DIR}; \
15+
rm -f $${RELEASE_DIR}/$${FILE_NAME}; \
16+
zip -q -r $${RELEASE_DIR}/$${FILE_NAME} obj/

azure-pipelines.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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

Comments
 (0)