Skip to content

Commit 2fc3562

Browse files
committed
ci: Add pub.dev calculation step
1 parent 59fab21 commit 2fc3562

5 files changed

Lines changed: 68 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,6 @@ $ dart run build_runner build --delete-conflicting-outputs
100100
```
101101
$ pana > ~/temp/pana-analysis.md
102102
```
103-
6. Open the markdown file and observe the scores for each category, make sure that each (except the first one) has a perfect score (for example 20/20). If not, resolve any issues before submitting a pull request. The first category will resolve itself before being shipped to pub.dev (as it depends on automated tasks in the CI)
103+
6. Open the markdown file and observe the scores for each category, make sure that each (except the first one) has a perfect score (for example 20/20). If not, resolve any issues before submitting a pull request. The first category will resolve itself before being shipped to pub.dev (as it depends on automated tasks in the CI)
104+
105+
The CI also contains a step that calculates the pub.dev score prior to publishing.

build/azure-pipelines.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ stages:
6565
googleServicesJsonFile: $(InternalGoogleServicesJson)
6666
androidArtifactFormat: 'apk'
6767

68+
- stage: Calculate_PubDev_Score
69+
dependsOn:
70+
- CopyTool_GeneratedApp
71+
- Build_Staging_GeneratedApp
72+
jobs:
73+
- template: ../src/cli/.azuredevops/stage-calculate-pubdev-score.yml
74+
parameters:
75+
artifactName: 'PubDev_Score_Staging'
76+
6877
- stage: Publish_Template_Package
6978
condition: and(succeeded(), eq(variables['IsPullRequestBuild'], 'false'), eq(variables['IsReleaseBranch'], 'true'))
7079
dependsOn:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
parameters:
2+
- name: pathToSrc
3+
type: string
4+
default: '$(Build.SourcesDirectory)/src/cli'
5+
- name: artifactName
6+
type: string
7+
default: 'PubDev_Score_Staging'
8+
9+
jobs:
10+
- job: OnWindows_CalculatePubDev_Score
11+
pool:
12+
vmImage : $(windowsHostedAgentImage)
13+
steps:
14+
- template: ../../../build/templates/flutter-install.yml
15+
parameters:
16+
projectDirectory: '${{ parameters.pathToSrc }}'
17+
18+
- template: templates/calculate-devscore.yml
19+
parameters:
20+
pathToSrc: '${{ parameters.pathToSrc }}'
21+
artifactName: ${{parameters.artifactName}}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
parameters:
2+
- name: pathToSrc
3+
type: string
4+
default: '$(Build.SourcesDirectory)/src/cli'
5+
- name: artifactName
6+
type: string
7+
default: ''
8+
9+
steps:
10+
- powershell: Set-Location ${{ parameters.pathToSrc }}
11+
displayName: 'Set Location to CLI Folder'
12+
13+
- task: PowerShell@2
14+
displayName: 'Execute Build Runner'
15+
inputs:
16+
targetType: 'inline'
17+
script: |
18+
cd ${{ parameters.pathToSrc }}
19+
dart run build_runner build --delete-conflicting-outputs
20+
21+
- script: |
22+
dart pub global activate pana
23+
cd ${{ parameters.pathToSrc }}
24+
%LOCALAPPDATA%\Pub\Cache\bin\pana > $(Build.SourcesDirectory)/pana-analysis.md
25+
displayName: 'Run Pana Analysis'
26+
27+
- task: PublishBuildArtifacts@1
28+
displayName: 'Publish Pana Analysis'
29+
inputs:
30+
pathToPublish: '$(Build.SourcesDirectory)/pana-analysis.md'
31+
artifactName: '${{ parameters.artifactName }}_PanaAnalysis'
32+
condition: and(succeeded(), ne('${{ parameters.artifactName }}', ''))

src/cli/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55

66
Prefix your items with `(Template)` if the change is about the template and not the resulting application.
77

8+
## 0.25.3
9+
- Add local pub.dev score report.
10+
811
## 0.25.2
912
- Update iOS & Android minimum version targets.
1013
- Update macOS CI/CD agent.

0 commit comments

Comments
 (0)