-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (40 loc) · 1.55 KB
/
pull-request.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
---
name: build pull request
run-name: build pull request ${{ github.ref_name }}
# Builds a pull request, basing the artifact name on the branch name on which it is based, so it can be published
# without breaking things, and enabled to build other pull requests depending on the current one.
# For e.g. if you make a pull request based on a branch feature/foobar on the main branch which is 6.1-SNAPSHOT,
# then it will be built and published as 6.1.foobar-SNAPSHOT
on:
pull_request:
branches: [main, REL-*]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
steps:
- name: Cancel previous Action
uses: styfle/cancel-workflow-action@0.12.1
continue-on-error: true # for act
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
server-id: vpro-ossrh
server-username: SONATYPE_USERNAME
server-password: SONATYPE_PASSWORD
- name: Build with Maven
run: |
mvn -B -Dchangelist=.${GITHUB_HEAD_REF##*/}-SNAPSHOT -P"npm" -U -fae deploy
env:
SONATYPE_USERNAME: vpro
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD}}
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2.12.0
if: (success() || failure())
with:
junit_files: "**/target/surefire-reports/*.xml"