-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1 KB
/
build.yaml
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
on:
push:
branches:
- '**'
pull_request:
types:
- opened
- edited
workflow_dispatch:
jobs:
build-java-source:
name: build jar file
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Java build environmant
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Build with Maven
run: mvn package
- name: Get Version from POM
id: get-version
run: |
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "version=$version" >> $GITHUB_ENV
- name: Publish SNAPSHOT JAR
if: github.ref == 'refs/heads/main' && contains(env.version, '-SNAPSHOT')
run: mvn deploy -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}