-
Notifications
You must be signed in to change notification settings - Fork 22
117 lines (102 loc) · 3.99 KB
/
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
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
106
107
108
109
110
111
112
113
114
115
116
117
name: Java CI
on:
push:
branches:
- master
- '[1-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[1-9]+.[0-9]+.x'
jobs:
snapshot:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['17', '21']
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
OCI_CLI_USER: ${{ secrets.OCI_CLI_USER }}
OCI_CLI_TENANCY: ${{ secrets.OCI_CLI_TENANCY }}
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CLI_FINGERPRINT }}
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CLI_KEY_CONTENT }}
OCI_CLI_REGION: ${{ secrets.OCI_CLI_REGION }}
GRAALVM_QUICK_BUILD: true
steps:
- name: "📥 Checkout repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "☕️ Install Java and Maven and set up Apache Maven Central"
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
server-password: GH_TOKEN
- name: "🔧 Setup GraalVM CE"
uses: graalvm/setup-graalvm@v1.2.5
with:
distribution: 'graalvm'
java-version: ${{ matrix.java }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "📦 Cache Maven packages"
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: "🔑 Log into OCIR"
if: env.OCI_AUTH_TOKEN != ''
uses: oracle-actions/login-ocir@v1.2
id: login-ocir
with:
auth_token: ${{ secrets.OCI_AUTH_TOKEN }}
- name: "⏬ Eagerly pull Docker images"
run: |
docker pull postgres:latest
- name: "🧪 Run tests"
run: |
./mvnw -q install -Dinvoker.skip=true && ./mvnw verify
- name: "📊 Publish Test Report"
if: always()
uses: mikepenz/action-junit-report@v4.3.1
with:
check_name: Java CI / Test Report
report_paths: '**/target/invoker-reports/TEST-*.xml'
check_retries: 'true'
- name: "🔎 Run static analysis"
if: env.SONAR_TOKEN != '' && matrix.java == '17'
run: ./mvnw sonar:sonar
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "❓ Determine current version"
if: success() && github.event_name == 'push' && matrix.java == '17'
id: release_version
run: echo ::set-output name=release_version::`./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout`
- name: "🌎 Generate site"
if: success() && github.event_name == 'push' && matrix.java == '17'
run: |
./mvnw site:site
cp -R target/site/apidocs/* micronaut-maven-plugin/target/site/apidocs
- name: "📑 Publish to Github Pages"
if: success() && github.event_name == 'push' && matrix.java == '17'
uses: micronaut-projects/github-pages-deploy-action@master
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCH: gh-pages
FOLDER: micronaut-maven-plugin/target/site
- name: "🛠 Set up Maven"
if: success() && github.event_name == 'push' && endsWith(steps.release_version.outputs.release_version, 'SNAPSHOT') && matrix.java == '17'
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.0
- name: "📦 Deploy snapshot"
if: success() && github.event_name == 'push' && endsWith(steps.release_version.outputs.release_version, 'SNAPSHOT') && matrix.java == '17'
uses: samuelmeuli/action-maven-publish@v1
with:
maven_args: "-Dinvoker.skip=true"
nexus_username: ${{ secrets.SONATYPE_USERNAME }}
nexus_password: ${{ secrets.SONATYPE_PASSWORD }}