Skip to content

Update release.yml

Update release.yml #11

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Create new Release
on:
pull_request:
branches: [ production ]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'oracle'
- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build
- name: Determine Default Fragment
id: default-fragment
run: |
if [[ "${{ github.event.pull_request.labels }}" == *"enhancement"* ]]; then
echo "feature"
elif [[ "${{ github.event.pull_request.labels }}" == *"major"* ]]; then
echo "major"
else
echo "bug"
fi
shell: bash
- name: test
run: |
echo ${{join(steps.run_tests.outputs.*, '\n')}}
- name: Get Latest Release
uses: PssbleTrngle/VersionManagment@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
fallback: v1.0.0
prefix: v
default-fragment: ${{join(steps.run_tests.outputs.*, '\n')}}
- name: Generate Changelog
uses: Bullrich/generate-release-changelog@master
id: changelog
env:
REPO: ${{ github.repository }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release.outputs.next }}
files: build/libs/*.jar
body: |
Changes:
${{ steps.changelog.outputs.changelog }}