-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (54 loc) · 1.78 KB
/
publish-snapshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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 21
uses: actions/setup-java@v4
with:
java-version: '21'
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 }}