-
Notifications
You must be signed in to change notification settings - Fork 19
52 lines (49 loc) · 1.3 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
49
50
51
# Builds using maven
# Pass the arguments you wish to run to maven_commands variable, default command will be mvn install
---
name: Maven
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'
jobs:
build:
strategy:
matrix:
java: [8, 11, 17]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
maven_commands: install # default is install
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
cache: 'maven'
- name: Build
run: mvn ${{ env.maven_commands }}
deploy:
if: startsWith(github.ref, 'refs/tags')
needs: build
runs-on: ubuntu-latest
env:
server: ome.staging
steps:
- uses: actions/checkout@v3
- name: Set up Repository
uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'zulu'
server-id: ${{ env.server }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Deploy
run: mvn deploy
env:
MAVEN_USERNAME: ${{ secrets.CI_DEPLOY_USER }}
MAVEN_PASSWORD: ${{ secrets.CI_DEPLOY_PASS }}