Skip to content

Commit

Permalink
feat: set up continuous deployment from master with semantic-release (#…
Browse files Browse the repository at this point in the history
…33)

#### Description of changes

*(note: this PR sets up semantic-release with `--dry-run`, so we can double check what it thinks it would do in the real build/release environment. There will be a second separate PR removing --dry-run)*

Sets up [semantic-release](https://github.com/semantic-release/semantic-release) in its default configuration, which will run the following steps on every merge into master (after all the normal CI checks have passed only):

* Look for the most recent "vX.Y.Z" tag in the repo
* Look at all the merge commits to master since that point
* If any contain `fix:` or `feat:` work, start a new release
* Parse the commit messages as [Conventional Commits](https://www.conventionalcommits.org) to form release notes
* Use `fix:`/`feat:`/`BREAKING CHANGE:` info in the merge commits to determine the next [semantic version](https://semver.org)
* Bump the version in package.json/package-lock.json
* Create a new GitHub release (via @ada-cat), which includes pushing a new git tag for the new version
* run npm publish to publish the new version

Note that the build step running semantic-release is conditionalized to only run on the master branch, and only in Pipelines that explicitly specify an opt-in variable. We will be using this to cause the publishing step to occur only from the secondary CI build I've set up with publishing credentials via @ada-cat and [accessibility-insights-team](https://www.npmjs.com/~accessibility-insights-team).

#### Pull request checklist

- [x] Addresses an existing issue: Implements user story #1492605
- [x] **n/a** Added relevant unit test for your changes. (`npm run test`)
- [x] **n/a** Verified code coverage for the changes made.
  • Loading branch information
dbjorge authored Apr 19, 2019
1 parent 94eb367 commit ac849ed
Show file tree
Hide file tree
Showing 5 changed files with 4,915 additions and 135 deletions.
6 changes: 4 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#### Pull request checklist

- [ ] Addresses an existing issue: Fixes #0000
- [ ] Added relevant unit test for your changes. (`npm run test`)
- [ ] PR title respects [Conventional Commits](https://www.conventionalcommits.org) (starts with `fix:`, `feat:`, etc, and is suitable for user-facing release notes)
- [ ] PR contains no breaking changes, **OR** description of both PR **and final merge commit** starts with `BREAKING CHANGE:`
- [ ] (if applicable) Addresses issue: #0000
- [ ] Added relevant unit tests for your changes. (`npm test`)
- [ ] Verified code coverage for the changes made.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ Licensed under the MIT License.

# axe-sarif-converter

[![Build Status](https://dev.azure.com/accessibility-insights/axe-sarif-converter/_apis/build/status/Microsoft.axe-sarif-converter%20-%20CI?branchName=master)](https://dev.azure.com/accessibility-insights/axe-sarif-converter/_build/latest?definitionId=20&branchName=master)
[![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/accessibility-insights/axe-sarif-converter/20.svg)](https://dev.azure.com/accessibility-insights/axe-sarif-converter/_build/latest?definitionId=20&branchName=master)
[![Build status](https://dev.azure.com/accessibility-insights/axe-sarif-converter/_apis/build/status/Microsoft.axe-sarif-converter%20-%20CI?branchName=master)](https://dev.azure.com/accessibility-insights/axe-sarif-converter/_build/latest?definitionId=20&branchName=master)
[![Code coverage](https://img.shields.io/azure-devops/coverage/accessibility-insights/axe-sarif-converter/20.svg)](https://dev.azure.com/accessibility-insights/axe-sarif-converter/_build/latest?definitionId=20&branchName=master)
[![npm](https://img.shields.io/npm/v/axe-sarif-converter.svg)](https://www.npmjs.com/package/axe-sarif-converter)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Convert [axe-core](https://github.com/dequelabs/axe-core) accessibility scan results to the [SARIF format](http://sarifweb.azurewebsites.net/).

Expand Down
8 changes: 7 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,17 @@ jobs:
pathtoPublish: '$(System.DefaultWorkingDirectory)/test-results/test_result.sarif'
artifactName: 'CodeAnalysisLogs'
condition: always()
continueOnError: true
displayName: publish sarif results

- task: Npm@1
inputs:
command: custom
customCommand: run build
displayName: npm run build

- task: Npm@1
inputs:
command: custom
customCommand: run semantic-release
displayName: npm run semantic-release (master branch only)
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['EnableSemanticRelease'], 'true'))
Loading

0 comments on commit ac849ed

Please sign in to comment.