Repository navigation
93 lines (89 loc) · 3.06 KB
/
Copy pathjdbc-postgresql.yaml
File metadata and controls
93 lines (89 loc) · 3.06 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: jdbc-postgresql
# The JDBC driver for PostgreSQL is a Maven project of its own, outside the root reactor and
# independent of rontolisp (.kb/jdbc-postgresql.md): only a change to it runs its tests,
# against a PostgreSQL in Docker and beside pgjdbc. Compiling it with rontolisp is
# ClPostgresE2eTest's, in ci.yaml.
on:
push:
branches:
- develop
- main
paths:
- jdbc-postgresql/**
- .github/workflows/jdbc-postgresql.yaml
pull_request:
branches:
- develop
- main
paths:
- jdbc-postgresql/**
- .github/workflows/jdbc-postgresql.yaml
workflow_dispatch: {}
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up JDK 25
uses: actions/setup-java@v6
with:
java-version: '25'
distribution: 'liberica'
cache: maven
- name: Test
run: ./mvnw -V --no-transfer-progress -f jdbc-postgresql/pom.xml test
# Publishes to Maven Central once the job above passed, on a push and not on a pull
# request: a SNAPSHOT to the snapshot repository, a release by a version change only. The
# job is this workflow's own, so the module's move to a repository of its own takes it
# along; ci.yaml's deploy job is the model (.kb/session-workflow.md, "The deploy job").
deploy:
needs: [test]
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v7
- name: Import Secrets
id: secrets
uses: hashicorp/vault-action@v4.0.0
with:
exportToken: true
method: jwt
url: ${{ secrets.VAULT_ADDR }}
role: cicd
secrets: |
kv/data/cicd/maven_central username | MAVEN_CENTRAL_USERNAME ;
kv/data/cicd/maven_central password | MAVEN_CENTRAL_PASSWORD ;
kv/data/cicd/gpg secring | GPG_SECRING ;
kv/data/cicd/gpg passphrase | GPG_PASSPHRASE ;
- name: Set up JDK 25
uses: actions/setup-java@v6
with:
java-version: '25'
distribution: 'liberica'
cache: maven
gpg-private-key: ${{ steps.secrets.outputs.GPG_SECRING }}
gpg-passphrase: ${{ steps.secrets.outputs.GPG_PASSPHRASE }}
# The id is the pom's `publishingServerId`.
- name: Generates Maven Settings
uses: s4u/maven-settings-action@v4.0.0
with:
servers: |
[{
"id": "sonatype-central",
"username": "${{ steps.secrets.outputs.MAVEN_CENTRAL_USERNAME }}",
"password": "${{ steps.secrets.outputs.MAVEN_CENTRAL_PASSWORD }}"
}]
# The pom attaches the sources and the javadoc; -Psign signs them all.
- name: Deploy to Maven Central
run: |
./mvnw -V --no-transfer-progress -f jdbc-postgresql/pom.xml -Psign deploy \
-Dgpg.passphrase=${GPG_PASSPHRASE} -DskipTests
- name: Revoke token
if: always()
run: |
curl -X POST -s -H "X-Vault-Token: ${VAULT_TOKEN}" ${{ secrets.VAULT_ADDR }}/v1/auth/token/revoke-self || true