Skip to content

Commit

Permalink
chore: Introduce semantic-release to automate release (spotbugs#20)
Browse files Browse the repository at this point in the history
* fix: bump up SpotBugs tp 3.1.12

* build: specify encoding to apply to copying resource

https://maven.apache.org/general.html\#encoding-warning

* ci: introduce semantic-release

* docs: bump up the version in README

* chore(ci): add gpg key and secret key to sign artifacts

* ci: use openjdk to build

* reorganize gpg related tasks
  • Loading branch information
KengoTODA authored May 2, 2019
1 parent 89f4693 commit 2a9e254
Show file tree
Hide file tree
Showing 11 changed files with 5,134 additions and 93 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
target
.project
.settings
.travis/codesigning.asc
2 changes: 2 additions & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
8

14 changes: 12 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
language: java
jdk: oraclejdk8
jdk: openjdk8
install:
- nvm install
- yarn install
- if [ -n "$encrypted_1636434a17e8_key" ]; then openssl aes-256-cbc -K $encrypted_1636434a17e8_key -iv $encrypted_1636434a17e8_iv -in .travis/codesigning.asc.enc -out .travis/codesigning.asc -d; fi
- if [ -f ".travis/codesigning.asc" ]; then gpg --import .travis/codesigning.asc; fi
script:
- ./mvnw verify
- ./mvnw -V -B verify
jobs:
include:
- stage: deploy
script:
- travis_wait yarn run semantic-release
Binary file added .travis/codesigning.asc.enc
Binary file not shown.
31 changes: 0 additions & 31 deletions CHANGELOG.md

This file was deleted.

7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Maven Archetype for SpotBugs Plugin project

[![Build Status](https://travis-ci.org/spotbugs/spotbugs-archetype.svg?branch=master)](https://travis-ci.org/spotbugs/spotbugs-archetype)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.spotbugs/spotbugs-archetype/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.spotbugs/spotbugs-archetype)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![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)

## How to use

```sh
$ mvn archetype:generate \
-DarchetypeArtifactId=spotbugs-archetype \
-DarchetypeGroupId=com.github.spotbugs \
-DarchetypeVersion=0.2.2
-DarchetypeVersion=0.2.3
```

## License

Copyright 2017-2018 SpotBugs team
Copyright 2017-2019 SpotBugs team

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
22 changes: 22 additions & 0 deletions maven-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<settings>
<servers>
<server>
<id>ossrh</id>
<username>${env.OSSRH_JIRA_USERNAME}</username>
<password>${env.OSSRH_JIRA_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>release</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
33 changes: 33 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"scripts": {
"semantic-release": "semantic-release"
},
"devDependencies": {
"@conveyal/maven-semantic-release": "^4.2.0",
"@semantic-release/changelog": "^3.0.2",
"@semantic-release/commit-analyzer": "^6.1.0",
"@semantic-release/git": "^7.0.8",
"@semantic-release/github": "^5.2.10",
"@semantic-release/release-notes-generator": "^7.1.4",
"semantic-release": "^15.13.3"
},
"release": {
"tagFormat": "${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
"@conveyal/maven-semantic-release",
[
"@semantic-release/git",
{
"assets": [
"pom.xml",
"CHANGELOG.md"
]
}
]
]
}
}
108 changes: 51 additions & 57 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

<properties>
<mavenArchetypeVersion>3.1.0</mavenArchetypeVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
Expand All @@ -57,62 +58,55 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
2 changes: 1 addition & 1 deletion src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spotBugsVersion>3.1.9</spotBugsVersion>
<spotBugsVersion>3.1.12</spotBugsVersion>
</properties>

<description>My SpotBugs plugin project</description>
Expand Down
Loading

0 comments on commit 2a9e254

Please sign in to comment.