Publish Snapshot to Sonatype #355
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: 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@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
server-id: github | |
settings-path: ${{ github.workspace }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Create jar and Publish to Sonatype | |
run: ./gradlew 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 }} |