-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (52 loc) · 1.85 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
52
53
54
55
56
57
58
59
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: FMI to VDM
on: [ workflow_dispatch, push, pull_request ]
env:
JAVA_VERSION: 11.0.3
SERVER_ID: ossrh
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- name: Build with Maven
run: mvn clean package
deploy:
if: github.ref == 'refs/heads/development'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: install-secret-key
name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
# - name: Configure deploy for snapshots
# if: github.ref == 'refs/heads/development'
# run: echo "SERVER_ID=artifactory-into-cps-snapshots" >> $GITHUB_ENV
- name: Environment variables
run: echo ${{ env.SERVER_ID }}
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
server-id: ${{ env.SERVER_ID }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Deploy
run: mvn -B deploy -Psonatype -P\!combinedtest
env:
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}