Skip to content

Maven Release

Maven Release #4

Workflow file for this run

name: Maven Release
on:
pull_request:
types: [closed]
paths:
- '.github/project.yml'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
name: release
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the PA_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- uses: radcortez/[email protected]
name: Retrieve project metadata from '.github/project.yml'
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'
local-file: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: sonatype-nexus-snapshots
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
cache: maven
- name: Configure Git author
run: |
git config --local user.email "[email protected]"
git config --local user.name "Cuioss Robot Action"
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
git checkout -b release
mvn -B --no-transfer-progress -Prelease,javadoc-mm-reporting release:clean release:prepare site:site site:stage -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
git checkout ${{vars.GITHUB_BASE_REF}}
git rebase release
mvn -B --no-transfer-progress -Prelease-perform release:perform
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Deploy Maven Site to cuioss.github.io -> ${{steps.metadata.outputs.pages-reference}}🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: target/site
repository-name: cuioss/cuioss.github.io
target-folder: ${{steps.metadata.outputs.pages-reference}}
branch: main
token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
#
- name: Push changes to ${{github.ref_name}}
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{github.ref_name}}
force: true
- name: Push tag ${{steps.metadata.outputs.current-version}}
uses: ad-m/[email protected]
with:
branch: ${{github.ref_name}}
github_token: ${{ secrets.GITHUB_TOKEN }}
tags: true
force: true