9
9
- src/**
10
10
- pom.xml
11
11
- .github/workflows/ci.yaml
12
- pull_request_target :
12
+ pull_request :
13
13
branches :
14
14
- develop
15
15
- main
16
16
paths :
17
17
- src/**
18
18
- pom.xml
19
- - .github/workflows/ci.yaml
20
19
jobs :
21
20
build :
22
21
runs-on : ubuntu-latest
@@ -27,29 +26,13 @@ jobs:
27
26
id-token : write
28
27
contents : read
29
28
steps :
30
- - uses : actions/checkout@v3
31
- - name : Import Secrets
32
- id : secrets
33
-
34
- with :
35
- exportToken : true
36
- exportEnv : true
37
- method : jwt
38
- url : ${{ secrets.VAULT_ADDR }}
39
- role : cicd
40
- secrets : |
41
- kv/data/cicd/sonatype username | SONATYPE_USERNAME ;
42
- kv/data/cicd/sonatype password | SONATYPE_PASSWORD ;
43
- kv/data/cicd/gpg secring | GPG_SECRING ;
44
- kv/data/cicd/gpg passphrase | GPG_PASSPHRASE ;
45
- - name : Set up JDK
46
- uses : actions/setup-java@v3
29
+ - uses : actions/checkout@v4
30
+ - name : Set up JDK 17
31
+ uses : actions/setup-java@v4
47
32
with :
48
33
java-version : ${{ matrix.java }}
49
34
distribution : ' liberica'
50
35
cache : maven
51
- gpg-private-key : ${{ steps.secrets.outputs.GPG_SECRING }}
52
- gpg-passphrase : ${{ steps.secrets.outputs.GPG_PASSPHRASE }}
53
36
- name : Unit Tests
54
37
if : (github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/main') || !startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/Java_Liberica_jdk/8')
55
38
run : ./mvnw -V test --no-transfer-progress
61
44
if : (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main') && startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/Java_Liberica_jdk/8')
62
45
run : |
63
46
./mvnw -V javadoc:jar --no-transfer-progress
47
+ - name : Import Secrets
48
+ if : (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main') && startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/Java_Liberica_jdk/8')
49
+ id : secrets
50
+
51
+ with :
52
+ exportToken : true
53
+ exportEnv : true
54
+ method : jwt
55
+ url : ${{ secrets.VAULT_ADDR }}
56
+ role : cicd
57
+ secrets : |
58
+ kv/data/cicd/sonatype username | SONATYPE_USERNAME ;
59
+ kv/data/cicd/sonatype password | SONATYPE_PASSWORD ;
60
+ kv/data/cicd/gpg secring | GPG_SECRING ;
61
+ kv/data/cicd/gpg passphrase | GPG_PASSPHRASE ;
64
62
- name : Deploy to sonatype-snapshots
65
63
if : github.ref == 'refs/heads/develop' && startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/Java_Liberica_jdk/8')
66
64
run : |
@@ -112,4 +110,4 @@ jobs:
112
110
- name : Revoke token
113
111
if : always()
114
112
run : |
115
- curl -X POST -s -H "X-Vault-Token: ${VAULT_TOKEN}" ${{ secrets.VAULT_ADDR }}/v1/auth/token/revoke-self
113
+ curl -X POST -s -H "X-Vault-Token: ${VAULT_TOKEN}" ${{ secrets.VAULT_ADDR }}/v1/auth/token/revoke-self || true
0 commit comments