Skip to content

Commit

Permalink
Fix ci.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
making committed Apr 30, 2024
1 parent 88971b5 commit dab3848
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ on:
- src/**
- pom.xml
- .github/workflows/ci.yaml
pull_request_target:
pull_request:
branches:
- develop
- main
paths:
- src/**
- pom.xml
- .github/workflows/ci.yaml
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -27,29 +26,13 @@ jobs:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Import Secrets
id: secrets
uses: hashicorp/[email protected]
with:
exportToken: true
exportEnv: true
method: jwt
url: ${{ secrets.VAULT_ADDR }}
role: cicd
secrets: |
kv/data/cicd/sonatype username | SONATYPE_USERNAME ;
kv/data/cicd/sonatype password | SONATYPE_PASSWORD ;
kv/data/cicd/gpg secring | GPG_SECRING ;
kv/data/cicd/gpg passphrase | GPG_PASSPHRASE ;
- name: Set up JDK
uses: actions/setup-java@v3
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'liberica'
cache: maven
gpg-private-key: ${{ steps.secrets.outputs.GPG_SECRING }}
gpg-passphrase: ${{ steps.secrets.outputs.GPG_PASSPHRASE }}
- name: Unit Tests
if: (github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/main') || !startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/Java_Liberica_jdk/8')
run: ./mvnw -V test --no-transfer-progress
Expand All @@ -61,6 +44,21 @@ jobs:
if: (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main') && startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/Java_Liberica_jdk/8')
run: |
./mvnw -V javadoc:jar --no-transfer-progress
- name: Import Secrets
if: (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main') && startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/Java_Liberica_jdk/8')
id: secrets
uses: hashicorp/[email protected]
with:
exportToken: true
exportEnv: true
method: jwt
url: ${{ secrets.VAULT_ADDR }}
role: cicd
secrets: |
kv/data/cicd/sonatype username | SONATYPE_USERNAME ;
kv/data/cicd/sonatype password | SONATYPE_PASSWORD ;
kv/data/cicd/gpg secring | GPG_SECRING ;
kv/data/cicd/gpg passphrase | GPG_PASSPHRASE ;
- name: Deploy to sonatype-snapshots
if: github.ref == 'refs/heads/develop' && startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/Java_Liberica_jdk/8')
run: |
Expand Down Expand Up @@ -112,4 +110,4 @@ jobs:
- name: Revoke token
if: always()
run: |
curl -X POST -s -H "X-Vault-Token: ${VAULT_TOKEN}" ${{ secrets.VAULT_ADDR }}/v1/auth/token/revoke-self
curl -X POST -s -H "X-Vault-Token: ${VAULT_TOKEN}" ${{ secrets.VAULT_ADDR }}/v1/auth/token/revoke-self || true

0 comments on commit dab3848

Please sign in to comment.