name: Release the current version on: push: branches: - "main" paths: - '.github/project.yaml' env: COMMON_MAVEN_OPTS: "-e -B --fae" jobs: release: name: Execute the release runs-on: ubuntu-latest steps: - name: Checkout the code uses: https://github.com/actions/checkout@v4 - name: Retrieve project metadata uses: https://github.com/radcortez/project-metadata-action@master id: metadata with: metadata-file-path: '.github/project.yaml' local-file: true - name: Validate current version if: contains(steps.metadata.outputs.current-version, 'SNAPSHOT') run: | echo '::error::Cannot release a SNAPSHOT version.' exit 1 - name: Validate next version if: contains(steps.metadata.outputs.next-version, 'SNAPSHOT') == 'false' run: | echo '::error::Next development version should be a SNAPSHOT version.' exit 1 - name: Configure SSH and Git env: SSH_DIR: /root/.ssh MAVEN_RELEASE_SSH_KEY: ${{ secrets.MAVEN_RELEASE_SSH_KEY }} run: | mkdir -p ${SSH_DIR}/ touch ${SSH_DIR}/known_hosts ssh-keyscan -t rsa -p 2222 git-ssh.kvant.cloud >> ${SSH_DIR}/known_hosts echo "${MAVEN_RELEASE_SSH_KEY}" | base64 -d >> ${SSH_DIR}/id_rsa chmod 600 ${SSH_DIR}/id_rsa git config --global user.name 'maven_release_technical_account' git config --global user.email 'maven-release-bot@phoenix-technologies.ch' git config --global commit.gpgsign true git config --global gpg.format ssh git config --global user.signingkey ${SSH_DIR}/id_rsa - name: Set up JDK 21 uses: https://github.com/actions/setup-java@v4 with: distribution: 'temurin' java-version: '21' cache: 'maven' - name: Make maven wrapper executable run: chmod +x mvnw - name: Download dependencies run: ./mvnw $COMMON_MAVEN_OPTS quarkus:go-offline - name: Prepare release run: ./mvnw $COMMON_MAVEN_OPTS release:prepare