Add actions

This commit is contained in:
Kostya Struga 2021-12-29 10:14:04 +03:00
parent 6d8f4bac20
commit 4fc2ac7725
3 changed files with 68 additions and 82 deletions

19
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Build Artifact
on:
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '15'
distribution: 'adopt'
- name: Build package
run: mvn --batch-mode clean compile

35
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Build Artifact
on:
push:
branches:
- 'master'
- 'main'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Maven Central Repository
uses: actions/setup-java@v2
with:
java-version: '15'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Publish package
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
run: |
mvn \
--no-transfer-progress \
--batch-mode \
-Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} \
clean deploy -Pdeploy

96
pom.xml
View File

@ -3,13 +3,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.rbkmoney</groupId> <groupId>dev.vality</groupId>
<artifactId>java-service-dependencies</artifactId> <artifactId>java-service-dependencies</artifactId>
<version>1.2.8</version> <version>1.2.8</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>java-service-dependencies</name> <name>Vality parent</name>
<description>RBK.Money java service dependencies</description> <description>Vality library parent pom</description>
<url>https://github.com/rbkmoney/java-service-dependencies</url> <url>https://github.com/valitydev/java-service-dependencies</url>
<licenses> <licenses>
<license> <license>
<name>Apache License, Version 2.0</name> <name>Apache License, Version 2.0</name>
@ -17,14 +17,15 @@
</license> </license>
</licenses> </licenses>
<scm> <scm>
<url>https://github.com/rbkmoney/java-service-dependencies</url> <url>https://github.com/valitydev/java-service-dependencies</url>
<developerConnection>scm:git:ssh://github.com/rbkmoney/java-service-dependencies.git</developerConnection> <developerConnection>scm:git:ssh://github.com/valitydev/java-service-dependencies.git</developerConnection>
<connection>scm:git:git://github.com/rbkmoney/java-service-dependencies.git</connection> <connection>scm:git:git://github.com/valitydev/java-service-dependencies.git</connection>
</scm> </scm>
<developers> <developers>
<developer> <developer>
<organization>RBK.money</organization> <email>devs@vality.dev</email>
<organizationUrl>https://rbk.money</organizationUrl> <organization>Vality</organization>
<organizationUrl>https://vality.dev</organizationUrl>
</developer> </developer>
</developers> </developers>
<properties> <properties>
@ -224,64 +225,7 @@
</dependencyManagement> </dependencyManagement>
<profiles> <profiles>
<profile> <profile>
<id>private</id> <id>deploy</id>
<activation>
<property>
<name>env.MVN_PROFILE</name>
<value>private</value>
</property>
</activation>
<distributionManagement>
<snapshotRepository>
<id>${privSnapRepoId}</id>
<url>${privSnapRepo}</url>
</snapshotRepository>
<repository>
<id>${privRepoId}</id>
<url>${privRepo}</url>
</repository>
</distributionManagement>
<repositories>
<repository>
<id>${privRepoId}</id>
<url>${privRepo}</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>${privSnapRepoId}</id>
<url>${privSnapRepo}</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>${pubSnapRepoId}</id>
<url>${pubSnapRepo}</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>public</id>
<activation>
<property>
<name>env.MVN_PROFILE</name>
<value>public</value>
</property>
</activation>
<distributionManagement> <distributionManagement>
<snapshotRepository> <snapshotRepository>
<id>${pubSnapRepoId}</id> <id>${pubSnapRepoId}</id>
@ -309,7 +253,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version> <version>3.3.1</version>
<executions> <executions>
<execution> <execution>
<id>attach-javadocs</id> <id>attach-javadocs</id>
@ -325,7 +269,7 @@
<plugin> <plugin>
<groupId>org.sonatype.plugins</groupId> <groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId> <artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version> <version>1.6.8</version>
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<serverId>${pubStagingRepoId}</serverId> <serverId>${pubStagingRepoId}</serverId>
@ -333,22 +277,10 @@
<autoReleaseAfterClose>${autoReleaseAfterClose}</autoReleaseAfterClose> <autoReleaseAfterClose>${autoReleaseAfterClose}</autoReleaseAfterClose>
</configuration> </configuration>
</plugin> </plugin>
</plugins>
</build>
</profile>
<profile>
<id>sign</id>
<activation>
<property>
<name>env.MVN_PROFILE</name>
</property>
</activation>
<build>
<plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version> <version>3.0.1</version>
<executions> <executions>
<execution> <execution>
<id>sign-artifacts</id> <id>sign-artifacts</id>