Skip to content

Merge pull request #2 from svgaming234/main #7

Merge pull request #2 from svgaming234/main

Merge pull request #2 from svgaming234/main #7

Workflow file for this run

name: Release Workflow
on:
push:
branches:
- main
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 1.8
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 8
- name: Get the version from pom.xml
id: get_version
run: echo "PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
- name: Fail if snapshot version
run: |
if [[ $PROJECT_VERSION == *"-SNAPSHOT"* ]]; then
echo "Snapshot versions are not releasable"
exit 0
fi
- name: Build with Maven
run: mvn clean package
- name: Create GitHub Release
if: ${{ !endsWith(env.PROJECT_VERSION, '-SNAPSHOT') }}
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.PROJECT_VERSION }}
files: |
target/*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}