Skip to content

Commit

Permalink
Implementation (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimdalen authored May 1, 2022
1 parent bf44936 commit 3ccb61b
Show file tree
Hide file tree
Showing 170 changed files with 18,286 additions and 9,090 deletions.
4 changes: 4 additions & 0 deletions .azext/changelog-cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"issues": [],
"pullRequests": []
}
96 changes: 96 additions & 0 deletions .azext/changelog-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"repository": "joachimdalen/azdevops-acceptance-criterias",
"changelogTitle": {
"size": "h1",
"format": "Changelog"
},
"releaseTitleFormat": {
"size": "h2",
"format": "{{version}} ({{publishDate}})"
},
"moduleTitleFormat": {
"size": "h4",
"format": "`{{name}}@{{version}}`"
},
"moduleChangesTitle": {
"size": "h2",
"format": ":package: Module changes"
},
"sectionSplitter": "---",
"typeSize": "h3",
"typeMapping": {
"feature": ":rocket: Features ({{changeCount}})",
"fix": ":bug: Fixes ({{changeCount}})",
"tests": ":test_tube: Tests ({{changeCount}})",
"other": ":speech_balloon: Other ({{changeCount}})",
"docs": ":memo: Documentation ({{changeCount}})",
"maint": ":hammer_and_wrench: Maintenance ({{changeCount}})"
},
"sections": {
"summary": {
"title": {
"size": "bold",
"format": ":pencil2: Release summary"
}
},
"knownIssues": {
"title": {
"size": "bold",
"format": ":bulb: Known issues"
}
},
"breakingChanges": {
"title": {
"size": "bold",
"format": ":fire: BREAKING CHANGES :fire:"
}
}
},
"typeResourcePrefixMapping": {
"feature": {
"issue": "Suggested in",
"pullRequest": "Added in"
},
"fix": {
"issue": "Reported in",
"pullRequest": "Fixed in"
},
"docs": {
"issue": "Changed needed",
"pullRequest": "Changed in"
},
"maint": {
"pullRequest": "Changed in"
},
"enhancement": {
"issue": "Suggested in",
"pullRequest": "Improved in"
}
},
"attributionTitleFormat": {
"size": "h2",
"format": ":star2: Contributors"
},
"attributionSubTitle": {
"format": "Thank you to the following for contributing to the latest release"
},
"attributionLinkTextFormat": {
"format": "@{{ghUsername}}"
},
"knownAuthors": ["joachimdalen"],
"useDescriptiveIssues": true,
"useDescriptivePullRequests": true,
"replaceEmojis": {
"types": true,
"changelogTitle": true,
"releaseTitle": true,
"moduleTitle": true,
"attributionTitle": true,
"attributionSubTitle": true,
"moduleChangesTitle": true,
"githubIssues": false,
"githubPullRequests": false,
"sectionTitle": true,
"sectionContent": true
}
}
9 changes: 9 additions & 0 deletions .azext/changelog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
{
"publishDate": "02-05-2022",
"version": "1.0.0",
"sections": {
"summary": [{ "type": "text", "content": "Initial release" }]
}
}
]
4 changes: 4 additions & 0 deletions .azext/readme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"partials": {}
}

