Skip to content
Merged
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
22 changes: 12 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
- package-ecosystem: maven
directory: /
schedule:
interval: "daily"
interval: daily
labels:
- "kind/dependencies"
- kind/dependencies
ignore:
# As long as we support Java 8
- dependency-name: "logback-classic"
update-types: [ "version-update:semver-major", "version-update:semver-minor" ]
- package-ecosystem: "github-actions"
directory: "/"
- dependency-name: logback-classic
update-types:
- version-update:semver-major
- version-update:semver-minor
- package-ecosystem: github-actions
directory: /
schedule:
interval: "daily"
interval: daily
labels:
- "kind/dependencies"
- kind/dependencies
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ name: CI

on:
push:
branches: [ '*' ]
branches:
- '*'
pull_request:
branches: [ '*' ]
branches:
- '*'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 11, 17 ]
java: [ 17, 21 ]
steps:
- name: Check out code
uses: actions/checkout@v4.1.1
Expand All @@ -25,4 +27,6 @@ jobs:
java-version: ${{ matrix.java }}

- name: Build
run: ./mvnw clean package
uses: gradle/gradle-build-action@v2.9.0
with:
arguments: build
25 changes: 10 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Release

on:
release:
types: [ published ]
types:
- published

jobs:
publish:
Expand All @@ -14,26 +15,23 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v3.13.0
with:
java-version: 8
java-version: 17
distribution: temurin
server-id: ossrh
server-username: NEXUS_USERNAME
server-password: NEXUS_PASSWORD
gpg-passphrase: GPG_PASSPHRASE
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Set artifact version
run: ./mvnw --batch-mode --define=generateBackupPoms=false --define=newVersion=${{ github.event.release.tag_name }} versions:set

- name: Publish package
run: ./mvnw --batch-mode --activate-profiles=deploy deploy
uses: gradle/gradle-build-action@v2.9.0
with:
arguments: publish -Pversion=${{ github.event.release.tag_name }}
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

update-versions:
needs: [ publish ]
needs:
- publish
permissions:
contents: write # for peter-evans/create-pull-request to create branch
pull-requests: write # for peter-evans/create-pull-request to create a PR
Expand All @@ -45,9 +43,6 @@ jobs:
ref: master
fetch-depth: 0

- name: Update pom.xml version
run: ./mvnw --batch-mode --define=generateBackupPoms=false --define=newVersion=${{ github.event.release.tag_name }} versions:set

- name: Update Maven version in README.md
run: sed --in-place 's/<version>.*<\/version>/<version>${{ github.event.release.tag_name }}<\/version>/g' README.md

Expand Down
Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 0 additions & 18 deletions .mvn/wrapper/maven-wrapper.properties

This file was deleted.

File renamed without changes.
16 changes: 0 additions & 16 deletions bnd.bnd

This file was deleted.

123 changes: 123 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
}

group = 'org.asteriskjava'

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
javadoc.options.encoding = 'UTF-8'

java {
sourceCompatibility = '17'
targetCompatibility = '17'

withSourcesJar()
withJavadocJar()
}

javadoc.options.addStringOption('Xdoclint:none', '-quiet')

repositories {
mavenCentral()
}

dependencies {
implementation 'com.google.guava:guava:32.1.3-jre'
implementation 'org.apache.logging.log4j:log4j-core:2.21.1'
implementation 'org.reflections:reflections:0.10.2'
implementation 'org.slf4j:slf4j-api:2.0.9'

testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testImplementation 'org.mockito:mockito-core:4.11.0'
testImplementation 'ch.qos.logback:logback-classic:1.3.11'
}

tasks.named('test') {
useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java

pom {
name = project.description
description = 'The free Java library for Asterisk PBX integration'
url = 'https://asterisk-java.org'
inceptionYear = '2004'

issueManagement {
system = 'GitHub'
url = 'https://github.com/asterisk-java/asterisk-java/issues'
}

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

scm {
url = 'https://github.com/asterisk-java/asterisk-java'
connection = 'scm:git:git@github.com:asterisk-java/asterisk-java.git'
developerConnection = 'scm:git:git@github.com:asterisk-java/asterisk-java.git'
}

developers {
developer {
id = 'srt'
name = 'Stefan Reuter'
email = 'stefan.reuter@reucon.com'
timezone = '+1'
}
developer {
id = 'rlsutton1'
name = 'Robert Sutton'
email = 'rsutton@noojee.com.au'
timezone = '+10'
}
developer {
id = 'bsutton'
name = 'Brett Sutton'
email = 'bsutton@noojee.com.au'
timezone = '+10'
}
developer {
id = 'piotrooo'
name = 'Piotr Olaszewski'
email = 'piotroo89@gmail.com'
timezone = '+1'
}
}
}
}
}
}

signing {
def signingKeyId = System.getenv('GPG_KEY_ID')
def signingKey = System.getenv('GPG_PRIVATE_KEY')
def signingPassword = System.getenv('GPG_PASSPHRASE')
useInMemoryPgpKeys(
signingKeyId,
signingKey,
signingPassword
)
sign publishing.publications.mavenJava
}

nexusPublishing {
repositories {
sonatype {
username = System.getenv('NEXUS_USERNAME')
password = System.getenv('NEXUS_PASSWORD')
}
}
}
Loading