-
Notifications
You must be signed in to change notification settings - Fork 21
73 lines (59 loc) · 2.58 KB
/
develop.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
# This builds develop and deploys a snapshot to our repository.
# Will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
name: Develop - Build and Deploy Snapshot
run-name: Develop - Build and Deploy Snapshot on ${{ github.ref_name }}
on:
push:
branches: [ develop ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
MVNCMD: mvn -B -ntp -s ${{ github.workspace }}/.github/settings-istrepo.xml
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
maven-version: 3.8.7
- name: Dump event context for debugging
continue-on-error: true # Debugging output only, and this annoyingly fails when the commit messge has a (
run: |
echo '${{ github.event_name }} for ${{ github.ref_type }} ${{ github.ref_name }} or ${{ github.event.ref }}'
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push
echo 'github.event:'
echo '${{ toJSON(github.event) }}'
- name: Dump github context
continue-on-error: true # Debugging output only, and this annoyingly fails when the commit message has a (
run: |
echo '${{ toJSON(github) }}'
- name: Git & Maven Status
run: |
git status --untracked-files --ignored
git log -3 --no-color
$MVNCMD -version
- name: Mvn Effective POM
run: $MVNCMD -P develop -N help:effective-pom
- name: Mvn Effective Settings
run: $MVNCMD -P develop -N help:effective-settings
- name: Build with Maven
# When parent-2:1.7 is active, -P ensureSnapshots will do a sanity check of the version number
run: $MVNCMD -P ensureSnapshots,test -B verify
- name: Sanitycheck version before deploying
run: |
echo "Version: "
$MVNCMD help:evaluate -Dexpression=project.version -q -DforceStdout
$MVNCMD help:evaluate -Dexpression=project.version -q -DforceStdout | egrep -- '-SNAPSHOT$' > /dev/null || exit 1
# unfortunately, this would require a snapshot parent if just called from the command line, so we cannot use it: :-(
# mvn org.apache.maven.plugins:maven-enforcer-plugin:3.0.0:enforce -Drules=requireSnapshotVersion
- name: Deploy with Maven
run: $MVNCMD -P develop deploy
env:
NEXUS_BUILD_USER: ${{ secrets.NEXUS_BUILD_USER }}
NEXUS_BUILD_PASSWD: ${{ secrets.NEXUS_BUILD_PASSWD }}