more attempts #10
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 Maven Central Repository | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 21 | |
server-id: oss.sonatype.org | |
server-username: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} | |
server-password: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
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: Setup Maven settings.xml | |
run: | | |
mkdir -p ~/.m2 | |
echo "<settings><servers><server><id>ossrh</id><username>${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }}</username><password>${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }}</password></server></servers></settings>" > ~/.m2/settings.xml | |
- name: Verify settings.xml | |
run: | | |
echo "Checking settings.xml content (redacted):" | |
sed 's/\(<password>\)[^<]*\(<\/password>\)/\1****\2/g; s/\(<username>\)[^<]*\(<\/username>\)/\1****\2/g' ~/.m2/settings.xml | |
- 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 | |
- name: Publish package | |
run: mvn --batch-mode clean deploy -P central-deploy -DskipTests=true | |
env: | |
MAVEN_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALUSERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_MAVENCENTRALPASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGINMEMORYKEYPASSWORD }} |