Skip to content

Commit

Permalink
Create rpm package (#18)
Browse files Browse the repository at this point in the history
* Adds rpm building

* Untabify
  • Loading branch information
StrongestNumber9 authored Oct 23, 2023
1 parent 52d300c commit 781be41
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/upload_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,14 @@ jobs:
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= clean deploy -Ppublish-github-packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Pack RPM
run: cd rpm/ && mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= -f rpm.pom.xml package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: Attach rpm to release
uses: softprops/action-gh-release@v1
with:
files: rpm/target/rpm/com.teragrep-jla_02/RPMS/noarch/com.teragrep-jla_02-*.rpm
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ dependency-reduced-pom.xml
target/
jla_02.iml
.flattened-pom.xml
rpm/target/
110 changes: 110 additions & 0 deletions rpm/rpm.pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<packaging>rpm</packaging>
<modelVersion>4.0.0</modelVersion>
<artifactId>jla_02</artifactId>
<version>${revision}${sha1}${changelist}</version>
<name>jla_02</name>
<description>jla_02</description>
<groupId>com.teragrep</groupId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>0.0.1</revision>
<changelist>-SNAPSHOT</changelist>
<sha1/>
</properties>
<build>
<directory>${project.basedir}/target</directory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.2.0</version>
<extensions>true</extensions>
<executions>
<execution>
<id>default-rpm</id>
<goals>
<goal>rpm</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<summary>${project.groupId}-${project.artifactId}</summary>
<name>${project.groupId}-${project.artifactId}</name>
<version>${project.version}</version>
<release>${env.BUILD_ID}</release>
<license>Proprietary</license>
<distribution>Teragrep</distribution>
<vendor>https://teragrep.com/</vendor>
<packager>teragrep &lt;servicedesk@teragrep.com&gt;</packager>
<group>teragrep/teragrep</group>
<description>${project.groupId}-${project.artifactId}</description>
<needarch>false</needarch>
<defaultUsername>root</defaultUsername>
<defaultGroupname>root</defaultGroupname>
<defaultFilemode>0644</defaultFilemode>
<defaultDirmode>0755</defaultDirmode>
<mappings>
<mapping>
<directory>/opt/teragrep/${project.artifactId}/lib</directory>
<directoryIncluded>true</directoryIncluded>
<filemode>755</filemode>
<sources>
<source>
<location>${project.basedir}/../target/jla_02-${revision}${sha1}${changelist}.jar</location>
<destination>jla_02.jar</destination>
</source>
</sources>
</mapping>
<mapping>
<directory>/opt/teragrep/${project.artifactId}/conf</directory>
<directoryIncluded>true</directoryIncluded>
<filemode>700</filemode>
<configuration>noreplace</configuration>
<sources>
<source>
<location>${project.basedir}/../conf</location>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>default-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<skipMain>true</skipMain>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 781be41

Please sign in to comment.