Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Petoss 533 publish java sdk after manual release from GitHub #387

Merged
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish
on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout Xero-Java repo
uses: actions/checkout@v4
with:
repository: XeroAPI/Xero-Java
path: Xero-Java

- name: Set up JDK environment
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: maven

- name: Import GPG Key
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY}}

- name: Configure Maven settings
run: |
mkdir -p ~/.m2
echo "<settings>
vigneshk-tw marked this conversation as resolved.
Show resolved Hide resolved
<servers>
<server>
<id>ossrh</id>
<username>${{ secrets.MAVEN_USERNAME }}</username>
<password>${{ secrets.MAVEN_TOKEN }}</password>
</server>
</servers>
</settings>" > ~/.m2/settings.xml

- name: Publish to Maven
run: |
export GPG_TTY=$(tty)
mvn clean deploy -DskipTests=true -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
working-directory: Xero-Java