94 lines (84 loc) · 2.99 KB
/
maven-legacy.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
# 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: Maven Build for maintenance branch
on:
push:
branches: [ v1-maintenance ]
pull_request:
branches: [ v1-maintenance ]
jobs:
build-bundles:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B jacoco:prepare-agent install jacoco:report jacoco:report-aggregate --file pom.xml
build-plugins:
runs-on: ubuntu-latest
needs: build-bundles
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build plugins with Tycho
run: mvn -B -f plugins/eclipse install
deploy-bundles:
runs-on: ubuntu-latest
needs: build-bundles
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Install GPG key
run: |
cat <(echo -e "${{ secrets.GPG_PRIVATE_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Initialize variables
id: init
run: |
VERSION=$(mvn -B help:evaluate -Dexpression='project.version' $@ | grep -v '\[' | tail -1)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "$VERSION"
- name: Publish Snapshot to Central
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
if: contains(env.VERSION, 'SNAPSHOT' )
run: |
mvn \
--no-transfer-progress \
--batch-mode \
clean install deploy \
--settings .util/settings.xml \
-DskipTests
- name: Publish release to Central
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
if: ${{ !contains(env.VERSION, 'SNAPSHOT' ) }}
run: |
mvn \
--no-transfer-progress \
--batch-mode \
clean package javadoc:jar source:jar-no-fork gpg:sign install deploy \
--settings .util/settings.xml \
-DskipTests \
-Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} \
-P deploy-artifacts
# mvn clean package javadoc:jar source:jar-no-fork gpg:sign install deploy -DskipTests
#-s .util/settings.xml -DskipTests clean package javadoc:jar source:jar-no-fork gpg:sign install deploy
#