Skip to content

Commit

Permalink
Configure releases to GitHub with JReleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Jul 28, 2021
1 parent 6b43c21 commit 0c69e2e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 27 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Version
id: version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}

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

- name: Cache Maven
uses: actions/cache@v2
Expand All @@ -36,7 +34,7 @@ jobs:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Release
- name: Release to Maven Central
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
Expand All @@ -47,22 +45,8 @@ jobs:
-Drepository.url=https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git \
-Dmaven.site.skip=true -Drelease=true deploy
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v0.4.4
with:
myToken: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
- name: Release to GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
### Changelog
${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./mvnw -B --file pom.xml -Pjreleaser jreleaser:release
4 changes: 0 additions & 4 deletions .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Trigger
on:
workflow_dispatch:
inputs:
branch:
description: "Branch to release from"
required: true
default: "main"
version:
description: "Release version"
required: true
Expand Down
28 changes: 28 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -477,5 +477,33 @@
</plugins>
</build>
</profile>

<profile>
<id>jreleaser</id>
<build>
<plugins>
<plugin>
<groupId>org.jreleaser</groupId>
<artifactId>jreleaser-maven-plugin</artifactId>
<version>0.5.0</version>
<inherited>false</inherited>
<configuration>
<jreleaser>
<project>
<java>
<version>8</version>
</java>
</project>
<release>
<github>
<skipTag>true</skipTag>
</github>
</release>
</jreleaser>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 0c69e2e

Please sign in to comment.