Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
csowada committed Dec 17, 2020
2 parents 70759f1 + a705295 commit 1cbd3f3
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 40 deletions.
56 changes: 48 additions & 8 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
name: Maven Package

on:
release:
types: [created]
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
Expand All @@ -15,21 +17,59 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Java for Apache Maven Central
uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up Java for Apache Maven Central
uses: actions/setup-java@v1
with:
java-version: 11
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: OSSRH_USERNAME # env variable for username in deploy
server-password: OSSRH_PASSWORD # env variable for token in deploy
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Import GPG keys
run: 'echo -e "$GPG_FILE" | gpg2 --import --no-tty --batch --yes'
shell: bash
env:
GPG_FILE: ${{secrets.GPG_FILE}}

- name: Build with Maven
run: mvn --batch-mode --update-snapshots clean compile verify

- name: Publish to Apache Maven Central
run: mvn deploy --batch-mode --update-snapshots -P sign,build-extras
# run: mvn deploy --batch-mode --update-snapshots -P sign,!build-extras -Dmaven.test.skip=true
run: mvn deploy --batch-mode --update-snapshots -P sign,!build-extras -Dmaven.test.skip=true
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v1
with:
java-version: 11

- name: Publish to GitHub Packages
run: mvn deploy --batch-mode --update-snapshots -P sign,!build-extras,!deploy-ossrh -Dmaven.test.skip=true -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/csowada/ebus
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
draft: true
prerelease: false
10 changes: 5 additions & 5 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Set up Java
uses: actions/setup-java@v1
with:
java-version: 11

- name: Build witrh Maven
run: mvn --batch-mode --update-snapshots clean compile verify

Expand Down
8 changes: 8 additions & 0 deletions BUILD-HELP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Build Handbook

## Maven Release

```bash
# create a new release
mvn gitflow:release
```
82 changes: 55 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<description>eBUS core library - This library handles the communication with heating engineering via the BUS specification. This protocol is used by many heating manufacturers in Europe.</description>
<groupId>de.cs-dev.ebus</groupId>
<artifactId>ebus-core</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
<url>https://github.com/csowada/ebus</url>
<packaging>bundle</packaging>

Expand All @@ -18,7 +18,7 @@
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.release>8</maven.compiler.release>
<license.year>2020</license.year>
<bundle.version>1.1.0.${maven.build.timestamp}</bundle.version>
<!-- <bundle.version>1.1.0.${maven.build.timestamp}</bundle.version> -->
</properties>

<organization>
Expand Down Expand Up @@ -57,6 +57,22 @@
<build>
<plugins>

<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
<artifactId>gitflow-maven-plugin</artifactId>
<version>1.15.0</version>
<configuration>
<gitFlowConfig>
<productionBranch>master</productionBranch>
<developmentBranch>develop</developmentBranch>
<versionTagPrefix>v</versionTagPrefix>
<origin>origin</origin>
</gitFlowConfig>
<fetchRemote>false</fetchRemote>
<pushRemote>false</pushRemote>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
Expand Down Expand Up @@ -92,8 +108,7 @@
<Bundle-Version>${bundle.version}</Bundle-Version>
<Export-Package>de.csdev.ebus.*</Export-Package>
<opt>resolution:=optional</opt>
<Import-Package>org.slf4j;$[opt], com.fazecast.jSerialComm;$[opt], gnu.io;$[opt],
org.eclipse.jdt.annotation;$[opt], *</Import-Package>
<Import-Package>org.slf4j;$[opt], com.fazecast.jSerialComm;$[opt], gnu.io;$[opt], *</Import-Package>

<Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
<Build-Commit>${buildNumber}</Build-Commit>
Expand All @@ -103,18 +118,6 @@
</configuration>
</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>false</autoReleaseAfterClose>
</configuration>
</plugin>

<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
Expand Down Expand Up @@ -215,6 +218,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<doclint>none</doclint>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -228,6 +234,39 @@
</build>
</profile>

<profile>
<id>deploy-ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>

<build>
<plugins>
<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>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
</profiles>

<dependencies>
Expand Down Expand Up @@ -306,15 +345,4 @@

</dependencies>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

</project>

0 comments on commit 1cbd3f3

Please sign in to comment.