Repository navigation
Expand file tree
/
Copy pathservlet-httpserver-keyvalue.yaml
More file actions
105 lines (101 loc) · 3.71 KB
/
Copy pathservlet-httpserver-keyvalue.yaml
File metadata and controls
105 lines (101 loc) · 3.71 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
94
95
96
97
98
99
100
101
102
103
104
105
name: servlet-httpserver-keyvalue
# The sessions of servlet-httpserver in wasi:keyvalue are a Maven project of their own,
# outside the root reactor (.kb/servlet-httpserver.md, "Sessions in wasi:keyvalue"); its two
# dependencies are SNAPSHOTs of this repository, installed first. A component of it on a
# host is FetchSpecE2eTest#javaHttpServer's, in ci.yaml.
on:
push:
branches:
- develop
- main
paths:
- servlet-httpserver-keyvalue/**
- servlet-httpserver/**
- rontolisp-java-api/**
- .github/workflows/servlet-httpserver-keyvalue.yaml
pull_request:
branches:
- develop
- main
paths:
- servlet-httpserver-keyvalue/**
- servlet-httpserver/**
- rontolisp-java-api/**
- .github/workflows/servlet-httpserver-keyvalue.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: Install the dependencies
run: |
./mvnw -V --no-transfer-progress -f servlet-httpserver/pom.xml install -DskipTests
./mvnw -V --no-transfer-progress -f rontolisp-java-api/pom.xml install
- name: Test
run: ./mvnw -V --no-transfer-progress -f servlet-httpserver-keyvalue/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 }}"
}]
- name: Install the dependencies
run: |
./mvnw -V --no-transfer-progress -f servlet-httpserver/pom.xml install -DskipTests
./mvnw -V --no-transfer-progress -f rontolisp-java-api/pom.xml install
# The pom attaches the sources and the javadoc; -Psign signs them all.
- name: Deploy to Maven Central
run: |
./mvnw -V --no-transfer-progress -f servlet-httpserver-keyvalue/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