-
Notifications
You must be signed in to change notification settings - Fork 21
52 lines (51 loc) · 1.66 KB
/
deploy-snapshot.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
45
46
47
48
49
50
51
52
name: Deploy New SNAPSHOT
on:
workflow_dispatch:
push:
branches:
- main
paths:
- '**/pom.xml'
jobs:
deploy:
runs-on: ubuntu-latest
name: deploy
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: '8'
java-package: jdk
- name: Check for SNAPSHOT version
id: check-snapshot
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
if [[ $VERSION == *"-SNAPSHOT" ]]; then
echo "is_snapshot=true" >> $GITHUB_OUTPUT
# echo "::set-output name=is_snapshot::true"
else
echo "is_snapshot=false" >> $GITHUB_OUTPUT
# echo "::set-output name=is_snapshot::false"
fi
- name: Build and Deploy SNAPSHOT
if: steps.check-snapshot.outputs.is_snapshot == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OSS_SONATYPE_TOKEN: ${{ secrets.OSS_SONATYPE_TOKEN }}
run: mvn -B clean deploy --file pom.xml -s settings-template.xml
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: '17'
java-package: jdk
- name: Build and Deploy SNAPSHOT
if: steps.check-snapshot.outputs.is_snapshot == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OSS_SONATYPE_TOKEN: ${{ secrets.OSS_SONATYPE_TOKEN }}
run: mvn -B -pl server-jetty clean deploy --file pom.xml -s settings-template.xml