generated from nventive/Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,6 @@ migrate_working_dir/ | |
.packages | ||
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
pubspec.lock | ||
|
||
# Web related | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,71 @@ | ||
trigger: | ||
branches: | ||
include: | ||
- main | ||
- main | ||
pr: | ||
branches: | ||
include: | ||
- main | ||
|
||
variables: | ||
- name: windowsHostedAgentImage | ||
value: 'windows-2022' | ||
- name: IsReleaseBranch # Should this branch name use the release stage. | ||
value: $[or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/feature/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))] | ||
- template: variables.yml | ||
|
||
pool: | ||
vmImage: 'ubuntu-latest' | ||
|
||
steps: | ||
|
||
- task: Hey24sheep.flutter.flutter-install.FlutterInstall@0 | ||
displayName: 'Flutter Install' | ||
|
||
- task: gitversion/setup@0 | ||
retryCountOnTaskFailure: 3 | ||
inputs: | ||
versionSpec: '5.12.0' | ||
displayName: 'Install GitVersion' | ||
|
||
- task: gitversion/execute@0 | ||
inputs: | ||
useConfigFile: true | ||
configFilePath: $(Build.SourcesDirectory)/build/gitversion-config.yml | ||
displayName: 'Calculate App Version' | ||
|
||
# There is currently no other alternatives for setting the app version using gitversion. | ||
- powershell: | | ||
((Get-Content -Path pubspec.yaml) -replace '(version:\s*)[\d\.]+', "version: $(GitVersion.MajorMinorPatch)") | Set-Content -Path pubspec.yaml | ||
displayName: Replace version powershell command | ||
- script : flutter doctor | ||
displayName : Run flutter doctor | ||
|
||
- script: flutter pub get | ||
displayName: Install dependencies | ||
|
||
- script: flutter analyze | ||
displayName: Analyze code | ||
|
||
- script: flutter build | ||
displayName: Build app | ||
|
||
- script: flutter test | ||
displayName: Run tests | ||
|
||
stages: | ||
- stage: OnWindows_ | ||
jobs: | ||
- job: Test Pipeline | ||
- script: flutter pub publish --dry-run | ||
displayName: 'Run flutter pub publish --dry-run' | ||
|
||
pool: | ||
vmImage: $(windowsHostedAgentImage) | ||
- task: DownloadSecureFile@1 | ||
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['IsReleaseBranch'], 'true')) | ||
inputs: | ||
secureFile: 'flutter_publisher_gckey.json' | ||
name: DownloadGCloudKey | ||
|
||
workspace: | ||
clean: all # Cleanup the workspace before starting. | ||
- script: | | ||
gcloud auth activate-service-account --key-file=$(DownloadGCloudKey.secureFilePath) | ||
gcloud auth print-identity-token --audiences=https://pub.dev | dart pub token add https://pub.dev | ||
dart pub publish --force | ||
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['IsReleaseBranch'], 'true')) | ||
displayName: 'Publish to pub.dev as a nventive publisher' | ||
steps: | ||
- script: echo Hello world! | ||
- task: PostBuildCleanup@3 | ||
displayName: 'Post-Build Cleanup: Cleanup files to keep build server clean!' | ||
condition: always() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# The version is driven by conventional commits via xxx-version-bump-message. | ||
# Anything merged to main creates a new stable version. | ||
# Only builds from main and feature/* are pushed to nuget.org. | ||
|
||
assembly-versioning-scheme: MajorMinorPatch | ||
mode: MainLine | ||
next-version: '' # Use git tags to set the base version. | ||
continuous-delivery-fallback-tag: "" | ||
commit-message-incrementing: Enabled | ||
major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)" | ||
minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:" | ||
patch-version-bump-message: "^(build|chore|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:" | ||
no-bump-message: "^(ci|benchmarks)(\\([\\w\\s-]*\\))?:" # You can use the "ci" or "benchmarks" type to avoid bumping the version when your changes are limited to the [build or .github folders] or limited to benchmark code. | ||
branches: | ||
main: | ||
regex: ^master$|^main$ | ||
tag: '' | ||
dev: | ||
regex: dev/.*?/(.*?) | ||
tag: dev.{BranchName} | ||
source-branches: [main] | ||
feature: | ||
tag: feature.{BranchName} | ||
regex: feature/(.*?) | ||
source-branches: [main] | ||
ignore: | ||
sha: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
variables: | ||
IsReleaseBranch: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')] | ||
|
||
# Pipeline configuration (Disable shallow fetch). | ||
# See https://dev.to/kkazala/azure-devops-pipelines-shallow-fetch-1-is-now-default-4656 for more details. | ||
# See https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/pipeline-options-for-git?view=azure-devops&tabs=yaml#shallow-fetch for more details. | ||
Agent.Source.Git.ShallowFetchDepth: 0 |