Update ci.yml #7
Workflow file for this run
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: Release to Maven Central | |
on: | |
push: | |
tags: | |
- "*" | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: "21" | |
distribution: "temurin" | |
cache: "maven" | |
server-id: ossrh | |
server-username: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} | |
server-password: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} | |
gpg-private-key: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }} | |
gpg-passphrase: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} | |
- name: Import GPG key | |
run: | | |
echo "${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEY }}" | gpg --import | |
echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf | |
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf | |
gpg-connect-agent reloadagent /bye | |
- name: Build and test | |
run: mvn -B clean verify | |
env: | |
MAVEN_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} | |
INFISICAL_MACHINE_IDENTITY_CLIENT_ID: ${{ secrets.INFISICAL_MACHINE_IDENTITY_CLIENT_ID }} | |
INFISICAL_MACHINE_IDENTITY_CLIENT_SECRET: ${{ secrets.INFISICAL_MACHINE_IDENTITY_CLIENT_SECRET }} | |
INFISICAL_PROJECT_ID: ${{ secrets.INFISICAL_PROJECT_ID }} | |
INFISICAL_SITE_URL: ${{ secrets.INFISICAL_SITE_URL }} | |
- name: Set version | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
mvn versions:set -DnewVersion=${VERSION} -DgenerateBackupPoms=false | |
- name: Publish to Maven Central | |
env: | |
# Release | |
MAVEN_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} | |
run: | | |
mvn --batch-mode \ | |
--no-transfer-progress \ | |
clean deploy \ | |
-P release \ | |
-DskipTests |