First release of RetroMC Version #2
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: 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 }} |