Skip to content

Commit

Permalink
Test workflow, publish to Github packages
Browse files Browse the repository at this point in the history
(cherry picked from commit 0ca319b)
  • Loading branch information
burmanm committed Jan 13, 2025
1 parent 1e99bbc commit 72723d5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 117 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: SSTableTools release

on:
push:
tags:
- '*'

jobs:
release_tools_version:
name: Release SSTable Tools jar
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
- name: Build with Maven
run: |
mvn clean install
- name: Publish package
run: mvn --batch-mode deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
target/ic-sstable-tools.jar
bin/ic-sstable-tools
124 changes: 7 additions & 117 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<maven.git.command.plugin.version>4.9.10</maven.git.command.plugin.version>

<maintainer>Various &lt;support@instaclustr.com&gt;</maintainer>
<version.jdeb>1.8</version.jdeb>
<version.rpm>1.5.0</version.rpm>
<version.maven.release.plugin>2.5.3</version.maven.release.plugin>

<git.commit.id/>
Expand Down Expand Up @@ -63,22 +61,19 @@
</organization>

<scm>
<connection>scm:git:git://git@github.com:instaclustr/cassandra-sstable-tools.git</connection>
<developerConnection>scm:git:ssh://github.com/instaclustr/cassandra-sstable-tools.git</developerConnection>
<url>git://github.com/instaclustr/cassandra-sstable-tools.git</url>
<connection>scm:git:git://git@github.com:burmanm/cassandra-sstable-tools.git</connection>
<developerConnection>scm:git:ssh://github.com/burmanm/cassandra-sstable-tools.git</developerConnection>
<url>git://github.com/burmanm/cassandra-sstable-tools.git</url>
</scm>

<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/burmanm/cassandra-sstable-tools</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

<dependencies>
<dependency>
<groupId>info.picocli</groupId>
Expand Down Expand Up @@ -208,111 +203,6 @@
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.vafer</groupId>
<artifactId>jdeb</artifactId>
<version>${version.jdeb}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<name>${project.artifactId}</name>
<deb>${outputDirectory}/[[name]]_${project.version}.deb</deb>
<dataSet>
<data>
<src>${outputDirectory}/${project.build.finalName}.jar</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/usr/share/cassandra/lib</prefix>
</mapper>
</data>
<data>
<src>${project.basedir}/bin/ic-sstable-tools</src>
<type>file</type>
<mapper>
<type>perm</type>
<prefix>/usr/local/bin/</prefix>
</mapper>
</data>
</dataSet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>de.dentrassi.maven</groupId>
<artifactId>rpm</artifactId>
<version>${version.rpm}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>rpm</goal>
</goals>
<configuration>
<packageName>${project.artifactId}</packageName>
<group>Applications/Databases</group>
<packager>${maintainer}</packager>

<skipSigning>true</skipSigning>

<entries>
<entry>
<name>/usr/share/cassandra/lib/${project.build.finalName}.jar</name>
<file>${outputDirectory}/${project.build.finalName}.jar</file>
</entry>
<entry>
<name>/usr/local/bin/ic-sstable-tools</name>
<file>${project.basedir}/bin/ic-sstable-tools</file>
<mode>0755</mode>
</entry>
</entries>
<targetDir>${outputDirectory}</targetDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<!-- Use this profile when releasing. For example: "mvn clean deploy -P release" -->
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven.gpg.plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus.staging.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!--Use "mvn nexus-staging:release -P release" to push from the OSSRH staging repo to Maven Central-->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 72723d5

Please sign in to comment.