Skip to content

Commit

Permalink
Fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik committed Sep 25, 2024
1 parent 4a9c869 commit ad36a9b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
Binary file modified .github/release/maven-settings.xml.gpg
Binary file not shown.
19 changes: 10 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,26 @@ jobs:

- uses: actions/checkout@v4

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Install JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
check-latest: true
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Configure Git author
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.GPG_PASSPHRASE}}" --output maven-settings.xml .github/release/maven-settings.xml.gpg
git checkout -b release
mvn -B release:prepare -Prelease,framework,extensions,examples -DautoVersionSubmodules -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} -s maven-settings.xml
mvn -B release:prepare -Prelease,framework,extensions,examples -DautoVersionSubmodules -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}-SNAPSHOT -s maven-settings.xml
git checkout ${{github.base_ref}}
git rebase release
mvn -B release:perform -DskipITs -DskipTests -Prelease,framework -s maven-settings.xml
Expand All @@ -58,6 +55,10 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{github.base_ref}}
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Push tags
uses: ad-m/[email protected]
Expand Down
7 changes: 5 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>@{project.version}</tagNameFormat>
Expand All @@ -127,6 +128,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.6</version>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
Expand All @@ -145,6 +147,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.0</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -202,11 +205,11 @@
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>oss.sonatype</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</project>

0 comments on commit ad36a9b

Please sign in to comment.