Release #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Release version" | |
required: true | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Cache Maven | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 8 | |
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 | |
- name: Update version | |
run: | | |
VERSION=${{ github.event.inputs.version }} | |
echo "Updating POMs to version $VERSION" | |
./mvnw -B versions:set versions:commit -DnewVersion=$VERSION | |
echo $VERSION > VERSION | |
sed -i -e "s/^\:project-version\:\ .*/:project-version: ${VERSION}/g" README.adoc | |
git config --global user.email "[email protected]" | |
git config --global user.name "kordamp-release-bot" | |
git commit -a -m "Releasing version $VERSION" | |
git push origin main | |
- 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) | |
./mvnw --no-transfer-progress -B --file pom.xml \ | |
-Drepository.url=https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git \ | |
-Dmaven.site.skip=true -Drelease=true deploy | |
- name: Release to GitHub | |
uses: jreleaser/release-action@v2 | |
env: | |
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: JReleaser output | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: artifact | |
path: | | |
out/jreleaser/trace.log | |
out/jreleaser/output.properties |