Skip to content

Publish Snapshot to Sonatype #95

Publish Snapshot to Sonatype

Publish Snapshot to Sonatype #95

name: Publish Snapshot to Sonatype
on:
workflow_run:
workflows: [ "Run tests" ]
types: [ completed ]
branches: [ main ]
workflow_dispatch:
jobs:
publish-snapshot:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
services:
postgres:
image: postgres
env:
POSTGRES_USER: form-flow-test
POSTGRES_PASSWORD: postgres
POSTGRES_DB: form-flow-test
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
server-id: github
settings-path: ${{ github.workspace }}
- name: Create jar and publish to Sonatype
uses: gradle/[email protected]
with:
arguments: jar publish
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_SIGNING_KEY: ${{ secrets.PLATFORM_ROBOT_GPG_PRIVATE_KEY }}
GPG_SIGNING_PASSPHRASE: ${{ secrets.PLATFORM_ROBOT_GPG_PASSPHRASE }}
- name: Trigger starter-app tests on newly published version
uses: peter-evans/[email protected]
with:
repository: codeforamerica/form-flow-starter-app
event-type: form-flow-snapshot-updated
token: ${{ secrets.STARTER_APP_GITHUB_PAT }}
- name: Announce on Slack
if: failure()
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}