Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Pipelines #176

Merged
merged 69 commits into from
Mar 18, 2020
Merged
Changes from 46 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d1232c0
url property is now null-aware
bhl09 Jan 27, 2020
9ca7bcd
Merge pull request #156 from builttoroam/uri_null_aware
bhl09 Jan 27, 2020
7dfa1b6
fixed nullable allDay error
fmatera-duckma Jan 28, 2020
a2438e2
allDay hotfix and version update
bhl09 Jan 29, 2020
9106be6
Merge pull request #159 from builttoroam/allday_hotfix
bhl09 Jan 30, 2020
bdfbd2f
"&" to "&&"
bhl09 Feb 3, 2020
742f325
updated version/changelog
bhl09 Feb 3, 2020
ffc23d4
Removed unecessary import
bhl09 Feb 3, 2020
5537a32
Merge pull request #163 from builttoroam/allday_hotfix2
bhl09 Feb 3, 2020
c4cbb89
Initial strcture of the CI | CD pipeline
mkieres Mar 3, 2020
2100474
Commenting out macOS pool agent
mkieres Mar 3, 2020
eea6d7b
Add flutter install/build and dry run
bhl09 Mar 3, 2020
dd23424
Update pool
bhl09 Mar 3, 2020
624a097
Update build path
bhl09 Mar 3, 2020
c04fb12
Update dry run command
bhl09 Mar 3, 2020
cd3b7c5
Update flutter path
bhl09 Mar 3, 2020
bcc6c05
Add working directory for command line
bhl09 Mar 3, 2020
ec434bf
Update command line
bhl09 Mar 3, 2020
6354452
Fix path
bhl09 Mar 3, 2020
b057a96
Change to Windows
bhl09 Mar 3, 2020
931725e
Testing versioning
bhl09 Mar 3, 2020
775dd61
Fix wrong variable
bhl09 Mar 3, 2020
a6c8602
Update task name
bhl09 Mar 3, 2020
03f77ae
Fix indenting
bhl09 Mar 3, 2020
30dec31
Update regex and fix typo
bhl09 Mar 3, 2020
48f9345
Update regex
bhl09 Mar 3, 2020
264f204
Update regex
bhl09 Mar 3, 2020
fad6fca
Update powershell script
bhl09 Mar 3, 2020
72e15bd
GitHub tagging
bhl09 Mar 3, 2020
1789362
Testing version
bhl09 Mar 4, 2020
c9a8c06
Update powershell
bhl09 Mar 4, 2020
f63b352
Testing GitHub release
bhl09 Mar 4, 2020
b9828c3
Add release title
bhl09 Mar 4, 2020
908d81c
Clean up CI & Add display names
bhl09 Mar 4, 2020
29ea33c
Testing CI and CD
bhl09 Mar 4, 2020
e54a268
Disable codesign for ios build
bhl09 Mar 4, 2020
16c3fe7
Add assets to github release
bhl09 Mar 4, 2020
d73107a
Add --force command for publish
bhl09 Mar 4, 2020
aa817e3
Update design
bhl09 Mar 4, 2020
c2713a2
Update pre-release versioning
bhl09 Mar 4, 2020
44e02dd
Update condition for testing
bhl09 Mar 4, 2020
b07c20c
Update versioning powershell
bhl09 Mar 4, 2020
c49668c
Update get version path
bhl09 Mar 4, 2020
8d83057
Pipeline ready
bhl09 Mar 4, 2020
13d77f2
Add path filter
bhl09 Mar 4, 2020
2e7ccad
Update pre-release changelog
bhl09 Mar 4, 2020
934756c
Fix spacing
bhl09 Mar 5, 2020
d764d1e
Add logging
bhl09 Mar 5, 2020
4c741b7
Fix scripts
bhl09 Mar 5, 2020
dbb0508
Fix variable
bhl09 Mar 5, 2020
22d94ab
Test dry run
bhl09 Mar 5, 2020
ae0329e
Update test script
bhl09 Mar 5, 2020
f7b3a97
Fix script
bhl09 Mar 5, 2020
b364e81
Remove test methods
bhl09 Mar 5, 2020
38828df
Add spacing
bhl09 Mar 5, 2020
9476f67
Naming and positioning update
bhl09 Mar 5, 2020
625b282
Update to aab and get version summary
bhl09 Mar 5, 2020
228061b
Merge branch 'master' into azure-pipelines
bhl09 Mar 5, 2020
c59e992
Added version summary
bhl09 Mar 5, 2020
8adf76b
Applying minor bug fixes in develop branch
bhl09 Mar 5, 2020
7f3bbac
Update GitHub release
bhl09 Mar 6, 2020
68270a1
Addded a dash
bhl09 Mar 6, 2020
35d7ff7
Add conditions
bhl09 Mar 6, 2020
31abc54
Update variables
bhl09 Mar 13, 2020
592d438
Update namings
bhl09 Mar 13, 2020
302fc55
Update variables
bhl09 Mar 16, 2020
58c4b7e
Removed header comments
bhl09 Mar 18, 2020
777a7bc
Publish first than GitHub tag
bhl09 Mar 18, 2020
a9226d8
Update to publish hotfix as well
bhl09 Mar 18, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# Starter pipeline
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

variables:
# The $(FlutterToolPath) variable is generated by the FlutterInstall task
# See code in the Flutter Build task https://github.com/aloisdeniel/vsts-flutter-tasks/blob/master/tasks/build/index.ts
flutterExecPath: $(FlutterToolPath)/flutter.bat

