Skip to content

Commit

Permalink
Update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi authored and ppalaga committed Jan 26, 2024
1 parent 3fb7c22 commit 38fc8e0
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ on:
paths:
- '.github/project.yml'

defaults:
run:
shell: bash

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
release:
runs-on: ubuntu-latest
name: release
if: ${{github.event.pull_request.merged == true}}

steps:
- uses: radcortez/project-metadata-action@master
- uses: radcortez/project-metadata-action@main
name: Retrieve project metadata
id: metadata
with:
Expand All @@ -30,21 +30,17 @@ 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 }}

- uses: actions/setup-java@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
java-version: 11
cache: 'maven'
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: |
Expand All @@ -53,19 +49,20 @@ jobs:
- name: Update latest release version in docs
run: |
./mvnw -B -ntp -pl docs -am install -Denforcer.skip -Dformatter.skip -Dimpsort.skip -Dkeytool.skip -Denforce-non-deployment.skip
if ! git diff --quiet docs/antora.yml; then
git add docs/antora.yml
mvn -B -ntp -pl docs -am generate-resources -Denforcer.skip -Dformatter.skip -Dimpsort.skip
if ! git diff --quiet docs/modules/ROOT/pages/includes/attributes.adoc; then
git add docs/modules/ROOT/pages/includes/attributes.adoc
git commit -m "Update the latest release version ${{steps.metadata.outputs.current-version}} in documentation"
fi
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
./mvnw -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
./mvnw -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
mvn -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Push changes to ${{github.base_ref}} branch
run: |
Expand Down

0 comments on commit 38fc8e0

Please sign in to comment.