Skip to content

Commit

Permalink
Merge pull request #45 from conveyal/dev
Browse files Browse the repository at this point in the history
Next release
  • Loading branch information
landonreed authored Dec 21, 2020
2 parents 7826b2f + 3a88d61 commit 79739ae
Show file tree
Hide file tree
Showing 4 changed files with 1,327 additions and 858 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Automated release management for maven projects

## About

maven-semantic-release is a plugin for [semantic-release](https://github.com/semantic-release/semantic-release) v15. This project will deploy a maven project to maven central instead of deploying a node.js project to npm. This tool is intended to be used on github projects that use a Travis-CI server.
maven-semantic-release is a plugin for [semantic-release](https://github.com/semantic-release/semantic-release) v16+. This project will deploy a maven project to maven central instead of deploying a node.js project to npm. This tool is intended to be used on github projects that use a Travis-CI server.

The workflow this assumes is that your project will use [Angular-style commit messages](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type) (theoretically you could override this and use a different style) and only merge to master when you want to create a new release. When a new release is generated, it will automatically be deployed to maven central.

Expand Down Expand Up @@ -126,7 +126,7 @@ Also, you'll want to install maven-semantic-release and semantic-release in a st

```
before_script:
- yarn global add @conveyal/maven-semantic-release semantic-release@15
- yarn global add @conveyal/maven-semantic-release semantic-release
```

### Step 6: Add a github token to Travis
Expand All @@ -138,5 +138,3 @@ Create a Github token that will be used to make commits and create releases. Ad
## Which `mvn` will be used

This plugin uses the `mvn` command in your `PATH`. If you have [maven-wrapper script](https://github.com/takari/maven-wrapper) at the project root directory, this plugin will use that instead.


18 changes: 9 additions & 9 deletions lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function push (origin, branch, execaOpts) {
}

async function configureGit (context) {
const {env, cwd, logger, options} = context
const {branch, cwd, env, logger} = context
const execaOpts = {env, cwd}

// fetch all branches because Travis doesn't do it for us
Expand All @@ -57,9 +57,9 @@ async function configureGit (context) {
logger.log('fetching branches')
await execa('git', ['fetch'], execaOpts)

// checkout master and pull latest
// checkout the release branch and pull latest
logger.log('checking out release branch')
await execa('git', ['checkout', options.branch], execaOpts)
await execa('git', ['checkout', branch.name], execaOpts)

logger.log('pulling')
await execa('git', ['pull'], execaOpts)
Expand All @@ -70,9 +70,9 @@ async function configureGit (context) {
* in the options for this to work.
*/
async function mergeMasterIntoDev (context) {
const {env, cwd, logger, options} = context
const {branch, cwd, env, logger, options} = context
const execaOpts = {env, cwd}
const {branch, devBranch, repositoryUrl} = options
const {devBranch, repositoryUrl} = options

logger.log('Merging master branch into dev branch')

Expand All @@ -82,7 +82,7 @@ async function mergeMasterIntoDev (context) {

// merge
logger.log('merging release branch into dev branch')
await execa('git', ['merge', branch], execaOpts)
await execa('git', ['merge', branch.name], execaOpts)

// push
logger.log('pushing dev branch')
Expand All @@ -95,8 +95,8 @@ async function mergeMasterIntoDev (context) {
* Commit, add and push changes to the pom.xml file(s)
*/
async function saveChangesToPomXml (context, versionStr) {
const {env, cwd, logger, options} = context
const {branch, repositoryUrl} = options
const {branch, cwd, env, logger, options} = context
const {repositoryUrl} = options
const execaOpts = {env, cwd}

const isSnapshotVersion = versionStr.indexOf('SNAPSHOT') > -1
Expand Down Expand Up @@ -133,7 +133,7 @@ async function saveChangesToPomXml (context, versionStr) {
process.stdout.write('\n')

logger.log('pushing changes')
await push(repositoryUrl, branch, execaOpts)
await push(repositoryUrl, branch.name, execaOpts)

logger.log('changes pushed')
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
},
"devDependencies": {
"mastarm": "^5.1.3",
"semantic-release": "^15.12.3"
"semantic-release": "^17.3.0"
},
"peerDependencies": {
"semantic-release": "^15.12.3"
"semantic-release": "^17.3.0"
}
}
Loading

0 comments on commit 79739ae

Please sign in to comment.