Skip to content

Commit

Permalink
Merge branch 'release/1.0.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Feb 8, 2021
2 parents c498546 + 1f6c849 commit e028aa2
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 63 deletions.
44 changes: 13 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,25 @@
name: Build

on:
[push]

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
#This check is case insensitive
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
env:
BUILD_VERSION: SNAPSHOT
# Name of the project; used in multiple steps (e.g. for upload)
PROJECT_NAME: webdav-nio-adapter-servlet
steps:
# Foreign Action: Checkout the current commit
- uses: actions/checkout@v2
# Foreign Action: Setup Java Runtime Environment
- uses: actions/setup-java@v1
with:
java-version: 11
server-id: bintray-jcenter
server-username: BINTRAY_USERNAME # Defined in step "deploytojcenter"
server-password: BINTRAY_API_KEY # See above
- uses: actions/cache@v1
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Ensure to use tagged version
id: taggedVersion
if: startsWith(github.ref, 'refs/tags/')
run: mvn versions:set --file ./pom.xml -DnewVersion=${GITHUB_REF##*/}
if: startsWith(github.ref, 'refs/tags/') # Run if ref is tagged (e.g. "v.1.4")
- name: Export the project version to the job environment and fix it as an ouput of this step
id: setVersion
run: |
v=$(mvn help:evaluate "-Dexpression=project.version" -q -DforceStdout)
echo "BUILD_VERSION=${v}" >> $GITHUB_ENV
- name: Build and Test
id: buildAndTest
run: mvn -B clean install jacoco:report -Pcoverage,dependency-check
Expand All @@ -47,16 +29,16 @@ jobs:
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
continue-on-error: true
- name: Upload snapshot artifact ${{ env.PROJECT_NAME }}-${{ env.BUILD_VERSION }}.jar
id: uploadSnapshot
uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v2
with:
name: ${{ env.PROJECT_NAME }}-${{ env.BUILD_VERSION }}.jar
path: target/${{ env.PROJECT_NAME }}-*.jar
- name: Deploy to jcenter
id: deployToJcenter
run: mvn -B deploy -Prelease -DskipTests
if: startsWith(github.ref, 'refs/tags/') # Run if ref is tagged (e.g. "v.1.4")
name: artifacts
path: target/*.jar
- name: Create Release
uses: actions/create-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
BINTRAY_USERNAME: cryptobot
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
prerelease: true
37 changes: 37 additions & 0 deletions .github/workflows/publish-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to Maven Central
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag'
required: true
default: '0.0.0'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: "refs/tags/${{ github.event.inputs.tag }}"
- 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: MAVEN_USERNAME # env variable for username in deploy
server-password: MAVEN_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Enforce project version ${{ github.event.inputs.tag }}
run: mvn versions:set -B -DnewVersion=${{ github.event.inputs.tag }}
- name: Deploy
run: mvn deploy -B -DskipTests -Psign,deploy-central --no-transfer-progress
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
40 changes: 40 additions & 0 deletions .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish to GitHub Packages
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Enforce project version ${{ github.event.release.tag_name }}
run: mvn versions:set -B -DnewVersion=${{ github.event.release.tag_name }}
- name: Deploy
run: mvn deploy -B -DskipTests -Psign,deploy-github --no-transfer-progress
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_USERNAME: 'Cryptobot'
SLACK_ICON:
SLACK_ICON_EMOJI: ':bot:'
SLACK_CHANNEL: 'debug'
SLACK_TITLE: "Published ${{ github.event.repository.name }} ${{ github.event.release.tag_name }}"
SLACK_MESSAGE: "Ready to <https://github.com/${{ github.repository }}/actions?query=workflow%3A%22Publish+to+Maven+Central%22|deploy to Maven Central>."
SLACK_FOOTER:
MSG_MINIMAL: true
91 changes: 59 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.cryptomator</groupId>
<artifactId>webdav-nio-adapter-servlet</artifactId>
<version>1.0.9</version>
<version>1.0.10</version>
<name>WebDAV-NIO Adapter Servlet</name>
<description>Servlet serving NIO directory contents as WebDAV resources.</description>
<url>https://github.com/cryptomator/webdav-nio-adapter-servlet</url>
Expand Down Expand Up @@ -40,14 +40,6 @@
</developer>
</developers>

<repositories>
<repository>
<id>bintray</id>
<name>bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>

<dependencies>
<!-- Jackrabbit -->
<dependency>
Expand Down Expand Up @@ -126,6 +118,30 @@
<showWarnings>true</showWarnings>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.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.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -176,42 +192,53 @@
</profile>

<profile>
<id>release</id>
<distributionManagement>
<repository>
<id>bintray-jcenter</id>
<url>https://api.bintray.com/maven/cryptomator/maven/webdav-nio-adapter-servlet/;publish=1</url>
</repository>
</distributionManagement>
<id>sign</id>
<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>attach-sources</id>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>deploy-central</id>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Maven Central</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>

<profile>
<id>deploy-github</id>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/cryptomator/webdav-nio-adapter-servlet</url>
</repository>
</distributionManagement>
</profile>
</profiles>

</project>

0 comments on commit e028aa2

Please sign in to comment.