Skip to content

Commit

Permalink
dev work
Browse files Browse the repository at this point in the history
Add release and tests workflows
  • Loading branch information
8naama authored Jul 21, 2024
2 parents 77091ee + 1b2a484 commit efbca01
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release new version to Maven

on:
release:
type: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Get the code
uses: actions/checkout@v4
- name: Setup Java 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
server_id: ossrh-nexus
server-username: ${{ secrets.OSSRH_USERNAME }}
server-password: ${{ secrets.OSSRH_PASSWORD }}
gpg-private-key: ${{ secrets.GPG_KEY }}
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Verify the pom.xml
run: mvn verify
- name: Publish to the Maven Central Repository
run: mvn clean deploy
17 changes: 17 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Run tests on package
on:
pull_request:
branches: [master]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Get the code
uses: actions/checkout@v4
- name: Setup Java 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- name: Test with Maven
run: mvn test
42 changes: 39 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
<module>logzio-sender</module>
</modules>

<distributionManagement>
<repository>
<id>ossrh-nexus</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/</url>
</repository>
</distributionManagement>

<build>
<plugins>
<plugin>
Expand Down Expand Up @@ -74,7 +82,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>3.2.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -88,14 +96,36 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.3</version>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh-nexus</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.3.1</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.8.2</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-engine</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<version>1.8.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<resources>
<resource>
Expand Down Expand Up @@ -125,7 +155,13 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.0</version>
<version>5.10.2</version>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-api</artifactId>
<version>1.8.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
Expand Down

0 comments on commit efbca01

Please sign in to comment.