Unverified Commit 4ab33737 authored by Adrien's avatar Adrien Committed by GitHub
Browse files

other(refactor): make project community friendly

parents 6af1055f f3110606
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 8
- name: Build and test
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
run: ./mvnw -B clean verify sonar:sonar -Dsonar.login=${{ secrets.SONAR_TOKEN }}
- run: mkdir staging && cp target/*.zip staging
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: Connectors
path: staging
name: 'Commit Message Check'
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
jobs:
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- name: Check Commit Type
uses: gsactions/commit-message-checker@v1
with:
pattern: '^\S+\((.+)\):\s(.+)$'
flags: 'gm'
error: 'Your first line has to matches the following pattern: type(category): description [flags], where flags is an optional coma separated list. Check the contributing guidlines for more details.'
name: Create release
on:
push:
branches:
- release-*
jobs:
build:
name: Release pipeline
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 8
- name: Extract version
shell: bash
run: echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/heads/} | sed 's/release-//g')"
id: extract_version
- name: changelog
uses: scottbrenner/generate-changelog-action@master
id: Changelog
env:
REPO: ${{ github.repository }}
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.extract_version.outputs.version }}
release_name: Release ${{ steps.extract_version.outputs.version }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false
- name: Release Connector
uses: samuelmeuli/action-maven-publish@v1
with:
gpg_private_key: ${{ secrets.gpg_private_key }}
gpg_passphrase: ${{ secrets.gpg_passphrase }}
nexus_username: ${{ secrets.ossrh_username }}
nexus_password: ${{ secrets.ossrh_password }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: target/bonita-connector-twitter-${{ steps.extract_version.outputs.version }}-all.zip
asset_name: bonita-connector-twitter-${{ steps.extract_version.outputs.version }}-all.zip
asset_content_type: application/zip
\ No newline at end of file
timestamps {
ansiColor('xterm') {
node {
stage('Setup') {
checkout scm
}
stage('Build') {
try {
if(env.BRANCH_NAME.equals('master')){
sh "./mvnw -B clean deploy -DaltDeploymentRepository=${env.ALT_DEPLOYMENT_REPOSITORY_SNAPSHOTS} -Djvm=${env.JAVA_HOME_11}/bin/java"
}else{
sh "./mvnw -B clean verify -Djvm=${env.JAVA_HOME_11}/bin/java"
}
archiveArtifacts 'target/bonita-connector-twitter-*.zip'
} finally {
junit '**/target/*-reports/*.xml'
}
}
}
}
}
\ No newline at end of file
bonita-connector-twitter
========================
Twitter connector.
# Twitter Connector
Please use development branch
[![Actions Status](https://github.com/bonitasoft/bonita-connector-twitter/workflows/Build/badge.svg)](https://github.com/bonitasoft/bonita-connector-twitter/actions?query=workflow%3ABuild)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=bonitasoft_bonita-connector-twitter&metric=alert_status)](https://sonarcloud.io/dashboard?id=bonitasoft_bonita-connector-twitter)
[![GitHub release](https://img.shields.io/github/v/release/bonitasoft/bonita-connector-twitter?color=blue&label=Release)](https://github.com/bonitasoft/bonita-connector-twitter/releases)
[![Maven Central](https://img.shields.io/maven-central/v/org.bonitasoft.connectors/bonita-connector-twitter.svg?label=Maven%20Central&color=orange)](https://search.maven.org/search?q=g:%22org.bonitasoft.connectors%22%20AND%20a:%22bonita-connector-twitter%22)
[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-yellow.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
## Build
__Clone__ or __fork__ this repository, then at the root of the project run:
`./mvnw`
## Release
In order to create a new release push a `release-<version>` branch with the desired version in pom.xml.
Update the `master` with the next SNAPSHOT version.
## Contributing
We would love you to contribute, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
## License
The sources and documentation in this project are released under the [GPLv2 License](LICENSE)
timestamps {
node {
stage('Setup') {
checkout scm
}
stage('Release') {
withCredentials([usernamePassword(
credentialsId: 'github',
passwordVariable: 'GIT_PASSWORD',
usernameVariable: 'GIT_USERNAME')]) {
sh """
./mvnw -B release:prepare release:perform -Darguments="-DaltDeploymentRepository=${env.ALT_DEPLOYMENT_REPOSITORY_TAG} -Djvm=${env.JAVA_HOME_11}/bin/java"
"""
}
}
}
}
\ No newline at end of file
{
"name": "bonita-connector-twitter",
"version": "1.2.1"
}
......@@ -2,123 +2,328 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>bonita-connectors</artifactId>
<groupId>org.bonitasoft.connectors</groupId>
<version>1.0.0</version>
</parent>
<groupId>org.bonitasoft.connectors</groupId>
<artifactId>bonita-connector-twitter</artifactId>
<version>1.2.1-SNAPSHOT</version>
<name>Bonita Twitter Connector</name>
<description>Connector to interact with Twitter API's from Bonita</description>
<url>https://www.bonitasoft.com</url>
<developers>
<developer>
<id>bonitasoft</id>
<name>Bonitasoft</name>
<email>rd.user@bonitasoft.com</email>
<organization>Bonitasoft</organization>
<organizationUrl>https://www.bonitasoft.com</organizationUrl>
</developer>
</developers>
<licenses>
<license>
<name>GPL-v2.0</name>
<url>http://www.gnu.org/licenses/gpl-2.0.txt</url>
</license>
</licenses>
<properties>
<bonita.engine.version>6.3.2</bonita.engine.version>
<!-- Maven -->
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyy.MM.dd-hh.mm</maven.build.timestamp.format>
<!--Twitter Connector -->
<twitter-direct.def.id>twitter-direct</twitter-direct.def.id>
<twitter-direct.def.version>1.0.0</twitter-direct.def.version>
<twitter-direct.impl.id>${twitter-direct.def.id}-impl</twitter-direct.impl.id>
<twitter-direct.impl.version>${project.version}</twitter-direct.impl.version>
<twitter-direct.main-class>org.bonitasoft.connectors.twitter.TwitterDirectMessageConnector</twitter-direct.main-class>
<twitter-update-status.def.id>twitter-update-status</twitter-update-status.def.id>
<twitter-update-status.def.version>1.0.0</twitter-update-status.def.version>
<twitter-update-status.impl.id>${twitter-update-status.def.id}-impl</twitter-update-status.impl.id>
<twitter-update-status.impl.version>${project.version}</twitter-update-status.impl.version>
<twitter-update-status.main-class>org.bonitasoft.connectors.twitter.TwitterUpdateStatusConnector</twitter-update-status.main-class>
<!-- Connector dependencies -->
<javax.activation.version>1.1</javax.activation.version>
<twitter4j.version>4.0.7</twitter4j.version>
<!-- Bonita -->
<bonita.engine.version>7.11.0</bonita.engine.version>
<!-- Test -->
<jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
<!-- Maven plugins -->
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<maven-assembly-plugin.version>3.1.1</maven-assembly-plugin.version>
<groovy-maven-plugin.version>2.1.1</groovy-maven-plugin.version>
<groovy-all.version>2.4.16</groovy-all.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
<maven-source-plugin.version>3.2.0</maven-source-plugin.version>
<!-- Sonar -->
<sonar.projectKey>bonitasoft_bonita-connector-twitter</sonar.projectKey>
<sonar.organization>bonitasoft</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.bonitasoft.engine</groupId>
<artifactId>bonita-engine</artifactId>
<version>${bonita.engine.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${javax.activation.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<!-- Latest Version of Bonita released, against which the initial development
has been done. -->
<!-- The connector will be tested against more recent version -->
<artifactId>bonita-common</artifactId>
<groupId>org.bonitasoft.engine</groupId>
<version>${bonita.engine.version}</version>
<scope>provided</scope>
</dependency>
<!-- Bonita -->
<dependency>
<artifactId>bonita-common</artifactId>
<groupId>org.bonitasoft.engine</groupId>
<version>${bonita.engine.version}</version>
<scope>provided</scope>
</dependency>
<!-- Twitter -->
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-core</artifactId>
<version>4.0.7</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>${twitter4j.version}</version>
</dependency>
<!-- Test -->
<dependency>
<artifactId>junit</artifactId>
<groupId>junit</groupId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<build>
<defaultGoal>verify</defaultGoal>
<resources>
<resource>
<directory>src/main/resources-filtered</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<configuration>
<descriptorSourceDirectory>${project.basedir}/src/assembly</descriptorSourceDirectory>
</configuration>
<executions>
<execution>
<id>package-connectors</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>true</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<version>${groovy-maven-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${groovy-all.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<tagNameFormat>@{project.version}</tagNameFormat>
<enableAssertions>true</enableAssertions>
<forkCount>1</forkCount>
<reuseForks>true</reuseForks>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5</version>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<configuration>
<append>true</append>
</configuration>
<executions>
<execution>
<id>assemble</id>
<phase>none</phase>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>groovy-maven-plugin</artifactId>
<executions>
<execution>
<id>all</id>
<phase>package</phase>
<phase>generate-resources</phase>
<goals>
<goal>single</goal>
<goal>execute</goal>
</goals>
<configuration>
<descriptor>${basedir}/connector-assembly.xml</descriptor>
<appendAssemblyId>true</appendAssemblyId>
<source>${project.basedir}/src/script/dependencies-as-var.groovy</source>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>twitter-direct-message</id>
<phase>package</phase>
<id>attach-sources</id>
<goals>
<goal>single</goal>
<goal>jar-no-fork</goal>
</goals>
<configuration>
<descriptor>${basedir}/twitter-direct-message-assembly.xml</descriptor>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>twitter-update-status</id>
<phase>package</phase>
<id>attach-javadocs</id>
<goals>
<goal>single</goal>
<goal>jar</goal>
</goals>
<configuration>
<descriptor>${basedir}/twitter-update-status-assembly.xml</descriptor>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<scm>
<developerConnection>scm:git:https://${env.GIT_USERNAME}:${env.GIT_PASSWORD}@github.com/bonitasoft/bonita-connector-twitter.git</developerConnection>
<connection>scm:git:https://${env.GIT_USERNAME}:${env.GIT_PASSWORD}@github.com/bonitasoft/bonita-connector-twitter.git</connection>
<url>https://github.com/bonitasoft/bonita-connector-twitter</url>
<tag>HEAD</tag>
</scm>
<profiles>
<!-- Deployment profile (required so these plugins are only used when deploying) -->
<profile>
<id>deploy</id>
<build>
<plugins>
<!-- GPG plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- Prevent `gpg` from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<distributionManagement>
<!-- Central Repository -->
<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>