Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Update build-deploy.yml #4

Update build-deploy.yml

Update build-deploy.yml #4

Workflow file for this run

name: Build, Deploy, Release - maven central
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Set up Apache Maven Central
uses: actions/setup-java@v3
with: # configure settings.xml
distribution: 'temurin'
java-version: '11'
server-id: ossrh
server-username: ${{ secrets.ORG_OSSRH_USERNAME }}
server-password: ${{ secrets.ORG_OSSRH_PASSWORD }}
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }}
- name: Build and Publish to Apache Maven Central
run: |
cat /home/runner/.m2/settings.xml
mvn clean deploy
env:
GH_TOKEN: ${{ github.token }}
- name: Get package version
run: |
PKGVER=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version | grep -v INFO | grep -E "\d")
git tag -d "$PKGVER" || true
git tag -a -m "auto-created by CI" "$PKGVER"
git push origin --tags