This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
Merge pull request #13 from shaishap/main #10
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: Build and Deploy - 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: OSSRH_USER | |
server-password: OSSRH_PASSWORD | |
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }} | |
gpg-passphrase: GPG_PASSPHRASE | |
- name: Build and Publish to Apache Maven Central | |
run: mvn clean compile | |
env: | |
OSSRH_USER: ${{ secrets.ORG_OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.ORG_OSSRH_PASSWORD }} | |
GPG_PASSPHRASE: ${{ secrets.ORG_GPG_PASSPHRASE }} | |
- name: Get package version | |
run: | | |
PKGVER=$(mvn org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate -Dexpression=project.version -q -DforceStdout) | |
# mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version | |
# PKGVER=$(mvn org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate -Dexpression=project.version | grep -v INFO | grep -E "\d") | |
echo "VER=$PKGVER" | |
git tag -d "$PKGVER" || true | |
git tag -a -m "auto-created by CI" "$PKGVER" | |
git push origin --tags |