Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/GitHub actions #148

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/01-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 01. Build

on:
push:
branches:
- master
- 'release/**'
- 'feature/**'

# See: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Maven.gitlab-ci.yml
env:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--settings .m2/settings.xml --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"

jobs:
build:
runs-on:
- ubuntu-22.04
container:
image: maven:3.8-eclipse-temurin-17-alpine
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Cache .m2
uses: actions/cache@v3
with:
path: ${GITHUB_WORKSPACE}/.m2/repository
key: v1-${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: v1-${{ runner.os }}-maven-
- name: Setup ${GITHUB_WORKSPACE}/.m2/settings.xml
uses: whelk-io/maven-settings-xml-action@v20
with:
output_file: ${GITHUB_WORKSPACE}/.m2/settings.xml
repositories: '[{ "id": "nexus", "url": "https://rapi.tools.ops.smartbear.io/nexus/content/groups/public/" }, { "id": "com.teamdev", "url": "https://europe-maven.pkg.dev/jxbrowser/releases" }]'
plugin_repositories: '[{ "id": "plugin-repository", "url": "https://rapi.tools.ops.smartbear.io/nexus/content/groups/public/" }]'
- name: Build plugin
if: ${{ contains(github.ref, 'refs/heads/master') || contains(github.ref, 'refs/heads/feature/') || contains(github.ref, 'refs/heads/release/') }}
run: mvn $MAVEN_CLI_OPTS clean compile assembly:single
- name: Upload JAR
if: ${{ contains(github.ref, 'refs/heads/master') || contains(github.ref, 'refs/heads/feature/') || contains(github.ref, 'refs/heads/release/') }}
uses: actions/upload-artifact@v3
with:
name: mqtt-plugin
path: target/ready-mqtt-plugin-*.jar
retention-days: 5
76 changes: 76 additions & 0 deletions .github/workflows/02-start-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: 02. Start release

on:
workflow_dispatch:
inputs:
release-version:
type: string
description: Version to release!
required: true
next-version:
type: string
description: Next version on main!
required: true

# See: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Maven.gitlab-ci.yml
env:
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$GITHUB_WORKSPACE/.m2/repository -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_CLI_OPTS: "--settings .m2/settings.xml --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"

jobs:
create-release-branch:
if: ${{ contains(github.ref, 'refs/heads/master') }}
runs-on:
- ubuntu-22.04
container:
image: maven:3.8-eclipse-temurin-17-alpine
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup ${GITHUB_WORKSPACE}/.m2/settings.xml
uses: whelk-io/maven-settings-xml-action@v20
with:
output_file: ${GITHUB_WORKSPACE}/.m2/settings.xml
repositories: '[{ "id": "nexus", "url": "https://rapi.tools.ops.smartbear.io/nexus/content/groups/public/" }, { "id": "com.teamdev", "url": "https://europe-maven.pkg.dev/jxbrowser/releases" }]'
plugin_repositories: '[{ "id": "plugin-repository", "url": "https://rapi.tools.ops.smartbear.io/nexus/content/groups/public/" }]'
- name: Set release version to ${{ inputs.release-version }}
run: mvn $MAVEN_CLI_OPTS versions:set -DnewVersion=${{ inputs.release-version }}
- name: Create release branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automated Change
branch: release/${{ inputs.release-version }}
file_pattern: pom.xml
create_branch: true
next-development-version:
if: ${{ contains(github.ref, 'refs/heads/master') }}
runs-on:
- ubuntu-22.04
container:
image: maven:3.8-eclipse-temurin-17-alpine
needs: create-release-branch
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup ${GITHUB_WORKSPACE}/.m2/settings.xml
uses: whelk-io/maven-settings-xml-action@v20
with:
output_file: ${GITHUB_WORKSPACE}/.m2/settings.xml
repositories: '[{ "id": "nexus", "url": "https://rapi.tools.ops.smartbear.io/nexus/content/groups/public/" }, { "id": "com.teamdev", "url": "https://europe-maven.pkg.dev/jxbrowser/releases" }]'
plugin_repositories: '[{ "id": "plugin-repository", "url": "https://rapi.tools.ops.smartbear.io/nexus/content/groups/public/" }]'
- name: Set next development version to ${{ inputs.next-version }}
run: mvn $MAVEN_CLI_OPTS versions:set -DnewVersion=${{ inputs.next-version }}
- name: Create branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automated Change
branch: bot/${{ inputs.next-version }}
file_pattern: pom.xml
create_branch: true
- name: Create merge request back to master
uses: devops-infra/action-pull-request@v0.4.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
target_branch: master
title: Closing bot/${{ inputs.next-version }}
body: "**Automated pull request**"
32 changes: 13 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@
</repository>
</repositories>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<dependencies>
<dependency>
<groupId>com.smartbear</groupId>
<artifactId>ready-api-soapui-pro</artifactId>
<version>3.20.1</version>
<version>3.40.1</version>
<exclusions>
<exclusion>
<groupId>com.lowagie</groupId>
Expand Down Expand Up @@ -55,30 +63,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.10.1</version>
<configuration>
<source>11</source>
<target>11</target>
<source>17</source>
<target>17</target>
<compilerArgs>
<arg>--add-exports</arg>
<arg>
java.desktop/sun.swing=ALL-UNNAMED,java.security.jgss/sun.security.jgss=ALL-UNNAMED,java.base/sun.net.spi=ALL-UNNAMED,java.desktop/sun.awt=ALL-UNNAMED,java.base/sun.security.x509=ALL-UNNAMED
</arg>
</compilerArgs>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>3.5.0-sb-fixed</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.4.17-02</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
Expand All @@ -92,5 +87,4 @@
</plugins>
</build>


</project>
</project>