-
Notifications
You must be signed in to change notification settings - Fork 22
113 lines (99 loc) · 3.67 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
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']
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: Check out Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Java and Maven and set up Apache Maven Central
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
server-password: GH_TOKEN
- name: Setup GraalVM CE
uses: graalvm/setup-graalvm@v1
with:
java-version: ${{ matrix.java }}
distribution: 'graalvm-community'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Log into OCIR
uses: oracle-actions/login-ocir@v1.2
id: login-ocir
with:
auth_token: ${{ secrets.OCI_AUTH_TOKEN }}
- name: Run tests
run: |
./mvnw -q install -Dinvoker.skip=true && ./mvnw verify
- name: Publish Test Report
if: always()
uses: mikepenz/action-junit-report@v4.0.3
with:
check_name: Java CI / Test Report
report_paths: '**/target/invoker-reports/TEST-*.xml'
check_retries: 'true'
- name: Run static analysis
if: github.repository_owner == 'micronaut-projects'
run: ./mvnw sonar:sonar
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Determine current version
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'
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'
uses: micronaut-projects/github-pages-deploy-action@master
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BASE_BRANCH: master
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')
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')
uses: samuelmeuli/action-maven-publish@v1
with:
maven_args: "-Dinvoker.skip=true"
nexus_username: ${{ secrets.SONATYPE_USERNAME }}
nexus_password: ${{ secrets.SONATYPE_PASSWORD }}