Skip to content

Commit

Permalink
build: prepare for release
Browse files Browse the repository at this point in the history
- favor one profile to do the release over multiple
- install mvn wrapper
  • Loading branch information
jonas-grgt committed Jan 16, 2024
1 parent 2f21ca6 commit b7765fd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 77 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn -B verify --file pom.xml
68 changes: 18 additions & 50 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,27 @@
name: release

name: Release and Publish package to the Maven Central Repository
on:
workflow_dispatch:

push:
tags:
- v*
pull_request:
branches: [ main ]
jobs:
release:
name: Release
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

# Configure build steps as you'd normally do

- name: Setup Java
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'zulu'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

# Post JARs to Maven Central

- name: Release to Maven Central
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
export GPG_TTY=$(tty)
git config user.name "JonasG"
git config user.email "[email protected]"
mvn -B --file pom.xml release:prepare release:perform
# Create a release

- name: Run JReleaser
uses: jreleaser/release-action@v2
java-version: '17'
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:full-release -DaltDeploymentRepository=local::file:./target/staging-deploy --non-recursive

# Persist logs

- name: JReleaser release output
if: always()
uses: actions/upload-artifact@v3
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
12 changes: 0 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,6 @@
</jreleaser>
</configuration>
</plugin>

</plugins>
</build>
</profile>
<profile>
<id>publication</id>
<properties>
<altDeploymentRepository>local::file:./target/staging-deploy</altDeploymentRepository>
</properties>
<build>
<defaultGoal>deploy</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down
20 changes: 6 additions & 14 deletions xjx-serdes/src/main/java/io/jonasg/xjx/serdes/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,23 @@
* The {@code Tag} annotation is used to mark a field for XML serialization and deserialization.
* It provides information about the XML path and optional attributes to be used during serialization and deserialization.
*
* <p>
* Example XML document:
* <pre> {@code
* <p>Example XML document:</p>
* <pre>{@code
* <Products>
* <Name>Product 1</Name>
* <Name>Product 2</Name>
* <Name>Product 3</Name>
* </Products>
* }</pre>
* </p>
* <p>
* Example Usage:
*
* <p>Example Usage:</p>
* <pre>{@code
* @Tag(path = "/Products", items = "Name")
* List<String> productNames;
* }</pre>
* In this example, the {@code List<String>} field 'productNames' will be serialized to and deserialized from the XML path "/Products/Name".
* </p>
*
* <p>
* Example XML for Serialization:
* <p>Example XML for Serialization:</p>
* <pre>{@code
* <Products>
* <Name>Product 1</Name>
Expand All @@ -38,17 +34,13 @@
* </Products>
* }</pre>
* In this example, when the {@code List<String>} field 'productNames' is serialized, the generated XML will look like the above representation.
* </p>
*
* <p>
* Annotation Usage:
* <p>Annotation Usage:</p>
* <ul>
* <li>{@code path}: Specifies the Path expression indicating the location of the XML data for serialization and deserialization.</li>
* <li>{@code attribute}: Specifies the name of an XML attribute to be used during serialization and deserialization (optional).</li>
* <li>{@code items}: Specifies additional information for serializing and deserializing items within a collection (optional).</li>
* </ul>
* </p>
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.FIELD})
Expand Down

0 comments on commit b7765fd

Please sign in to comment.