trigger:
batch: 'true'
branches:
include:
- develop
- release
- master
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
paths:
include:
- device_calendar/*

stages:
# ----------- CI -----------
- stage: Build
jobs:
- job: BuildAndroidAndIos
pool:
vmImage: 'macOS-latest'
steps:
- task: FlutterInstall@0
displayName: 'Flutter install'
inputs:
channel: 'stable'
version: 'latest'

- task: FlutterBuild@0
displayName: 'Flutter build - Android'
inputs:
target: 'apk'
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
projectDirectory: 'device_calendar/example'

- task: FlutterBuild@0
displayName: 'Flutter build - iOS'
inputs:
target: 'ios'
projectDirectory: 'device_calendar/example'
iosCodesign: false

# -----------CD Pre-release -----------
- stage: ReleaseBeta
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
dependsOn: Build
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/release'))
jobs:
- job: Release
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
pool:
vmImage: 'windows-latest'
steps:
- task: FlutterInstall@0
displayName: 'Flutter install'
inputs:
channel: 'stable'
version: 'latest'

- task: PowerShell@2
displayName: 'Pre-release versioning - pubspec.yaml'
inputs:
targetType: 'inline'
script: |
[string] $version = select-string -path "$(Build.SourcesDirectory)/device_calendar/pubspec.yaml" -pattern "(?<=version: ).*" | %{ $_.Matches[0].Value }
Write-Host "##vso[task.setvariable variable=currentVersion]$version"

[string] $versionRegex = '(?<=version: ).*'
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
[string] $pubspecContent = Get-Content -Path "$(Build.SourcesDirectory)/device_calendar/pubspec.yaml" -Raw
bhl09 marked this conversation as resolved.
Show resolved Hide resolved

Write-Host " (i) Current version: $version"
Write-Host " (i) Original pubspec.yaml content: $pubspecContent"

[bool] $hasMatches = $pubspecContent -match $versionRegex
bhl09 marked this conversation as resolved.
Show resolved Hide resolved

Write-Host " (i) Found matches to replace version? $hasMatches"

[string] $newPubspecContent = $pubspecContent -replace $versionRegex, "$version-dev.$(Build.BuildID)"

Write-Host " (i) Updated pubspec.yaml content: $newPubspecContent"

$newPubspecContent | Set-Content -Path "$(Build.SourcesDirectory)/device_calendar/pubspec.yaml"

- task: PowerShell@2
displayName: 'Pre-release versioning - CHANGELOG.md'
inputs:
targetType: 'inline'
script: |
[string] $changelogContent = Get-Content -Path "$(Build.SourcesDirectory)/device_calendar/CHANGELOG.md" -Raw

Write-Host " (i) Current version: $env.currentVersion"
Write-Host " (i) Original CHANGELOG.md content: $changelogContent"

[string] $newChangelogContent = $changelogContent -replace $env:currentVersion, "$env:currentVersion-dev.$(Build.BuildID)"

Write-Host " (i) Updated CHANGELOG.md content: $newChangelogContent"

$newChangelogContent | Set-Content -Path "$(Build.SourcesDirectory)/device_calendar/CHANGELOG.md"

- task: CmdLine@2
displayName: 'Dry run publish'
inputs:
workingDirectory: '$(Build.SourcesDirectory)/device_calendar'
script: '$(flutterExecPath) pub publish --dry-run'

- task: CmdLine@2
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
displayName: 'Publish'
inputs:
workingDirectory: '$(Build.SourcesDirectory)/device_calendar'
script: '$(flutterExecPath) pub publish --force'

# ----------- CD Production -----------
- stage: ReleaseProd
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
dependsOn: Build
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/master'))
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
jobs:
- job: Release
pool:
vmImage: 'windows-latest'
steps:
- task: FlutterInstall@0
displayName: 'Flutter install'
inputs:
channel: 'stable'
version: 'latest'

- task: CmdLine@2
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
displayName: 'Dry run publish'
inputs:
workingDirectory: '$(Build.SourcesDirectory)/device_calendar'
script: '$(flutterExecPath) pub publish --dry-run'
bhl09 marked this conversation as resolved.
Show resolved Hide resolved

- task: CmdLine@2
displayName: 'Publish'
inputs:
workingDirectory: '$(Build.SourcesDirectory)/device_calendar'
script: '$(flutterExecPath) pub publish --force'

- task: PowerShell@2
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
displayName: 'Get version from pubspec.yaml'
inputs:
targetType: 'inline'
script: |
[string] $version = select-string -path "$(Build.SourcesDirectory)/device_calendar/pubspec.yaml" -pattern "(?<=version: ).*" | %{ $_.Matches[0].Value }

Write-Host "##vso[task.setvariable variable=currentVersion]$version"

- task: GitHubRelease@1
displayName: 'Tag a release to GitHub'
inputs:
gitHubConnection: 'github.com_Brett09'
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
repositoryName: 'builttoroam/flutter_plugins'
action: 'create'
target: 'master'
tagSource: 'userSpecifiedTag'
tag: v$(currentVersion)
title: v$(currentVersion)
bhl09 marked this conversation as resolved.
Show resolved Hide resolved
assets: $(Build.ArtifactStagingDirectory)/*
changeLogCompareToRelease: 'lastFullRelease'
changeLogType: 'commitBased'