Skip to content

Commit

Permalink
prepare for maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-maschmann committed Apr 19, 2024
1 parent f11a37d commit ed54790
Show file tree
Hide file tree
Showing 9 changed files with 300 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Please use one of the following templates:

https://github.com/holunda-io/kotlin-lib/issues/new/choose
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/1_bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: 'Bug report'
about: 'Report a bug'
title:
labels: 'Type: bug'

---

### Steps to reproduce

* Library version:
* JDK version:
* Operating system:
* Complete executable reproducer: (e.g. GitHub Repo)
* Steps: (what exactly are you doing with the above reproducer?)

### Expected behaviour

### Actual behaviour

(In case of exceptions provide full stack trace)
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/2_feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 'Feature request'
about: 'Suggest a new feature or enhancement'
title:
labels: 'Type: enhancement'
assignees:

---

### Scenario

* Library version:
* Description of your use case: (detailed description or executable reproducer, e.g. GitHub repo)

### Current Behaviour

### Wanted Behaviour

### Possible Workarounds
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
16 changes: 16 additions & 0 deletions .github/release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
changelog:
sections:
- title: ":zap: Breaking Changes"
labels: [ "Type: breaking" ]
- title: ":rocket: Enhancements & Features"
labels: [ "Type: enhancement", "Type: documentation", "Type: example" ]
- title: ":bug: Bug Fixes"
labels: [ "Type: bug" ]
- title: ":hammer_and_wrench: Chore"
labels: [ "Type: dependencies" ]
issues:
exclude:
labels: [ "Type: Incorrect Repository", "Type: question" ]
contributors:
exclude:
names: [ "dependabot[bot]", "codacy-badger" ]
53 changes: 53 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Development branches

on:
push:
branches:
- '*'
- '**/*'
- '!main'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
name: Build and run tests
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4

- name: Expose branch name
run: echo ${{ github.ref }}

# Setup JDK and Maven
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: zulu
cache: maven

# Prepare
- name: Prepare Maven Wrapper
run: chmod +x ./mvnw

# Build
- name: Build with Maven
run: ./mvnw clean verify -U -B -T4 -ntp

# I-test
- name: Run itest
run: ./mvnw integration-test failsafe:verify -Pitest -U -B -T4 -ntp

# - name: Upload coverage to Codecov
# if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
# uses: codecov/[email protected]
# with:
# token: ${{secrets.CODECOV_TOKEN}}

# - name: Upload test coverage to Codacy
# if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
# run: bash <(curl -Ls https://coverage.codacy.com/get.sh)
# env:
# CODACY_PROJECT_TOKEN: "${{secrets.CODACY_PROJECT_TOKEN}}"
58 changes: 58 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Produces and releases artifacts

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
name: Build and run tests
steps:
- name: Checkout code
uses: actions/checkout@v4

# Setup JDK and .m2/settings.xml
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
cache: maven
distribution: zulu
server-id: ossrh
server-username: OSS_CENTRAL_USERNAME # env variable for Maven Central
server-password: OSS_CENTRAL_PASSWORD # env variable for Maven Central

# Prepare
- name: Prepare Maven Wrapper
run: chmod +x ./mvnw

# Build
- name: Build with Maven
run: ./mvnw clean verify -U -B -T4 -ntp

# Get GPG private key into GPG
- name: Import GPG Owner Trust
run: echo ${{ secrets.GPG_OWNERTRUST }} | base64 --decode | gpg --import-ownertrust

- name: Import GPG key
run: echo ${{ secrets.GPG_SECRET_KEYS }} | base64 --decode | gpg --import --no-tty --batch --yes

# Publish release
- name: Deploy a new release version to Maven Central
run: ./mvnw clean deploy -B -DskipTests -DskipExamples -Prelease -Dgpg.keyname="${{ secrets.GPG_KEYNAME }}" -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" -ntp
env:
OSS_CENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
OSS_CENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

# - name: Upload coverage information
# uses: codecov/codecov-action@v2
# with:
# token: ${{ secrets.CODECOV_TOKEN }}

# - name: Upload test coverage to Codacy
# if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
# run: bash <(curl -Ls https://coverage.codacy.com/get.sh)
# env:
# CODACY_PROJECT_TOKEN: "${{secrets.CODACY_PROJECT_TOKEN}}"
33 changes: 33 additions & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Trigger the workflow on milestone events
on:
milestone:
types: [closed]
name: Milestone Closure
jobs:
create-release-notes:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main
- name: Create Release Notes Markdown
uses: docker://decathlon/release-notes-generator-action:3.1.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
OUTPUT_FOLDER: temp_release_notes
USE_MILESTONE_TITLE: "true"
- name: Get the name of the created Release Notes file and extract Version
run: |
RELEASE_NOTES_FILE=$(ls temp_release_notes/*.md | head -n 1)
echo "RELEASE_NOTES_FILE=$RELEASE_NOTES_FILE" >> $GITHUB_ENV
VERSION=$(echo ${{ github.event.milestone.title }} | cut -d' ' -f2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create a Draft Release Notes on GitHub
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: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
body_path: ${{ env.RELEASE_NOTES_FILE }}
draft: true
118 changes: 90 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.toolisticon.maven.parent</groupId>
<artifactId>maven-parent-kotlin-base</artifactId>
<version>2024.4.0</version>
<relativePath/>
</parent>

<groupId>io.holunda</groupId>
<artifactId>camunda-8-webmodeler-maven-plugin</artifactId>
<artifactId>camunda-web-modeler-maven-plugin</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>camunda-8-webmodeler-maven-plugin</name>
<name>${project.artifactId}</name>
<description>Plugin to download documents from Camunda Web Modeler via REST API</description>
<url>https://github.com/holunda-io/camunda-web-modeler-maven-plugin</url>
<packaging>maven-plugin</packaging>
<description>Plugin to download documents from Camunda Web Modeler via REST-Api</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<kotlin.version>1.9.23</kotlin.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<version.java>${java.version}</version.java>
<junit.version>5.9.2</junit.version>
</properties>

Expand Down Expand Up @@ -55,8 +57,22 @@
</dependencies>

<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<defaultGoal>clean jacoco:prepare-agent package</defaultGoal>

<pluginManagement>
<plugins>
<plugin>
<groupId>com.amashchenko.maven.plugin</groupId>
<artifactId>gitflow-maven-plugin</artifactId>
<configuration>
<gitFlowConfig>
<productionBranch>main</productionBranch>
</gitFlowConfig>
</configuration>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<!-- Generate META-INF for Plugins -->
Expand All @@ -73,25 +89,71 @@
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
</plugins>
</build>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>

<scm>
<connection>scm:git:[email protected]:holunda-io/camunda-web-modeler-maven-plugin.git</connection>
<url>scm:git:[email protected]:holunda-io/camunda-web-modeler-maven-plugin.git</url>
<developerConnection>scm:git:[email protected]:holunda-io/camunda-web-modeler-maven-plugin.git</developerConnection>
<tag>HEAD</tag>
</scm>

<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>

<developers>
<developer>
<id>MichaelVonB</id>
<name>Michael von Bargen</name>
<roles>
<role>Developer</role>
</roles>
<organization>Holisticon AG</organization>
<organizationUrl>https://holisticon.de</organizationUrl>
</developer>
<developer>
<id>christian-maschmann</id>
<name>Christian Maschmann</name>
<roles>
<role>Developer</role>
</roles>
<organization>Holisticon AG</organization>
<organizationUrl>https://holisticon.de</organizationUrl>
</developer>
</developers>
</project>

0 comments on commit ed54790

Please sign in to comment.