forked from lbovet/vertx-rest-storage
-
Notifications
You must be signed in to change notification settings - Fork 8
55 lines (45 loc) · 2.05 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
# 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: Java CI with Maven
on:
workflow_dispatch:
push:
pull_request:
branches: [ "master", "develop" ]
jobs:
build_maven:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
server-id: sonatype-nexus-staging # Value of the distributionManagement/repository/id field of the pom.xml
server-username: CI_DEPLOY_USERNAME # env variable for username in deploy
server-password: CI_DEPLOY_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.CI_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: CI_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Start Redis
uses: supercharge/[email protected]
with:
redis-version: 4
- name: Install, unit test, integration test
run: mvn install -Dmaven.javadoc.skip=true -B -V
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- name: Release to maven central
if: github.ref_name == 'master' && github.event_name != 'pull_request' && github.repository == 'swisspost/vertx-rest-storage'
run: |
curl -s https://get.sdkman.io | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install groovy 3.0.8
chmod +x ./maybe-release.sh
./maybe-release.sh
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
CI_GPG_PASSPHRASE: ${{ secrets.CI_GPG_PASSPHRASE }}
- name: After release
run: bash <(curl -s https://codecov.io/bash)