-
-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (45 loc) · 1.68 KB
/
maven.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
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: CI/CD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
verify:
name: Build and verify
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'adopt'
cache: maven
- name: Build and Verify with Maven
run: mvn -B verify --file pom.xml -s .github/ci-settings.xml
deploy:
name: Deploy to OSSRH
if: ${{ github.repository_owner == 'inverno-io' && (github.event_name == 'push' || github.event_name == 'schedule') }}
needs: verify
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'adopt'
cache: maven
- name: Get project version
run: echo "PROJECT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:evaluate -Dexpression=project.version -B | grep -v '\[')" >> $GITHUB_ENV
- name: Deploy with Maven
env:
INVERNO_OSSRH_USERNAME: ${{ secrets.INVERNO_OSSRH_USERNAME }}
INVERNO_OSSRH_PASSWORD: ${{ secrets.INVERNO_OSSRH_PASSWORD }}
if: ${{ endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }}
run: mvn -B deploy --file pom.xml -s .github/cd-settings.xml -pl '!inverno-core-test' -Pio.inverno.snapshot -Dmaven.test.skip=true