-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.41 KB
/
build-main.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
---
name: Main Build
on:
push:
branches:
- main
env:
# renovate: datasource=java-version depName=java-jdk
JAVA_VERSION: '23.0.1+11'
# renovate: datasource=maven depName=org.apache.maven:maven
MAVEN_VERSION: '3.9.9'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up Maven
uses: stCarolas/setup-maven@07fbbe97d97ef44336b7382563d66743297e442f # v4.5
with:
maven-version: ${{ env.MAVEN_VERSION }}
- name: Set up Java
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: mvn --batch-mode --no-transfer-progress --update-snapshots verify
- name: Extract Maven project version
run: echo ::set-output name=version::$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
id: project
- name: Deploy Snapshot to GitHub Packages
if: ${{ endsWith(steps.project.outputs.version, '-SNAPSHOT') }}
run: mvn --batch-mode --no-transfer-progress -Dmaven.test.skip=true -Dtree=${{ github.sha }} deploy -P github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}