Skip to content

Commit

Permalink
try to add jreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed Jan 29, 2024
1 parent e99ee54 commit 458f6c2
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 29 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish package to the Maven Central Repository
on:
push:
tags:
- jfiveparse-*
pull_request:
branches: [ main ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Publish package
env:
JRELEASER_NEXUS2_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
JRELEASER_NEXUS2_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./mvnw -Prelease deploy jreleaser:deploy -DaltDeploymentRepository=local::file:./target/staging-deploy
60 changes: 31 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<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">
<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">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>9</version>
</parent>

<groupId>ch.digitalfondue.jfiveparse</groupId>
<artifactId>jfiveparse</artifactId>
<version>1.0.3-SNAPSHOT</version>
<packaging>jar</packaging>
<inceptionYear>2015</inceptionYear>

<description>jfiveparse is a 0 dependencies compact html 5 parser. It pass all the non scripted tests for the tokenizer and tree construction from the html5lib-tests suite.</description>
<description>jfiveparse is a 0 dependencies compact html 5 parser. It pass all the non scripted tests for the
tokenizer and tree construction from the html5lib-tests suite.
</description>

<name>jfiveparse</name>
<url>https://github.com/digitalfondue/jfiveparse</url>
Expand Down Expand Up @@ -121,7 +118,7 @@
</execution>
</executions>
</plugin>
<!-- http://stackoverflow.com/a/29796988 -->
<!-- http://stackoverflow.com/a/29796988 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down Expand Up @@ -157,31 +154,36 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>sign-artifacts</id>
<activation>
<property>
<name>sign</name>
<value>true</value>
</property>
</activation>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<groupId>org.jreleaser</groupId>
<artifactId>jreleaser-maven-plugin</artifactId>
<version>1.10.0</version>
<configuration>
<jreleaser>
<signing>
<active>ALWAYS</active>
<armored>true</armored>
</signing>
<deploy>
<maven>
<nexus2>
<maven-central>
<active>ALWAYS</active>
<url>https://s01.oss.sonatype.org/service/local</url>;
<closeRepository>false</closeRepository>
<releaseRepository>false</releaseRepository>
<stagingRepositories>target/staging-deploy</stagingRepositories>
</maven-central>
</nexus2>
</maven>
</deploy>
</jreleaser>
</configuration>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit 458f6c2

Please sign in to comment.