90 changes: 90 additions & 0 deletions .ci/build-extension-artifact.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
parameters:
- name: artifact
default: extension
- name: extensionEnv
default: dev
values:
- dev
- qa
- prod
- name: taskVersion
displayName: 'Task Version'
type: string
default: $(Task.Extension.Version)
- name: generateVersionChangelog
type: boolean
default: true
jobs:
- job:
steps:
- task: TfxInstaller@3
displayName: 'Install Tfx'
inputs:
version: 'v0.10.0'
- task: QueryAzureDevOpsExtensionVersion@3
displayName: 'Query existing version'
inputs:
connectTo: 'VsTeam'
connectedServiceName: $(marketplaceServiceConnection)
publisherId: '$(PublisherID)'
extensionId: '$(ExtensionID)'
versionAction: 'Patch'
outputVariable: 'Task.Extension.Version'
- template: install.template.yml
- template: build.template.yml
parameters:
extensionEnv: ${{ parameters.extensionEnv }}
- task: Npm@1
displayName: 'Build changelog'
inputs:
command: custom
customCommand: run changelog:prod
- task: Npm@1
displayName: 'Build single version changelog'
condition: eq(${{ parameters.generateVersionChangelog }}, true)
inputs:
command: custom
customCommand: run changelog:prod:version -- --version ${{ parameters.taskVersion }}
- task: Npm@1
displayName: 'Build readme'
inputs:
command: custom
customCommand: run docs:readme
- task: PackageAzureDevOpsExtension@3
displayName: 'Package extension'
inputs:
rootFolder: '$(Build.SourcesDirectory)'
patternManifest: 'vss-extension.${{ parameters.extensionEnv }}.json'
updateTasksVersion: false
extensionVersion: ${{ parameters.taskVersion }}
- task: Bash@3
displayName: 'Move artifacts'
inputs:
targetType: inline
workingDirectory:
script: |
mkdir $(Build.ArtifactStagingDirectory)/extension/
mkdir $(Build.ArtifactStagingDirectory)/changelog/
mv $(Build.SourcesDirectory)/*.vsix $(Build.ArtifactStagingDirectory)/extension/
cp $(Build.SourcesDirectory)/marketplace/docs/CHANGELOG.md $(Build.ArtifactStagingDirectory)/changelog/
- task: Bash@3
displayName: 'Move version changelog'
condition: eq(${{ parameters.generateVersionChangelog }}, true)
inputs:
targetType: inline
workingDirectory:
script: |
mv $(Build.SourcesDirectory)/marketplace/docs/CHANGELOG-RELEASE.md $(Build.ArtifactStagingDirectory)/changelog/
- task: PublishPipelineArtifact@1
displayName: 'Publish ${{ parameters.artifact }} artifacts'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/extension'
artifactName: '${{ parameters.artifact }}'
publishLocation: pipeline
- task: PublishPipelineArtifact@1
displayName: 'Publish changelog artifacts'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/changelog'
artifactName: 'changelog'
publishLocation: pipeline

14 changes: 14 additions & 0 deletions .ci/build.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
parameters:
- name: extensionEnv
default: dev
values:
- dev
- qa
- prod

steps:
- task: Npm@1
displayName: 'Compile - ${{ parameters.extensionEnv }}'
inputs:
command: custom
customCommand: 'run compile:${{ parameters.extensionEnv }}'
25 changes: 25 additions & 0 deletions .ci/create-gh-release.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
parameters:
- name: version
type: string
- name: isPreview
type: boolean
default: false

steps:
- checkout: none
- download: none
- download: 'current'
displayName: 'Download changelog'
artifact: 'changelog'
- task: GitHubRelease@1
displayName: 'Create GitHub Release'
inputs:
gitHubConnection: github-azdevops-extensions
repositoryName: joachimdalen/azdevops-acceptance-criterias
tagSource: userSpecifiedTag
tag: v${{ parameters.version }}
title: 'v${{ parameters.version }}: Update'
addChangeLog: false
isPreRelease: ${{ parameters.isPreview }}
releaseNotesSource: filePath
releaseNotesFilePath: $(Pipeline.Workspace)/changelog/v${{ parameters.version }}.md
14 changes: 14 additions & 0 deletions .ci/install.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- task: NodeTool@0
displayName: 'Install node'
inputs:
versionSpec: '16.x'
- task: Cache@2
displayName: Cache npm
inputs:
key: 'npm | "$(Agent.OS)" | $(Build.SourcesDirectory)/package-lock.json'
path: "$(npm_config_cache)"
- task: Npm@1
displayName: 'Install dependencies'
inputs:
command: ci
38 changes: 38 additions & 0 deletions .ci/publish-extension.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
parameters:
- name: pipelineEnv
- name: artifact
default: extension
- name: extensionVisibility
type: string
default: private
values:
- default
- private
- private_preview
- public
- public_preview
jobs:
- deployment:
displayName: 'Publish Extension'
environment: ${{ parameters.pipelineEnv }}
strategy:
runOnce:
deploy:
steps:
- download: none
- download: 'current'
displayName: 'Download extension'
artifact: ${{ parameters.artifact }}
- task: TfxInstaller@3
displayName: 'Install Tfx'
inputs:
version: 'v0.10.0'
- task: PublishAzureDevOpsExtension@3
displayName: "Publish to Marketplace"
inputs:
connectTo: 'VsTeam'
connectedServiceName: 'marketplace-joachim-dalen'
fileType: 'vsix'
vsixFile: '$(Pipeline.Workspace)/**/*.vsix'
updateTasksVersion: false
extensionVisibility: ${{ parameters.extensionVisibility }}
30 changes: 30 additions & 0 deletions .ci/run-tests.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
steps:
- task: Npm@1
displayName: 'Run tests'
inputs:
command: custom
customCommand: 'run test:coverage'
- task: Bash@3
displayName: 'Move cover files'
inputs:
targetType: 'inline'
script: |
cp -r $(Build.SourcesDirectory)/coverage $(Build.ArtifactStagingDirectory)
- task: Bash@3
displayName: 'Move report'
inputs:
targetType: 'inline'
script: |
mkdir $(Build.ArtifactStagingDirectory)/reports
cp $(Build.SourcesDirectory)/test-results.xml $(Build.ArtifactStagingDirectory)/reports/test-results.xml
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '$(Build.ArtifactStagingDirectory)/reports/test-results.xml'
- task: PublishCodeCoverageResults@1
displayName: 'Publish coverage'
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Build.ArtifactStagingDirectory)/coverage/cobertura-coverage.xml'
pathToSources: '$(Build.SourcesDirectory)/src'
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ webpack.config.js
ci/**
docs/**
marketplace/**
**/__mocks__/**
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ coverage
.nyc*

!ci/buildDocs.js

src/tasks/npm*
src/common/audit*
src/docs/README.md
src/docs/CHANGELOG.md
docs/README.md
docs/CHANGELOG*.md
test-results.xml
!*webpack*.js
!src/__mocks__/*.js
!build-scripts/*.js
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"ms-azure-devops.azure-pipelines"
]
}
Loading

0 comments on commit 3ccb61b

Please sign in to comment.