Deploy New SNAPSHOT #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |