-
Notifications
You must be signed in to change notification settings - Fork 155
52 lines (44 loc) · 1.21 KB
/
build.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
name: Build and test
on:
push:
paths-ignore:
- '.github/**'
- '**/*.md'
tags-ignore:
- '**'
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Set Release version env variable
run: |
echo "TAG_NAME=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
# if no tag exists, this is expected to fail
- name: Check if tag contains SNAPSHOT
if: contains(env.TAG_NAME, 'SNAPSHOT') != true
run: |
echo "Tag '$TAG_NAME' does not contain 'SNAPSHOT', failing build."
exit 1
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 11
# push SNAPSHOT to maven central for testing
- name: Build
run: |
./mvnw clean deploy
- name: Upload jar
uses: actions/upload-artifact@v4
with:
name: sonar-pmd-plugin-${{ env.TAG_NAME }}
path: sonar-pmd-plugin/target/sonar-pmd-plugin-*.jar