Skip to content

Initial Support for Alfresco Enterprise #43

Initial Support for Alfresco Enterprise

Initial Support for Alfresco Enterprise #43

Workflow file for this run

name: Publish package to the Maven Central Repository
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}"
- uses: actions/checkout@v2
- name: Set up Maven Central Repository
uses: actions/setup-java@v1
with:
java-version: 17
server-id: ossrh
server-username: ${{ secrets.OSS_SONATYPE_USERNAME }}
server-password: ${{ secrets.OSS_SONATYPE_PASSWORD }}
gpg-private-key: ${{ secrets.GPG_SIGNING_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
- name: Configure Maven settings.xml
run: |
mkdir -p /home/runner/.m2
cat > /home/runner/.m2/settings.xml <<EOL
<settings>
<servers>
<server>
<id>ossrh</id>
<username>${{ secrets.OSS_SONATYPE_USERNAME }}</username>
<password>${{ secrets.OSS_SONATYPE_PASSWORD }}</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.passphrase>${{ secrets.GPG_SIGNING_PASSPHRASE }}</gpg.passphrase>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>ossrh</activeProfile>
</activeProfiles>
</settings>
EOL
- name: Import GPG key
env:
GPG_TTY: $(tty)
run: |
echo "${{ secrets.GPG_SIGNING_PRIVATE_KEY }}" | gpg --batch --import
echo "use-agent" >> ~/.gnupg/gpg.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
gpg --batch --yes --pinentry-mode loopback --passphrase $GPG_SIGNING_PASSPHRASE --list-keys
- name: Set projects Maven version to GitHub Action GUI set version
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}"
- name: Publish package
run: mvn --batch-mode clean deploy -P mavenCentral -DskipTests=true -Dgpg.passphrase=${{ secrets.GPG_SIGNING_PASSPHRASE }}
env:
GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}