1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 01:35:28 +03:00

Fix Azure-Pipelines.yml to do a build and release on check in o… (#1727)

Fix Azure-Pipelines.yml to do a build and release on check in of master branch
This commit is contained in:
Michael Keller 2019-11-03 12:30:23 +13:00 committed by GitHub
commit f6b4d87235
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,103 +2,115 @@
# #
# After building, artifacts are released to a seperate repository. # After building, artifacts are released to a seperate repository.
# #
# Requires Azure Pipelines added to Github repositories: # Azure Pipelines requires the following extensions to be installed:
# https://azure.microsoft.com/services/devops/pipelines/ # - GitHub Tool: https://marketplace.visualstudio.com/items?itemName=marcelo-formentao.github-tools
# #
# Azure Pipelines requires tasks to be installed: # You'll also need to setup the follwing pipeline variables:
# - Github Release: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/github-release # "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
# - File content to variable: https://marketplace.visualstudio.com/items?itemName=maikvandergaag.maikvandergaag-file-to-variable # "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
trigger: trigger:
# TODO: change to master once pull request merged - master
- azure-pipelines
jobs: stages:
- job: 'Windows' - stage: Build
jobs:
pool: - job: 'Windows'
vmImage: 'vs2017-win2016' pool:
vmImage: 'vs2017-win2016'
steps: steps:
- task: NodeTool@0 - task: UseNode@1
inputs: inputs:
versionSpec: '8.11.2' version: '10.16.3'
displayName: 'Install Node.js' displayName: 'Install Node.js 10.16.3'
- script: yarn install
displayName: 'Run yarn install'
- script: yarn release --win32 --win64
displayName: 'Run gulp release'
- powershell: Set-Content -Path '$(System.DefaultWorkingDirectory)/release/log.txt' -Value $env:BUILD_SOURCEVERSIONMESSAGE
- script: npm install -g npm@6.0.1 - task: PublishPipelineArtifact@1
displayName: 'Install NPM' displayName: 'Publish Windows release'
inputs:
targetPath: '$(System.DefaultWorkingDirectory)/release'
artifact: 'betaflight-configurator-windows'
- script: npm install -g gulp - job: 'MacOS'
displayName: 'Install Gulp' pool:
vmImage: 'macos-10.13'
- script: npm install steps:
displayName: 'Run npm install' - task: UseNode@1
inputs:
version: '10.16.3'
displayName: 'Install Node.js 10.16.3'
- script: npm install -g gulp
displayName: 'Install Gulp'
- script: yarn install
displayName: 'Run yarn install'
- script: yarn gulp release --osx64
displayName: 'Run release'
- script: gulp release --win32 - task: PublishPipelineArtifact@1
displayName: 'Run gulp release' displayName: 'Publish MacOS release'
inputs:
artifactName: betaflight-configurator-macos
targetPath: '$(System.DefaultWorkingDirectory)/release'
- powershell: Set-Content -Path '$(System.DefaultWorkingDirectory)/release/log.txt' -Value $env:BUILD_SOURCEVERSIONMESSAGE - job: 'Linux'
pool:
vmImage: 'ubuntu-16.04'
- task: PublishPipelineArtifact@0 steps:
displayName: 'Publish Windows release' - task: UseNode@1
inputs: inputs:
artifactName: betaflight-configurator-windows version: '10.16.3'
targetPath: '$(System.DefaultWorkingDirectory)/release' displayName: 'Install Node.js 10.16.3'
- script: yarn install
displayName: 'Run yarn install'
- script: yarn release --linux32 --linux64
displayName: 'Run gulp release'
- script: cd $(System.DefaultWorkingDirectory)/release; find -mindepth 1 -maxdepth 1 -type d -exec rm -r {} \;
displayName: 'Clean release folders'
- job: 'Linux' - task: PublishPipelineArtifact@1
displayName: 'Publish Linux release'
inputs:
artifactName: betaflight-configurator-linux
targetPath: '$(System.DefaultWorkingDirectory)/release'
pool:
vmImage: 'ubuntu-16.04'
steps: - stage: Release
- task: NodeTool@0 jobs:
inputs: - job: Release
versionSpec: '8.11.2'
displayName: 'Install Node.js'
- script: npm install -g npm@6.0.1 steps:
displayName: 'Install NPM' - task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
targetPath: '$(Pipeline.Workspace)'
- powershell: Write-Output ("##vso[task.setvariable variable=releaseNotes;]$(gc $(Pipeline.Workspace)/betaflight-configurator-windows/log.txt)")
- script: npm install -g gulp - task: GitHubReleasePublish@1
displayName: 'Install Gulp' inputs:
githubEndpoint: '$(endpoint)'
- script: npm install manuallySetRepository: true
displayName: 'Run npm install' githubOwner: '$(owner)'
githubRepositoryName: '$(repoName)'
- script: gulp release --linux32 --linux64 githubReleaseNotes: '$(releaseNotes)'
displayName: 'run gulp release' githubReleaseDraft: false
githubReleasePrerelease: false
- task: PublishPipelineArtifact@0 githubIgnoreAssets: false
displayName: 'Publish Linux release' githubReleaseAsset: |
inputs: $(Pipeline.Workspace)/betaflight-configurator-windows/**
artifactName: betaflight-configurator-linux $(Pipeline.Workspace)/betaflight-configurator-macos/**
targetPath: '$(System.DefaultWorkingDirectory)/release' $(Pipeline.Workspace)/betaflight-configurator-linux/**
githubReuseRelease: true
- job: 'MacOS' githubReuseDraftOnly: true
githubSkipDuplicatedAssets: false
pool: githubEditRelease: false
vmImage: 'macos-10.13' githubDeleteEmptyTag: false
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.11.2'
displayName: 'Install Node.js'
- script: npm install -g npm@6.0.1
displayName: 'Install NPM'
- script: npm install -g gulp
displayName: 'Install Gulp'
- script: npm install
displayName: 'Run rpm install'
- script: gulp release --osx64
displayName: 'Run gulp release'
- task: PublishPipelineArtifact@0
displayName: 'Publish MacOS release'
inputs:
artifactName: betaflight-configurator-macos
targetPath: '$(System.DefaultWorkingDirectory)/release'